From: Jason Garrett-Glaser Date: Thu, 6 Jan 2011 04:29:36 +0000 (-0500) Subject: Shut up some incorrect gcc uninitialized variable warnings X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=b519e0fba6959fc9725e8c2f83f5926eca8621f8;p=x264.git Shut up some incorrect gcc uninitialized variable warnings --- diff --git a/common/osdep.h b/common/osdep.h index cc51847e..d2dcb79a 100644 --- a/common/osdep.h +++ b/common/osdep.h @@ -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 diff --git a/encoder/encoder.c b/encoder/encoder.c index b5f1d1d3..e8138be5 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -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; diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index c1896d13..227443aa 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -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]