]> git.sesse.net Git - x264/commitdiff
Shut up some incorrect gcc uninitialized variable warnings
authorFiona Glaser <fiona@x264.com>
Thu, 6 Jan 2011 04:29:36 +0000 (23:29 -0500)
committerFiona Glaser <fiona@x264.com>
Mon, 10 Jan 2011 19:38:46 +0000 (11:38 -0800)
common/osdep.h
encoder/encoder.c
encoder/ratecontrol.c

index cc51847e9d9b6225238906b99af68fbcb6e558e8..d2dcb79a3e13d559be46d67aabf77bfce7b7c9ec 100644 (file)
@@ -89,6 +89,8 @@
     ALIGNED_16( type name sub1 __VA_ARGS__ )
 #endif
 
+#define UNINIT(x) x=x
+
 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
 #define UNUSED __attribute__((unused))
 #define ALWAYS_INLINE __attribute__((always_inline)) inline
index 8c01210a5067c00a0e74aaaace60697c9c593f24..ac844db15bd76015fb506a672ff5336fdab0bd3d 100644 (file)
@@ -1862,7 +1862,7 @@ static int x264_slice_write( x264_t *h )
     int i_skip;
     int mb_xy, i_mb_x, i_mb_y;
     int i_skip_bak = 0; /* Shut up GCC. */
-    bs_t bs_bak;
+    bs_t UNINIT(bs_bak);
     x264_cabac_t cabac_bak;
     uint8_t cabac_prevbyte_bak = 0; /* Shut up GCC. */
     int mv_bits_bak = 0;
index dcdb538f61651e9d218bb1cecc378e84781dd5af..7aba57005bb73c608a6bfbe70367e4eebd67fd7b 100644 (file)
@@ -2028,7 +2028,7 @@ static float rate_estimate_qscale( x264_t *h )
 {
     float q;
     x264_ratecontrol_t *rcc = h->rc;
-    ratecontrol_entry_t rce;
+    ratecontrol_entry_t UNINIT(rce);
     int pict_type = h->sh.i_type;
     int64_t total_bits = 8*(h->stat.i_frame_size[SLICE_TYPE_I]
                           + h->stat.i_frame_size[SLICE_TYPE_P]