[MPlayer-dev-eng] [PATCH] make m_struct_t defaults const

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sat Jan 27 18:07:04 CET 2007


Hello,
defaults really should be marked constant since they are and it also
moves 480 bytes from .data to .rodata *g*
If there are no objections I will apply soon.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: m_struct.h
===================================================================
--- m_struct.h	(revision 22033)
+++ m_struct.h	(working copy)
@@ -17,7 +17,7 @@
   /// size of the whole struct
   unsigned int size;
   /// Pointer to a struct filled with the default settings
-  void* defaults;
+  const void* defaults;
   /// Field list.
   /** The p field of the \ref m_option struct must contain the offset
    *  of the member in the struct (use M_ST_OFF macro for this).
Index: libmpcodecs/vf_hue.c
===================================================================
--- libmpcodecs/vf_hue.c	(revision 22033)
+++ libmpcodecs/vf_hue.c	(working copy)
@@ -21,7 +21,7 @@
 	uint8_t *buf[2];
 	float hue;
 	float saturation;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   {NULL, NULL},
   0.0,
   1.0,
Index: libmpcodecs/vf_crop.c
===================================================================
--- libmpcodecs/vf_crop.c	(revision 22033)
+++ libmpcodecs/vf_crop.c	(working copy)
@@ -16,7 +16,7 @@
 static struct vf_priv_s {
     int crop_w,crop_h;
     int crop_x,crop_y;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   -1,-1,
   -1,-1
 };
Index: libmpcodecs/vf_eq.c
===================================================================
--- libmpcodecs/vf_eq.c	(revision 22033)
+++ libmpcodecs/vf_eq.c	(working copy)
@@ -21,7 +21,7 @@
 	unsigned char *buf;
 	int brightness;
 	int contrast;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   NULL,
   0,
   0
Index: libmpcodecs/vf_noformat.c
===================================================================
--- libmpcodecs/vf_noformat.c	(revision 22033)
+++ libmpcodecs/vf_noformat.c	(working copy)
@@ -16,7 +16,7 @@
 
 static struct vf_priv_s {
     unsigned int fmt;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   IMGFMT_YV12
 };
 
Index: libmpcodecs/vf_ass.c
===================================================================
--- libmpcodecs/vf_ass.c	(revision 22033)
+++ libmpcodecs/vf_ass.c	(working copy)
@@ -64,7 +64,7 @@
 
 	unsigned char* planes[3];
 	unsigned char* dirty_rows;
-} vf_priv_dflt;
+} const vf_priv_dflt;
 
 extern int opt_screen_size_x;
 extern int opt_screen_size_y;
Index: libmpcodecs/vf_expand.c
===================================================================
--- libmpcodecs/vf_expand.c	(revision 22033)
+++ libmpcodecs/vf_expand.c	(working copy)
@@ -33,7 +33,7 @@
     unsigned char* fb_ptr;
     int passthrough;
     int first_slice;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   -1,-1,
   -1,-1,
   0,
Index: libmpcodecs/vf_scale.c
===================================================================
--- libmpcodecs/vf_scale.c	(revision 22033)
+++ libmpcodecs/vf_scale.c	(working copy)
@@ -31,7 +31,7 @@
     int noup;
     int accurate_rnd;
     int query_format_cache[64];
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   -1,-1,
   0,
   {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT},
Index: libmpcodecs/vf_delogo.c
===================================================================
--- libmpcodecs/vf_delogo.c	(revision 22033)
+++ libmpcodecs/vf_delogo.c	(working copy)
@@ -45,7 +45,7 @@
 static struct vf_priv_s {
     unsigned int outfmt;
     int xoff, yoff, lw, lh, band, show;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
     0,
     0, 0, 0, 0, 0, 0
 };
Index: libmpcodecs/vf_format.c
===================================================================
--- libmpcodecs/vf_format.c	(revision 22033)
+++ libmpcodecs/vf_format.c	(working copy)
@@ -16,7 +16,7 @@
 
 static struct vf_priv_s {
     unsigned int fmt;
-} vf_priv_dflt = {
+} const vf_priv_dflt = {
   IMGFMT_YUY2
 };
 


More information about the MPlayer-dev-eng mailing list