From 27d153db930a231718a18ec5a886c8789077c83a Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 1 May 2011 14:44:20 +0000 Subject: Fix nearly all residual 'variable set but not used' warnings reported from GCC 4.6.0. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29810 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/wmaprodec.c | 12 ++++-------- apps/plugins/chessbox/chessbox.c | 7 ++++++- apps/plugins/cube.c | 8 ++++++++ apps/plugins/flipit.c | 6 ++++++ apps/plugins/fractals/fractal.c | 11 ++++++++++- apps/plugins/oscilloscope.c | 6 +++++- apps/plugins/rockblox.c | 4 ++++ apps/plugins/sliding_puzzle.c | 4 ++++ apps/plugins/star.c | 8 ++++++++ apps/plugins/text_viewer/text_viewer.c | 4 ++++ apps/plugins/vu_meter.c | 4 ++++ 11 files changed, 63 insertions(+), 11 deletions(-) diff --git a/apps/codecs/libwmapro/wmaprodec.c b/apps/codecs/libwmapro/wmaprodec.c index 018ea7c304..c72bd0f10f 100644 --- a/apps/codecs/libwmapro/wmaprodec.c +++ b/apps/codecs/libwmapro/wmaprodec.c @@ -1382,20 +1382,16 @@ static int decode_frame(WMAProDecodeCtx *s) /** no idea what these are for, might be the number of samples that need to be skipped at the beginning or end of a stream */ if (get_bits1(gb)) { - int skip; - /** usually true for the first frame */ if (get_bits1(gb)) { - skip = get_bits(gb, av_log2(s->samples_per_frame * 2)); - DEBUGF("start skip: %i\n", skip); + get_bits(gb, av_log2(s->samples_per_frame * 2)); + DEBUGF("start skip\n"); } - /** sometimes true for the last frame */ if (get_bits1(gb)) { - skip = get_bits(gb, av_log2(s->samples_per_frame * 2)); - DEBUGF("end skip: %i\n", skip); + get_bits(gb, av_log2(s->samples_per_frame * 2)); + DEBUGF("end skip\n"); } - } DEBUGF("BITSTREAM: frame header length was %i\n", diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 6e77b62718..6437c8d4fd 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -641,7 +641,10 @@ static int cb_menu(void) struct cb_command cb_getcommand (void) { static short x = 4 , y = 3 ; short c , r , l; - int button, lastbutton = BUTTON_NONE; + int button; +#if defined(CB_PLAY_PRE) || defined(CB_SELECT_PRE) + int lastbutton = BUTTON_NONE; +#endif int marked = false , from_marked = false ; short marked_x = 0 , marked_y = 0 ; struct cb_command result = { 0, {0,0,0,0,0}, 0 }; @@ -761,8 +764,10 @@ struct cb_command cb_getcommand (void) { } break; } +#if defined(CB_PLAY_PRE) || defined(CB_SELECT_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } } diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c index 6d0e14f8f0..9540023029 100644 --- a/apps/plugins/cube.c +++ b/apps/plugins/cube.c @@ -649,7 +649,11 @@ enum plugin_status plugin_start(const void* parameter) #endif int button; +#if defined(CUBE_MODE_PRE) || \ + defined(CUBE_PAUSE_PRE) || \ + defined(CUBE_HIGHSPEED_PRE) int lastbutton = BUTTON_NONE; +#endif int curr = 0; bool highspeed = false; bool paused = false; @@ -855,8 +859,12 @@ enum plugin_status plugin_start(const void* parameter) exit_on_usb(button); break; } +#if defined(CUBE_MODE_PRE) || \ + defined(CUBE_PAUSE_PRE) || \ + defined(CUBE_HIGHSPEED_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } return PLUGIN_OK; diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index a837b1a64e..a61839cc0c 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c @@ -615,7 +615,10 @@ static bool flipit_loop(void) { int i; int button; +#if defined(FLIPIT_SOLVE_PRE) || defined(FLIPIT_STEP_PRE) || \ + defined(FLIPIT_TOGGLE_PRE) || defined(FLIPIT_UP_PRE) int lastbutton = BUTTON_NONE; +#endif flipit_init(); while(true) { @@ -729,8 +732,11 @@ static bool flipit_loop(void) return PLUGIN_USB_CONNECTED; break; } +#if defined(FLIPIT_SOLVE_PRE) || defined(FLIPIT_STEP_PRE) || \ + defined(FLIPIT_TOGGLE_PRE) || defined(FLIPIT_UP_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } } diff --git a/apps/plugins/fractals/fractal.c b/apps/plugins/fractals/fractal.c index 21d33387b5..5d8413ca6f 100644 --- a/apps/plugins/fractals/fractal.c +++ b/apps/plugins/fractals/fractal.c @@ -93,7 +93,12 @@ static void cleanup(void) enum plugin_status plugin_start(const void* parameter) { +#if defined(FRACTAL_ZOOM_OUT_PRE) || \ + defined(FRACTAL_ZOOM_IN_PRE) || \ + defined(FRACTAL_PRECISION_DEC_PRE) || \ + defined(FRACTAL_PRECISION_INC) long lastbutton = BUTTON_NONE; +#endif int redraw = REDRAW_FULL; struct fractal_ops *ops = &mandelbrot_ops; @@ -246,9 +251,13 @@ enum plugin_status plugin_start(const void* parameter) exit_on_usb(button); break; } - +#if defined(FRACTAL_ZOOM_OUT_PRE) || \ + defined(FRACTAL_ZOOM_IN_PRE) || \ + defined(FRACTAL_PRECISION_DEC_PRE) || \ + defined(FRACTAL_PRECISION_INC) if (button != BUTTON_NONE) lastbutton = button; +#endif } return PLUGIN_OK; } diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c index c55948dce9..07bf1da8bb 100644 --- a/apps/plugins/oscilloscope.c +++ b/apps/plugins/oscilloscope.c @@ -786,7 +786,9 @@ void cleanup(void) enum plugin_status plugin_start(const void* parameter) { int button, vol; +#if defined(OSCILLOSCOPE_DRAWMODE_PRE) || defined(OSCILLOSCOPE_ORIENTATION_PRE) int lastbutton = BUTTON_NONE; +#endif bool exit = false; bool paused = false; bool tell_speed; @@ -917,9 +919,11 @@ enum plugin_status plugin_start(const void* parameter) exit_on_usb(button); break; } +#if defined(OSCILLOSCOPE_DRAWMODE_PRE) || defined(OSCILLOSCOPE_ORIENTATION_PRE) if (button != BUTTON_NONE) lastbutton = button; - +#endif + if (tell_speed) { rb->snprintf(message, sizeof(message), "%s%d", diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c index b3767c1a15..dd0bef8c28 100644 --- a/apps/plugins/rockblox.c +++ b/apps/plugins/rockblox.c @@ -1332,7 +1332,9 @@ static int rockblox_menu(void) static int rockblox_loop (void) { int button; +#if defined(ROCKBLOX_OFF_PRE) || defined(ROCKBLOX_DROP_PRE) int lastbutton = BUTTON_NONE; +#endif long next_down_tick = *rb->current_tick + level_speed(rockblox_status.level); if (rockblox_menu()) { @@ -1450,8 +1452,10 @@ static int rockblox_loop (void) return PLUGIN_USB_CONNECTED; break; } +#if defined(ROCKBLOX_OFF_PRE) || defined(ROCKBLOX_DROP_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif #ifdef HAVE_SCROLLWHEEL /* check if we should enable the scroll wheel, if events diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c index aeac96dfba..92c9db768f 100644 --- a/apps/plugins/sliding_puzzle.c +++ b/apps/plugins/sliding_puzzle.c @@ -618,7 +618,9 @@ static void puzzle_init(void) static int puzzle_loop(void) { int button; +#if defined(PUZZLE_SHUFFLE_PICTURE_PRE) int lastbutton = BUTTON_NONE; +#endif bool load_success; puzzle_init(); @@ -689,8 +691,10 @@ static int puzzle_loop(void) return PLUGIN_USB_CONNECTED; break; } +#if defined(PUZZLE_SHUFFLE_PICTURE_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } } diff --git a/apps/plugins/star.c b/apps/plugins/star.c index 3506f4b09e..c9797fd85b 100644 --- a/apps/plugins/star.c +++ b/apps/plugins/star.c @@ -945,7 +945,11 @@ static int star_run_game(int current_level) int move_x = 0; int move_y = 0; int key; +#if defined(STAR_LEVEL_DOWN_PRE) || \ + defined(STAR_LEVEL_UP_PRE) || \ + defined(STAR_TOGGLE_CONTROL_PRE) int lastkey = BUTTON_NONE; +#endif if (!star_load_level(current_level)) return 0; @@ -1033,8 +1037,12 @@ static int star_run_game(int current_level) } break; } +#if defined(STAR_LEVEL_DOWN_PRE) || \ + defined(STAR_LEVEL_UP_PRE) || \ + defined(STAR_TOGGLE_CONTROL_PRE) if (key != BUTTON_NONE) lastkey = key; +#endif } if (control == STAR_CONTROL_BALL) diff --git a/apps/plugins/text_viewer/text_viewer.c b/apps/plugins/text_viewer/text_viewer.c index 3c04499b18..29a2e6d12a 100644 --- a/apps/plugins/text_viewer/text_viewer.c +++ b/apps/plugins/text_viewer/text_viewer.c @@ -31,7 +31,9 @@ enum plugin_status plugin_start(const void* file) { int button; +#if defined(TV_AUTOSCROLL_PRE) int lastbutton = BUTTON_NONE; +#endif bool autoscroll = false; long old_tick; bool done = false; @@ -211,7 +213,9 @@ enum plugin_status plugin_start(const void* file) } if (button != BUTTON_NONE) { +#if defined(TV_AUTOSCROLL_PRE) lastbutton = button; +#endif rb->yield(); } if (autoscroll) diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c index 8877d7f460..5266214723 100644 --- a/apps/plugins/vu_meter.c +++ b/apps/plugins/vu_meter.c @@ -781,7 +781,9 @@ void digital_meter(void) { enum plugin_status plugin_start(const void* parameter) { int button; +#if defined(VUMETER_HELP_PRE) || defined(VUMETER_MENU_PRE) int lastbutton = BUTTON_NONE; +#endif (void) parameter; @@ -859,7 +861,9 @@ enum plugin_status plugin_start(const void* parameter) { return PLUGIN_USB_CONNECTED; break; } +#if defined(VUMETER_HELP_PRE) || defined(VUMETER_MENU_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } } -- cgit v1.2.3