From b519e0fba6959fc9725e8c2f83f5926eca8621f8 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Wed, 5 Jan 2011 23:29:36 -0500 Subject: [PATCH] Shut up some incorrect gcc uninitialized variable warnings --- common/osdep.h | 2 ++ encoder/encoder.c | 2 +- encoder/ratecontrol.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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] -- 2.47.3