]> git.videolan.org Git - x264.git/commitdiff
Shut up some incorrect gcc uninitialized variable warnings
authorJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 6 Jan 2011 04:29:36 +0000 (23:29 -0500)
committerJason Garrett-Glaser <darkshikari@gmail.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 b5f1d1d3a4d0482000a49c2ade844963d65c1e08..e8138be5060c74b588b24a9f1d393fcd8174f5e5 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 c1896d130da1b3a8ad0289cd17c8d001023021f1..227443aacaa8b97f9b87788dd7dd7d7afc09585f 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]