From 67f215032d8bab2571aad2da739d72512c064ca4 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 8 May 2011 21:06:38 +0000 Subject: Fix a bunch of 'variable set but not used' warnings reported from GCC 4.6.0. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29841 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/doom/am_map.c | 2 -- apps/plugins/doom/d_main.c | 2 -- apps/plugins/doom/g_game.c | 9 ++------- apps/plugins/doom/hu_lib.c | 4 ++-- apps/plugins/doom/i_sound.c | 15 ++++++++------- apps/plugins/doom/m_menu.c | 14 ++++++-------- apps/plugins/doom/p_doors.c | 2 -- apps/plugins/doom/p_spec.c | 5 ----- apps/plugins/doom/v_video.c | 3 --- apps/plugins/doom/wi_stuff.c | 3 --- apps/plugins/imageviewer/imageviewer.c | 10 ++++++++-- apps/plugins/midi/midiutil.c | 3 +-- apps/plugins/minesweeper.c | 4 ++++ apps/plugins/mpegplayer/mpegplayer.c | 12 ++++++------ apps/plugins/reversi/reversi-gui.c | 7 ++++++- apps/plugins/sokoban.c | 8 ++++++-- apps/plugins/sudoku/sudoku.c | 4 ++++ firmware/common/dircache.c | 2 +- 18 files changed, 54 insertions(+), 55 deletions(-) diff --git a/apps/plugins/doom/am_map.c b/apps/plugins/doom/am_map.c index ff74e9938f..88e27b4dc2 100644 --- a/apps/plugins/doom/am_map.c +++ b/apps/plugins/doom/am_map.c @@ -632,7 +632,6 @@ boolean AM_Responder ( event_t* ev ) { int rc; - static int cheatstate=0; static int bigstate=0; static char buffer[20]; int ch; // phares @@ -732,7 +731,6 @@ boolean AM_Responder } else // phares { - cheatstate=0; rc = false; } } diff --git a/apps/plugins/doom/d_main.c b/apps/plugins/doom/d_main.c index 498d93cb62..be45e6a37e 100644 --- a/apps/plugins/doom/d_main.c +++ b/apps/plugins/doom/d_main.c @@ -179,7 +179,6 @@ void D_Display (void) { static boolean isborderstate IDATA_ATTR= false; static boolean borderwillneedredraw IDATA_ATTR= false; - static boolean inhelpscreensstate IDATA_ATTR= false; static gamestate_t oldgamestate IDATA_ATTR= -1; boolean wipe; boolean viewactive = false, isborder = false; @@ -254,7 +253,6 @@ void D_Display (void) HU_Drawer(); } - inhelpscreensstate = inhelpscreens; isborderstate = isborder; oldgamestate = wipegamestate = gamestate; diff --git a/apps/plugins/doom/g_game.c b/apps/plugins/doom/g_game.c index 8aab9fc3cf..e41c84c378 100644 --- a/apps/plugins/doom/g_game.c +++ b/apps/plugins/doom/g_game.c @@ -1549,7 +1549,7 @@ static const size_t num_version_headers = sizeof(version_headers) / sizeof(versi void G_DoLoadGame(void) { - int length, i; + int i; // CPhipps - do savegame filename stuff here char name[100+1]; // killough 3/22/98 int savegame_compatibility = -1; @@ -1558,7 +1558,7 @@ void G_DoLoadGame(void) gameaction = ga_nothing; - length = M_ReadFile(name, &savebuffer); + M_ReadFile(name, &savebuffer); save_p = savebuffer + SAVESTRINGSIZE; // CPhipps - read the description field, compare with supported ones @@ -2565,7 +2565,6 @@ static const byte* G_ReadDemoHeader(const byte *demo_p) skill_t skill; int i, episode, map; int demover; - const byte *option_p = NULL; /* killough 11/98 */ basetic = gametic; // killough 9/29/98 @@ -2674,10 +2673,6 @@ static const byte* G_ReadDemoHeader(const byte *demo_p) deathmatch = *demo_p++; consoleplayer = *demo_p++; - /* killough 11/98: save option pointer for below */ - if (mbf_features) - option_p = demo_p; - demo_p = G_ReadOptions(demo_p); // killough 3/1/98: Read game options if (demover == 200) // killough 6/3/98: partially fix v2.00 demos diff --git a/apps/plugins/doom/hu_lib.c b/apps/plugins/doom/hu_lib.c index df2fa883ec..eacb26b287 100644 --- a/apps/plugins/doom/hu_lib.c +++ b/apps/plugins/doom/hu_lib.c @@ -532,7 +532,7 @@ void HUlib_drawMBg // void HUlib_drawMText(hu_mtext_t* m) { - int i, idx, y; + int i, idx; hu_textline_t *l; if (!*m->on) @@ -541,7 +541,7 @@ void HUlib_drawMText(hu_mtext_t* m) // draw everything if (hud_list_bgon) HUlib_drawMBg(m->x,m->y,m->w,m->h,m->bg); - y = m->y + HU_REFRESHSPACING; + for (i=0 ; inl ; i++) { idx = m->cl - i; diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c index 35cecd8abb..2d7b592818 100644 --- a/apps/plugins/doom/i_sound.c +++ b/apps/plugins/doom/i_sound.c @@ -534,26 +534,27 @@ static int musicdies=-1; void I_PlaySong(int handle, int looping) { // UNUSED. - handle = looping = 0; + (void)handle; + (void)looping; musicdies = gametic + TICRATE*30; } void I_PauseSong (int handle) { // UNUSED. - handle = 0; + (void)handle; } void I_ResumeSong (int handle) { // UNUSED. - handle = 0; + (void)handle; } void I_StopSong(int handle) { // UNUSED. - handle = 0; + (void)handle; looping = 0; musicdies = 0; @@ -562,13 +563,13 @@ void I_StopSong(int handle) void I_UnRegisterSong(int handle) { // UNUSED. - handle = 0; + (void)handle; } int I_RegisterSong(const void *data) { // UNUSED. - data = NULL; + (void)data; return 1; } @@ -577,7 +578,7 @@ int I_RegisterSong(const void *data) int I_QrySongPlaying(int handle) { // UNUSED. - handle = 0; + (void)handle; return looping || musicdies > gametic; } diff --git a/apps/plugins/doom/m_menu.c b/apps/plugins/doom/m_menu.c index b0b0f9fff8..aa82959aaf 100644 --- a/apps/plugins/doom/m_menu.c +++ b/apps/plugins/doom/m_menu.c @@ -522,7 +522,6 @@ menu_t SaveDef = void M_ReadSaveStrings(void) { int handle; - int count; int i; char name[256]; @@ -540,7 +539,7 @@ void M_ReadSaveStrings(void) LoadMenu[i].status = 0; continue; } - count = read (handle, &savegamestrings[i], SAVESTRINGSIZE); + read (handle, &savegamestrings[i], SAVESTRINGSIZE); close (handle); LoadMenu[i].status = 1; } @@ -1027,8 +1026,7 @@ void M_Options(int choice) // void M_ChangeMessages(int choice) { - // warning: unused parameter `int choice' - choice = 0; + (void)choice; showMessages = 1 - showMessages; if (!showMessages) @@ -1059,7 +1057,7 @@ void M_EndGameResponse(int ch) void M_EndGame(int choice) { - choice = 0; + (void)choice; if (!usergame) { S_StartSound(NULL,sfx_oof); @@ -1083,19 +1081,19 @@ void M_EndGame(int choice) // void M_ReadThis(int choice) { - choice = 0; + (void)choice; M_SetupNextMenu(&ReadDef1); } void M_ReadThis2(int choice) { - choice = 0; + (void)choice; M_SetupNextMenu(&ReadDef2); } void M_FinishReadThis(int choice) { - choice = 0; + (void)choice; M_SetupNextMenu(&MainDef); } diff --git a/apps/plugins/doom/p_doors.c b/apps/plugins/doom/p_doors.c index 0b6d777e17..750b3474bd 100644 --- a/apps/plugins/doom/p_doors.c +++ b/apps/plugins/doom/p_doors.c @@ -434,7 +434,6 @@ int EV_VerticalDoor mobj_t* thing ) { player_t* player; - int secnum; sector_t* sec; vldoor_t* door; @@ -492,7 +491,6 @@ int EV_VerticalDoor // get the sector on the second side of activating linedef sec = sides[line->sidenum[1]].sector; - secnum = sec-sectors; /* if door already has a thinker, use it * cph 2001/04/05 - diff --git a/apps/plugins/doom/p_spec.c b/apps/plugins/doom/p_spec.c index f2757f8399..8ad77a732d 100644 --- a/apps/plugins/doom/p_spec.c +++ b/apps/plugins/doom/p_spec.c @@ -2394,11 +2394,6 @@ void P_SpawnSpecials (void) { sector_t* sector; int i; - int episode; - - episode = 1; - if (W_CheckNumForName("texture2") >= 0) - episode = 2; // See if -timer needs to be used. levelTimer = false; diff --git a/apps/plugins/doom/v_video.c b/apps/plugins/doom/v_video.c index 76993ea5ee..8c475614ff 100644 --- a/apps/plugins/doom/v_video.c +++ b/apps/plugins/doom/v_video.c @@ -525,12 +525,9 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch, int DXI = (320<<16) / SCREENWIDTH; int DY = (SCREENHEIGHT<<16) / 200; register int DYI = (200<<16) / SCREENHEIGHT; - int DY2, DYI2; stretchx = ( x * DX ) >> 16; stretchy = ( y * DY ) >> 16; - DY2 = DY / 2; - DYI2 = DYI* 2; if (!scrn) V_MarkRect ( stretchx, stretchy, (SHORT( patch->width ) * DX ) >> 16, diff --git a/apps/plugins/doom/wi_stuff.c b/apps/plugins/doom/wi_stuff.c index 5aec366026..7c7831d084 100644 --- a/apps/plugins/doom/wi_stuff.c +++ b/apps/plugins/doom/wi_stuff.c @@ -1176,11 +1176,8 @@ void WI_drawDeathmatchStats(void) int y; int w; - int lh; // line height int halfface = V_NamePatchWidth(facebackp)/2; - lh = WI_SPACINGY; - WI_slamBackground(); // draw animated background diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index 0635a877d4..6750c6c912 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c @@ -345,7 +345,9 @@ static int show_menu(void) /* return 1 to quit */ static int ask_and_get_audio_buffer(const char *filename) { int button; +#if defined(IMGVIEW_ZOOM_PRE) int lastbutton = BUTTON_NONE; +#endif rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_clear_display(); rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); @@ -414,9 +416,10 @@ static int ask_and_get_audio_buffer(const char *filename) == SYS_USB_CONNECTED) return PLUGIN_USB_CONNECTED; } - +#if defined(IMGVIEW_ZOOM_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } } #endif /* USE_PLUG_BUF */ @@ -548,7 +551,9 @@ static void pan_view_down(struct image_info *info) static int scroll_bmp(struct image_info *info) { int button; +#if defined(IMGVIEW_ZOOM_PRE) || defined(IMGVIEW_MENU_PRE) int lastbutton = BUTTON_NONE; +#endif while (true) { @@ -669,9 +674,10 @@ static int scroll_bmp(struct image_info *info) break; } /* switch */ - +#if defined(IMGVIEW_ZOOM_PRE) || defined(IMGVIEW_MENU_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif } /* while (true) */ } diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c index e10c593dc1..f960b72654 100644 --- a/apps/plugins/midi/midiutil.c +++ b/apps/plugins/midi/midiutil.c @@ -136,11 +136,10 @@ int midi_debug(const char *fmt, ...) { static int p_xtpt = 0; char p_buf[50]; - bool ok; va_list ap; va_start(ap, fmt); - ok = rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); + rb->vsnprintf(p_buf,sizeof(p_buf), fmt, ap); va_end(ap); int i=0; diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index adecc00502..5b5b422e08 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c @@ -692,7 +692,9 @@ enum minesweeper_status minesweeper( void ) { int i, j; int button; +#if defined(HAVE_TOUCHSCREEN) || defined(MINESWP_TOGGLE_PRE) int lastbutton = BUTTON_NONE; +#endif /* the cursor coordinates */ int x=0, y=0; @@ -898,8 +900,10 @@ enum minesweeper_status minesweeper( void ) return MINESWEEPER_USB; break; } +#if defined(HAVE_TOUCHSCREEN) || defined(MINESWP_TOGGLE_PRE) if( button != BUTTON_NONE ) lastbutton = button; +#endif } } diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 22136d8393..2a84307857 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -607,7 +607,7 @@ static void draw_oriented_mono_bitmap_part(const unsigned char *src, { const unsigned char *src_end; fb_data *dst, *dst_end; - unsigned fg_pattern, bg_pattern; + unsigned fg_pattern; if (x + width > SCREEN_WIDTH) width = SCREEN_WIDTH - x; /* Clip right */ @@ -623,8 +623,8 @@ static void draw_oriented_mono_bitmap_part(const unsigned char *src, if (height <= 0) return; /* nothing left to do */ - fg_pattern = rb->lcd_get_foreground(); - bg_pattern = rb->lcd_get_background(); + fg_pattern = rb->lcd_get_foreground(); + /*bg_pattern =*/ rb->lcd_get_background(); src += stride * (src_y >> 3) + src_x; /* move starting point */ src_y &= 7; @@ -719,7 +719,7 @@ static void draw_oriented_alpha_bitmap_part(const unsigned char *src, int width, int height) { fb_data *dst, *dst_start; - unsigned fg_pattern, bg_pattern; + unsigned fg_pattern; if (x + width > SCREEN_WIDTH) width = SCREEN_WIDTH - x; /* Clip right */ @@ -738,8 +738,8 @@ static void draw_oriented_alpha_bitmap_part(const unsigned char *src, /* initialize blending */ BLEND_INIT; - fg_pattern = rb->lcd_get_foreground(); - bg_pattern = rb->lcd_get_background(); + fg_pattern = rb->lcd_get_foreground(); + /*bg_pattern=*/ rb->lcd_get_background(); dst_start = rb->lcd_framebuffer + (LCD_WIDTH - y - 1) + x*LCD_WIDTH; int col, row = height; diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c index 6f5d53da58..184b5ad7f0 100644 --- a/apps/plugins/reversi/reversi-gui.c +++ b/apps/plugins/reversi/reversi-gui.c @@ -610,7 +610,10 @@ enum plugin_status plugin_start(const void *parameter) { #ifdef HAVE_TOUCHSCREEN int button_x, button_y; #endif +#if defined(REVERSI_BUTTON_MENU_LONGPRESS) || \ + defined(REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS) int lastbutton = BUTTON_NONE; +#endif int row, col; int w_cnt, b_cnt; @@ -787,10 +790,12 @@ enum plugin_status plugin_start(const void *parameter) { /* Quit if USB has been connected */ return PLUGIN_USB_CONNECTED; } - +#if defined(REVERSI_BUTTON_MENU_LONGPRESS) || \ + defined(REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS) if (button != BUTTON_NONE) { lastbutton = button; } +#endif } return PLUGIN_OK; diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 29bdbbbba5..157f53ca92 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c @@ -1527,7 +1527,10 @@ static int sokoban_menu(void) static bool sokoban_loop(void) { bool moved; - int i = 0, button = 0, lastbutton = 0; + int i = 0, button = 0; +#if defined(SOKOBAN_UNDO_PRE) + int lastbutton = 0; +#endif int w, h; char *loc; @@ -1629,8 +1632,9 @@ static bool sokoban_loop(void) return PLUGIN_USB_CONNECTED; break; } - +#if defined(SOKOBAN_UNDO_PRE) lastbutton = button; +#endif if (moved) { rb->lcd_clear_display(); diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index 81c00803f8..f0bff4d2a4 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c @@ -1029,7 +1029,9 @@ enum plugin_status plugin_start(const void* parameter) { bool exit; int button; +#if defined(SUDOKU_BUTTON_TOGGLE_PRE) || defined(SUDOKU_BUTTON_MENU_PRE) int lastbutton = BUTTON_NONE; +#endif int res; int rc = PLUGIN_OK; long ticks; @@ -1289,8 +1291,10 @@ enum plugin_status plugin_start(const void* parameter) } break; } +#if defined(SUDOKU_BUTTON_TOGGLE_PRE) || defined(SUDOKU_BUTTON_MENU_PRE) if (button != BUTTON_NONE) lastbutton = button; +#endif display_board(&state); } diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 45726a3237..c3360adee6 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -781,7 +781,7 @@ void* dircache_steal_buffer(long *size) void dircache_init(void) { int i; - int thread_id; + int thread_id __attribute__((unused)); dircache_initialized = false; dircache_initializing = false; -- cgit v1.2.3