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
This commit is contained in:
Andree Buschmann 2011-05-08 21:06:38 +00:00
parent ab99e941db
commit 67f215032d
18 changed files with 54 additions and 55 deletions

View file

@ -632,7 +632,6 @@ boolean AM_Responder
( event_t* ev ) ( event_t* ev )
{ {
int rc; int rc;
static int cheatstate=0;
static int bigstate=0; static int bigstate=0;
static char buffer[20]; static char buffer[20];
int ch; // phares int ch; // phares
@ -732,7 +731,6 @@ boolean AM_Responder
} }
else // phares else // phares
{ {
cheatstate=0;
rc = false; rc = false;
} }
} }

View file

@ -179,7 +179,6 @@ void D_Display (void)
{ {
static boolean isborderstate IDATA_ATTR= false; static boolean isborderstate IDATA_ATTR= false;
static boolean borderwillneedredraw IDATA_ATTR= false; static boolean borderwillneedredraw IDATA_ATTR= false;
static boolean inhelpscreensstate IDATA_ATTR= false;
static gamestate_t oldgamestate IDATA_ATTR= -1; static gamestate_t oldgamestate IDATA_ATTR= -1;
boolean wipe; boolean wipe;
boolean viewactive = false, isborder = false; boolean viewactive = false, isborder = false;
@ -254,7 +253,6 @@ void D_Display (void)
HU_Drawer(); HU_Drawer();
} }
inhelpscreensstate = inhelpscreens;
isborderstate = isborder; isborderstate = isborder;
oldgamestate = wipegamestate = gamestate; oldgamestate = wipegamestate = gamestate;

View file

