[mythtv] fix build on gcc-4

Ruediger Oertel ro at suse.de
Mon Apr 11 23:55:12 UTC 2005


Hi,

since the two other hunks I sent last night went in so easily,
I've got another patch I'm using to compile mythtv with gcc-4
(a cvs snapshot of April 10th of gcc-4).

libs/libavcodec/avcodec.h:
 move struct AVOption out of there and add forward declaration
libs/libavcodec/common.h:
 move struct AVOption to this place
 reason: an array of these structs is used and gcc-4
  will not accept arrays on forward declarated structs.
libs/libavcodec/libpostproc/postprocess_template.c:
 fix a place where gcc complains the location modified
 is not an lvalue

patch is attached. with this I'm able to build mythtv
completely on gcc-4.



-- 
with kind regards (mit freundlichem Grinsen),
   Ruediger Oertel (ro at novell.com,ro at suse.de,bugfinder at t-online.de)
----------------------------------------------------------------------
Linux fatou 2.6.11.4-17-smp #1 SMP Tue Mar 22 22:47:03 UTC 2005 x86_64
Key fingerprint = 17DC 6553 86A7 384B 53C5  CA5C 3CE4 F2E7 23F2 B417
-------------- next part --------------
--- libs/libavcodec/avcodec.h
+++ libs/libavcodec/avcodec.h
@@ -1760,40 +1760,7 @@
 } AVCodecContext;
 
 
-/**
- * AVOption.
- */
-typedef struct AVOption {
-    /** options' name */
-    const char *name; /* if name is NULL, it indicates a link to next */
-    /** short English text help or const struct AVOption* subpointer */
-    const char *help; //	const struct AVOption* sub;
-    /** offset to context structure where the parsed value should be stored */
-    int offset;
-    /** options' type */
-    int type;
-#define FF_OPT_TYPE_BOOL 1      ///< boolean - true,1,on  (or simply presence)
-#define FF_OPT_TYPE_DOUBLE 2    ///< double
-#define FF_OPT_TYPE_INT 3       ///< integer
-#define FF_OPT_TYPE_STRING 4    ///< string (finished with \0)
-#define FF_OPT_TYPE_MASK 0x1f	///< mask for types - upper bits are various flags
-//#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option
-#define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40)
-#define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80)
-    /** min value  (min == max   ->  no limits) */
-    double min;
-    /** maximum value for double/int */
-    double max;
-    /** default boo [0,1]l/double/int value */
-    double defval;
-    /**
-     * default string value (with optional semicolon delimited extra option-list
-     * i.e.   option1;option2;option3
-     * defval might select other then first argument as default
-     */
-    const char *defstr;
-#define FF_OPT_MAX_DEPTH 10
-} AVOption;
+struct AVOption;
 
 /**
  * Parse option(s) and sets fields in passed structure
--- libs/libavcodec/common.h	2005-04-04 19:20:24.076397448 +0000
+++ libs/libavcodec/common.h	2005-04-04 19:17:44.896596456 +0000
@@ -16,6 +16,38 @@
 #define M_PI    3.14159265358979323846
 #endif
 
+typedef struct AVOption {
+    /** options' name */
+    const char *name; /* if name is NULL, it indicates a link to next */
+    /** short English text help or const struct AVOption* subpointer */
+    const char *help; //        const struct AVOption* sub;
+    /** offset to context structure where the parsed value should be stored */
+    int offset;
+    /** options' type */
+    int type;
+#define FF_OPT_TYPE_BOOL 1      ///< boolean - true,1,on  (or simply presence)
+#define FF_OPT_TYPE_DOUBLE 2    ///< double
+#define FF_OPT_TYPE_INT 3       ///< integer
+#define FF_OPT_TYPE_STRING 4    ///< string (finished with \0)
+#define FF_OPT_TYPE_MASK 0x1f   ///< mask for types - upper bits are various flags
+//#define FF_OPT_TYPE_EXPERT 0x20 // flag for expert option
+#define FF_OPT_TYPE_FLAG (FF_OPT_TYPE_BOOL | 0x40)
+#define FF_OPT_TYPE_RCOVERRIDE (FF_OPT_TYPE_STRING | 0x80)
+    /** min value  (min == max   ->  no limits) */
+    double min;
+    /** maximum value for double/int */
+    double max;
+    /** default boo [0,1]l/double/int value */
+    double defval;
+    /**
+     * default string value (with optional semicolon delimited extra option-list
+     * i.e.   option1;option2;option3
+     * defval might select other then first argument as default
+     */
+    const char *defstr;
+#define FF_OPT_MAX_DEPTH 10
+} AVOption;
+
 #ifdef HAVE_AV_CONFIG_H
 /* only include the following when compiling package */
 #    include "config.h"
@@ -56,7 +88,6 @@
 #define AVOPTION_SUB(ptr) { .name = NULL, .help = (const char*)ptr }
 #define AVOPTION_END() AVOPTION_SUB(NULL)
 
-struct AVOption;
 #ifdef HAVE_MMX
 extern const struct AVOption avoptions_common[3 + 5];
 #else
--- libs/libavcodec/libpostproc/postprocess_template.c	2005-04-04 16:10:37.383437896 +0000
+++ libs/libavcodec/libpostproc/postprocess_template.c	2005-04-04 16:14:56.612029160 +0000
@@ -2898,6 +2898,8 @@ asm volatile(
 
 		src+= step; // src points to begin of the 8x8 Block
 
+		dc_mask &= eq_mask;
+
 		asm volatile(
 		"movq %4, %%mm6					\n\t"
 		"pcmpeqb %%mm5, %%mm5				\n\t"
@@ -2930,7 +2932,7 @@ asm volatile(
 		" js 1b						\n\t"
 
 		: "+r"(offset), "+r"(temp_sums)
-		: "r" ((long)step), "r"(src - offset), "m"(dc_mask & eq_mask)
+		: "r" ((long)step), "r"(src - offset), "m"(dc_mask)
 		);
 	}else
 		src+= step; // src points to begin of the 8x8 Block


More information about the mythtv-dev mailing list