@ -1549,7 +1549,7 @@ static const size_t num_version_headers = sizeof(version_headers) / sizeof(versi
void G_DoLoadGame(void) void G_DoLoadGame(void)
{ {
int length, i; int i;
// CPhipps - do savegame filename stuff here // CPhipps - do savegame filename stuff here
char name[100+1]; // killough 3/22/98 char name[100+1]; // killough 3/22/98
int savegame_compatibility = -1; int savegame_compatibility = -1;
@ -1558,7 +1558,7 @@ void G_DoLoadGame(void)
gameaction = ga_nothing; gameaction = ga_nothing;
length = M_ReadFile(name, &savebuffer); M_ReadFile(name, &savebuffer);
save_p = savebuffer + SAVESTRINGSIZE; save_p = savebuffer + SAVESTRINGSIZE;
// CPhipps - read the description field, compare with supported ones // 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; skill_t skill;
int i, episode, map; int i, episode, map;
int demover; int demover;
const byte *option_p = NULL; /* killough 11/98 */
basetic = gametic; // killough 9/29/98 basetic = gametic; // killough 9/29/98
@ -2674,10 +2673,6 @@ static const byte* G_ReadDemoHeader(const byte *demo_p)
deathmatch = *demo_p++; deathmatch = *demo_p++;
consoleplayer = *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 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 if (demover == 200) // killough 6/3/98: partially fix v2.00 demos

View file

@ -532,7 +532,7 @@ void HUlib_drawMBg
// //
void HUlib_drawMText(hu_mtext_t* m) void HUlib_drawMText(hu_mtext_t* m)
{ {
int i, idx, y; int i, idx;
hu_textline_t *l; hu_textline_t *l;
if (!*m->on) if (!*m->on)
@ -541,7 +541,7 @@ void HUlib_drawMText(hu_mtext_t* m)
// draw everything // draw everything
if (hud_list_bgon) if (hud_list_bgon)
HUlib_drawMBg(m->x,m->y,m->w,m->h,m->bg); HUlib_drawMBg(m->x,m->y,m->w,m->h,m->bg);
y = m->y + HU_REFRESHSPACING;
for (i=0 ; i<m->nl ; i++) for (i=0 ; i<m->nl ; i++)
{ {
idx = m->cl - i; idx = m->cl - i;

View file

@ -534,26 +534,27 @@ static int musicdies=-1;
void I_PlaySong(int handle, int looping) void I_PlaySong(int handle, int looping)
{ {
// UNUSED. // UNUSED.
handle = looping = 0; (void)handle;
(void)looping;
musicdies = gametic + TICRATE*30; musicdies = gametic + TICRATE*30;
} }
void I_PauseSong (int handle) void I_PauseSong (int handle)
{ {
// UNUSED. // UNUSED.
handle = 0; (void)handle;
} }
void I_ResumeSong (int handle) void I_ResumeSong (int handle)
{ {
// UNUSED. // UNUSED.
handle = 0; (void)handle;
} }
void I_StopSong(int handle) void I_StopSong(int handle)
{ {
// UNUSED. // UNUSED.
handle = 0; (void)handle;
looping = 0; looping = 0;
musicdies = 0; musicdies = 0;
@ -562,13 +563,13 @@ void I_StopSong(int handle)
void I_UnRegisterSong(int handle) void I_UnRegisterSong(int handle)
{ {
// UNUSED. // UNUSED.
handle = 0; (void)handle;
} }
int I_RegisterSong(const void *data) int I_RegisterSong(const void *data)
{ {
// UNUSED. // UNUSED.
data = NULL; (void)data;
return 1; return 1;
} }
@ -577,7 +578,7 @@ int I_RegisterSong(const void *data)
int I_QrySongPlaying(int handle) int I_QrySongPlaying(int handle)
{ {
// UNUSED. // UNUSED.
handle = 0; (void)handle;
return looping || musicdies > gametic; return looping || musicdies > gametic;
} }

View file

@ -522,7 +522,6 @@ menu_t SaveDef =
void M_ReadSaveStrings(void) void M_ReadSaveStrings(void)
{ {
int handle; int handle;
int count;
int i; int i;
char name[256]; char name[256];
@ -540,7 +539,7 @@ void M_ReadSaveStrings(void)
LoadMenu[i].status = 0; LoadMenu[i].status = 0;
continue; continue;
} }
count = read (handle, &savegamestrings[i], SAVESTRINGSIZE); read (handle, &savegamestrings[i], SAVESTRINGSIZE);
close (handle); close (handle);
LoadMenu[i].status = 1; LoadMenu[i].status = 1;
} }
@ -1027,8 +1026,7 @@ void M_Options(int choice)
// //
void M_ChangeMessages(int choice) void M_ChangeMessages(int choice)
{ {
// warning: unused parameter `int choice' (void)choice;
choice = 0;
showMessages = 1 - showMessages; showMessages = 1 - showMessages;
if (!showMessages) if (!showMessages)
@ -1059,7 +1057,7 @@ void M_EndGameResponse(int ch)
void M_EndGame(int choice) void M_EndGame(int choice)
{ {
choice = 0; (void)choice;
if (!usergame) if (!usergame)
{ {
S_StartSound(NULL,sfx_oof); S_StartSound(NULL,sfx_oof);
@ -1083,19 +1081,19 @@ void M_EndGame(int choice)
// //
void M_ReadThis(int choice) void M_ReadThis(int choice)
{ {
choice = 0; (void)choice;
M_SetupNextMenu(&ReadDef1); M_SetupNextMenu(&ReadDef1);
} }
void M_ReadThis2(int choice) void M_ReadThis2(int choice)
{ {
choice = 0; (void)choice;
M_SetupNextMenu(&ReadDef2); M_SetupNextMenu(&ReadDef2);
} }
void M_FinishReadThis(int choice) void M_FinishReadThis(int choice)
{ {
choice = 0; (void)choice;
M_SetupNextMenu(&MainDef); M_SetupNextMenu(&MainDef);
} }

View file

@ -434,7 +434,6 @@ int EV_VerticalDoor
mobj_t* thing ) mobj_t* thing )
{ {
player_t* player; player_t* player;
int secnum;
sector_t* sec; sector_t* sec;
vldoor_t* door; vldoor_t* door;
@ -492,7 +491,6 @@ int EV_VerticalDoor
// get the sector on the second side of activating linedef // get the sector on the second side of activating linedef
sec = sides[line->sidenum[1]].sector; sec = sides[line->sidenum[1]].sector;
secnum = sec-sectors;
/* if door already has a thinker, use it /* if door already has a thinker, use it
* cph 2001/04/05 - * cph 2001/04/05 -

View file

@ -2394,11 +2394,6 @@ void P_SpawnSpecials (void)
{ {
sector_t* sector; sector_t* sector;
int i; int i;
int episode;
episode = 1;
if (W_CheckNumForName("texture2") >= 0)
episode = 2;
// See if -timer needs to be used. // See if -timer needs to be used.
levelTimer = false; levelTimer = false;

View file

@ -525,12 +525,9 @@ void V_DrawMemPatch(int x, int y, int scrn, const patch_t *patch,
int DXI = (320<<16) / SCREENWIDTH; int DXI = (320<<16) / SCREENWIDTH;
int DY = (SCREENHEIGHT<<16) / 200; int DY = (SCREENHEIGHT<<16) / 200;
register int DYI = (200<<16) / SCREENHEIGHT; register int DYI = (200<<16) / SCREENHEIGHT;
int DY2, DYI2;
stretchx = ( x * DX ) >> 16; stretchx = ( x * DX ) >> 16;
stretchy = ( y * DY ) >> 16; stretchy = ( y * DY ) >> 16;
DY2 = DY / 2;
DYI2 = DYI* 2;
if (!scrn) if (!scrn)
V_MarkRect ( stretchx, stretchy, (SHORT( patch->width ) * DX ) >> 16, V_MarkRect ( stretchx, stretchy, (SHORT( patch->width ) * DX ) >> 16,

View file

@ -1176,11 +1176,8 @@ void WI_drawDeathmatchStats(void)
int y; int y;
int w; int w;
int lh; // line height
int halfface = V_NamePatchWidth(facebackp)/2; int halfface = V_NamePatchWidth(facebackp)/2;
lh = WI_SPACINGY;
WI_slamBackground(); WI_slamBackground();
// draw animated background // draw animated background

View file

@ -345,7 +345,9 @@ static int show_menu(void) /* return 1 to quit */
static int ask_and_get_audio_buffer(const char *filename) static int ask_and_get_audio_buffer(const char *filename)
{ {
int button; int button;
#if defined(IMGVIEW_ZOOM_PRE)
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;
#endif
rb->lcd_setfont(FONT_SYSFIXED); rb->lcd_setfont(FONT_SYSFIXED);
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_puts(0, 0, rb->strrchr(filename,'/')+1); 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) == SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED; return PLUGIN_USB_CONNECTED;
} }
#if defined(IMGVIEW_ZOOM_PRE)
if (button != BUTTON_NONE) if (button != BUTTON_NONE)
lastbutton = button; lastbutton = button;
#endif
} }
} }
#endif /* USE_PLUG_BUF */ #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) static int scroll_bmp(struct image_info *info)
{ {
int button; int button;
#if defined(IMGVIEW_ZOOM_PRE) || defined(IMGVIEW_MENU_PRE)
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;
#endif
while (true) while (true)
{ {
@ -669,9 +674,10 @@ static int scroll_bmp(struct image_info *info)
break; break;
} /* switch */ } /* switch */
#if defined(IMGVIEW_ZOOM_PRE) || defined(IMGVIEW_MENU_PRE)
if (button != BUTTON_NONE) if (button != BUTTON_NONE)
lastbutton = button; lastbutton = button;
#endif
} /* while (true) */ } /* while (true) */
} }

View file

@ -136,11 +136,10 @@ int midi_debug(const char *fmt, ...)
{ {
static int p_xtpt = 0; static int p_xtpt = 0;
char p_buf[50]; char p_buf[50];
bool ok;
va_list ap; va_list ap;
va_start(ap, fmt); 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); va_end(ap);
int i=0; int i=0;

View file

@ -692,7 +692,9 @@ enum minesweeper_status minesweeper( void )
{ {
int i, j; int i, j;
int button; int button;
#if defined(HAVE_TOUCHSCREEN) || defined(MINESWP_TOGGLE_PRE)
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;
#endif
/* the cursor coordinates */ /* the cursor coordinates */
int x=0, y=0; int x=0, y=0;
@ -898,8 +900,10 @@ enum minesweeper_status minesweeper( void )
return MINESWEEPER_USB; return MINESWEEPER_USB;
break; break;
} }
#if defined(HAVE_TOUCHSCREEN) || defined(MINESWP_TOGGLE_PRE)
if( button != BUTTON_NONE ) if( button != BUTTON_NONE )
lastbutton = button; lastbutton = button;
#endif
} }
} }

View file

@ -607,7 +607,7 @@ static void draw_oriented_mono_bitmap_part(const unsigned char *src,
{ {
const unsigned char *src_end; const unsigned char *src_end;
fb_data *dst, *dst_end; fb_data *dst, *dst_end;
unsigned fg_pattern, bg_pattern; unsigned fg_pattern;
if (x + width > SCREEN_WIDTH) if (x + width > SCREEN_WIDTH)
width = SCREEN_WIDTH - x; /* Clip right */ width = SCREEN_WIDTH - x; /* Clip right */
@ -623,8 +623,8 @@ static void draw_oriented_mono_bitmap_part(const unsigned char *src,
if (height <= 0) if (height <= 0)
return; /* nothing left to do */ return; /* nothing left to do */
fg_pattern = rb->lcd_get_foreground(); fg_pattern = rb->lcd_get_foreground();
bg_pattern = rb->lcd_get_background(); /*bg_pattern =*/ rb->lcd_get_background();
src += stride * (src_y >> 3) + src_x; /* move starting point */ src += stride * (src_y >> 3) + src_x; /* move starting point */
src_y &= 7; src_y &= 7;
@ -719,7 +719,7 @@ static void draw_oriented_alpha_bitmap_part(const unsigned char *src,
int width, int height) int width, int height)
{ {
fb_data *dst, *dst_start; fb_data *dst, *dst_start;
unsigned fg_pattern, bg_pattern; unsigned fg_pattern;
if (x + width > SCREEN_WIDTH) if (x + width > SCREEN_WIDTH)
width = SCREEN_WIDTH - x; /* Clip right */ width = SCREEN_WIDTH - x; /* Clip right */
@ -738,8 +738,8 @@ static void draw_oriented_alpha_bitmap_part(const unsigned char *src,
/* initialize blending */ /* initialize blending */
BLEND_INIT; BLEND_INIT;
fg_pattern = rb->lcd_get_foreground(); fg_pattern = rb->lcd_get_foreground();
bg_pattern = rb->lcd_get_background(); /*bg_pattern=*/ rb->lcd_get_background();
dst_start = rb->lcd_framebuffer + (LCD_WIDTH - y - 1) + x*LCD_WIDTH; dst_start = rb->lcd_framebuffer + (LCD_WIDTH - y - 1) + x*LCD_WIDTH;
int col, row = height; int col, row = height;

View file

@ -610,7 +610,10 @@ enum plugin_status plugin_start(const void *parameter) {
#ifdef HAVE_TOUCHSCREEN #ifdef HAVE_TOUCHSCREEN
int button_x, button_y; int button_x, button_y;
#endif #endif
#if defined(REVERSI_BUTTON_MENU_LONGPRESS) || \
defined(REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS)
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;
#endif
int row, col; int row, col;
int w_cnt, b_cnt; int w_cnt, b_cnt;
@ -787,10 +790,12 @@ enum plugin_status plugin_start(const void *parameter) {
/* Quit if USB has been connected */ /* Quit if USB has been connected */
return PLUGIN_USB_CONNECTED; return PLUGIN_USB_CONNECTED;
} }
#if defined(REVERSI_BUTTON_MENU_LONGPRESS) || \
defined(REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS)
if (button != BUTTON_NONE) { if (button != BUTTON_NONE) {
lastbutton = button; lastbutton = button;
} }
#endif
} }
return PLUGIN_OK; return PLUGIN_OK;

View file

@ -1527,7 +1527,10 @@ static int sokoban_menu(void)
static bool sokoban_loop(void) static bool sokoban_loop(void)
{ {
bool moved; 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; int w, h;
char *loc; char *loc;
@ -1629,8 +1632,9 @@ static bool sokoban_loop(void)
return PLUGIN_USB_CONNECTED; return PLUGIN_USB_CONNECTED;
break; break;
} }
#if defined(SOKOBAN_UNDO_PRE)
lastbutton = button; lastbutton = button;
#endif
if (moved) { if (moved) {
rb->lcd_clear_display(); rb->lcd_clear_display();

View file

@ -1029,7 +1029,9 @@ enum plugin_status plugin_start(const void* parameter)
{ {
bool exit; bool exit;
int button; int button;
#if defined(SUDOKU_BUTTON_TOGGLE_PRE) || defined(SUDOKU_BUTTON_MENU_PRE)
int lastbutton = BUTTON_NONE; int lastbutton = BUTTON_NONE;
#endif
int res; int res;
int rc = PLUGIN_OK; int rc = PLUGIN_OK;
long ticks; long ticks;
@ -1289,8 +1291,10 @@ enum plugin_status plugin_start(const void* parameter)
} }
break; break;
} }
#if defined(SUDOKU_BUTTON_TOGGLE_PRE) || defined(SUDOKU_BUTTON_MENU_PRE)
if (button != BUTTON_NONE) if (button != BUTTON_NONE)
lastbutton = button; lastbutton = button;
#endif
display_board(&state); display_board(&state);
} }

View file

@ -781,7 +781,7 @@ void* dircache_steal_buffer(long *size)
void dircache_init(void) void dircache_init(void)
{ {
int i; int i;
int thread_id; int thread_id __attribute__((unused));
dircache_initialized = false; dircache_initialized = false;
dircache_initializing = false; dircache_initializing = false;