fixed several gcc-4.6 -Wunused-but-set-variable warnings.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@442 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-04-12 12:36:04 +00:00
parent f6ba05705c
commit ccf800306b
8 changed files with 38 additions and 60 deletions

View file

@ -75,7 +75,6 @@ qboolean scr_skipupdate;
static vmode_t modelist[MAX_MODE_LIST]; static vmode_t modelist[MAX_MODE_LIST];
static int nummodes; static int nummodes;
static vmode_t *pcurrentmode;
static vmode_t badmode; static vmode_t badmode;
static DEVMODE gdevmode; static DEVMODE gdevmode;
@ -105,6 +104,7 @@ HDC maindc;
glvert_t glv; glvert_t glv;
HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow); HWND WINAPI InitializeWindow (HINSTANCE hInstance, int nCmdShow);
BOOL bSetupPixelFormat(HDC hDC);
viddef_t vid; // global video state viddef_t vid; // global video state
@ -125,11 +125,6 @@ void ClearAllStates (void);
void VID_UpdateWindowStatus (void); void VID_UpdateWindowStatus (void);
void GL_Init (void); void GL_Init (void);
PROC glArrayElementEXT;
PROC glColorPointerEXT;
PROC glTexCoordPointerEXT;
PROC glVertexPointerEXT;
typedef void (APIENTRY *lp3DFXFUNC) (int, int, int, int, int, const void*); typedef void (APIENTRY *lp3DFXFUNC) (int, int, int, int, int, const void*);
PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz PFNGLMULTITEXCOORD2FARBPROC GL_MTexCoord2fFunc = NULL; //johnfitz
@ -325,7 +320,6 @@ CenterWindow
*/ */
void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify) void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify)
{ {
RECT rect;
int CenterX, CenterY; int CenterX, CenterY;
CenterX = (GetSystemMetrics(SM_CXSCREEN) - width) / 2; CenterX = (GetSystemMetrics(SM_CXSCREEN) - width) / 2;
@ -530,7 +524,6 @@ int VID_SetMode (int modenum)
int original_mode, temp; int original_mode, temp;
qboolean stat = false; qboolean stat = false;
MSG msg; MSG msg;
HDC hdc;
if ((windowed && (modenum != 0)) || if ((windowed && (modenum != 0)) ||
(!windowed && (modenum < 1)) || (!windowed && (modenum < 1)) ||
@ -662,7 +655,6 @@ void VID_Restart (void)
HGLRC hrc; HGLRC hrc;
int i; int i;
qboolean mode_changed = false; qboolean mode_changed = false;
vmode_t oldmode;
if (vid_locked) if (vid_locked)
return; return;
@ -692,8 +684,6 @@ void VID_Restart (void)
// //
// decide which mode to set // decide which mode to set
// //
oldmode = modelist[vid_default];
if (vid_fullscreen.value) if (vid_fullscreen.value)
{ {
for (i=1; i<nummodes; i++) for (i=1; i<nummodes; i++)
@ -790,7 +780,7 @@ void VID_Restart (void)
LPVOID lpMsgBuf; LPVOID lpMsgBuf;
DWORD dw = GetLastError(); DWORD dw = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL );
sprintf(szBuf, "VID_Restart: wglMakeCurrent failed with error %d: %s", dw, lpMsgBuf); sprintf(szBuf, "VID_Restart: wglMakeCurrent failed with error %u: %s", (unsigned int)dw, (const char *)lpMsgBuf);
Sys_Error (szBuf); Sys_Error (szBuf);
} }
TexMgr_ReloadImages (); TexMgr_ReloadImages ();
@ -1133,9 +1123,9 @@ void GetWGLExtensions (void)
const char *(*wglGetExtensionsStringARB) (HDC hdc); const char *(*wglGetExtensionsStringARB) (HDC hdc);
const char *(*wglGetExtensionsStringEXT) (); const char *(*wglGetExtensionsStringEXT) ();
if (wglGetExtensionsStringARB = (void *) wglGetProcAddress ("wglGetExtensionsStringARB")) if ((wglGetExtensionsStringARB = (void *) wglGetProcAddress ("wglGetExtensionsStringARB")) != NULL)
wgl_extensions = wglGetExtensionsStringARB (maindc); wgl_extensions = wglGetExtensionsStringARB (maindc);
else if (wglGetExtensionsStringEXT = (void *) wglGetProcAddress ("wglGetExtensionsStringEXT")) else if ((wglGetExtensionsStringEXT = (void *) wglGetProcAddress ("wglGetExtensionsStringEXT")) != NULL)
wgl_extensions = wglGetExtensionsStringEXT (); wgl_extensions = wglGetExtensionsStringEXT ();
else else
wgl_extensions = ""; wgl_extensions = "";
@ -1485,9 +1475,6 @@ void AppActivate(BOOL fActive, BOOL minimize)
* *
****************************************************************************/ ****************************************************************************/
{ {
MSG msg;
HDC hdc;
int i, t;
static BOOL sound_active; static BOOL sound_active;
ActiveApp = fActive; ActiveApp = fActive;
@ -1555,7 +1542,7 @@ LONG WINAPI MainWndProc (
LPARAM lParam) LPARAM lParam)
{ {
LONG lRet = 1; LONG lRet = 1;
int fwKeys, xPos, yPos, fActive, fMinimized, temp; int fActive, fMinimized, temp;
extern unsigned int uiWheelMessage; extern unsigned int uiWheelMessage;
if ( uMsg == uiWheelMessage ) if ( uMsg == uiWheelMessage )
@ -1841,7 +1828,6 @@ void VID_InitDIB (HINSTANCE hInstance)
DEVMODE devmode; //johnfitz DEVMODE devmode; //johnfitz
WNDCLASS wc; WNDCLASS wc;
HDC hdc; HDC hdc;
int i;
/* Register the frame class */ /* Register the frame class */
wc.style = 0; wc.style = 0;
@ -1909,7 +1895,7 @@ VID_InitFullDIB
void VID_InitFullDIB (HINSTANCE hInstance) void VID_InitFullDIB (HINSTANCE hInstance)
{ {
DEVMODE devmode; DEVMODE devmode;
int i, modenum, cmodes, originalnummodes, existingmode, numlowresmodes; int i, modenum, originalnummodes, existingmode, numlowresmodes;
int j, bpp, done; int j, bpp, done;
BOOL stat; BOOL stat;
@ -1944,10 +1930,10 @@ void VID_InitFullDIB (HINSTANCE hInstance)
modelist[nummodes].bpp = devmode.dmBitsPerPel; modelist[nummodes].bpp = devmode.dmBitsPerPel;
modelist[nummodes].refreshrate = devmode.dmDisplayFrequency; //johnfitz -- refreshrate modelist[nummodes].refreshrate = devmode.dmDisplayFrequency; //johnfitz -- refreshrate
sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate
devmode.dmPelsWidth, (int) devmode.dmPelsWidth,
devmode.dmPelsHeight, (int) devmode.dmPelsHeight,
devmode.dmBitsPerPel, (int) devmode.dmBitsPerPel,
devmode.dmDisplayFrequency); //johnfitz -- refreshrate (int) devmode.dmDisplayFrequency); //johnfitz -- refreshrate
// if the width is more than twice the height, reduce it by half because this // if the width is more than twice the height, reduce it by half because this
// is probably a dual-screen monitor // is probably a dual-screen monitor
@ -2017,10 +2003,10 @@ void VID_InitFullDIB (HINSTANCE hInstance)
modelist[nummodes].bpp = devmode.dmBitsPerPel; modelist[nummodes].bpp = devmode.dmBitsPerPel;
modelist[nummodes].refreshrate = devmode.dmDisplayFrequency; //johnfitz -- refreshrate modelist[nummodes].refreshrate = devmode.dmDisplayFrequency; //johnfitz -- refreshrate
sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate
devmode.dmPelsWidth, (int) devmode.dmPelsWidth,
devmode.dmPelsHeight, (int) devmode.dmPelsHeight,
devmode.dmBitsPerPel, (int) devmode.dmBitsPerPel,
devmode.dmDisplayFrequency); //johnfitz -- refreshrate (int) devmode.dmDisplayFrequency); //johnfitz -- refreshrate
for (i=originalnummodes, existingmode = 0 ; i<nummodes ; i++) for (i=originalnummodes, existingmode = 0 ; i<nummodes ; i++)
{ {
@ -2068,9 +2054,7 @@ VID_Init
void VID_Init (void) void VID_Init (void)
{ {
int i, existingmode; int i, existingmode;
int basenummodes, width, height, bpp, findbpp, done; int width, height, bpp, findbpp, done;
byte *ptmp;
char gldir[MAX_OSPATH];
HGLRC baseRC; //johnfitz -- moved here from global scope, since it was only used in this HGLRC baseRC; //johnfitz -- moved here from global scope, since it was only used in this
HDC hdc; HDC hdc;
DEVMODE devmode; DEVMODE devmode;
@ -2100,7 +2084,7 @@ void VID_Init (void)
InitCommonControls(); InitCommonControls();
VID_InitDIB (global_hInstance); VID_InitDIB (global_hInstance);
basenummodes = nummodes = 1; nummodes = 1;
VID_InitFullDIB (global_hInstance); VID_InitFullDIB (global_hInstance);
@ -2178,10 +2162,10 @@ void VID_Init (void)
modelist[nummodes].fullscreen = 1; modelist[nummodes].fullscreen = 1;
modelist[nummodes].bpp = bpp; modelist[nummodes].bpp = bpp;
sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate sprintf (modelist[nummodes].modedesc, "%dx%dx%d %dHz", //johnfitz -- refreshrate
devmode.dmPelsWidth, (int) devmode.dmPelsWidth,
devmode.dmPelsHeight, (int) devmode.dmPelsHeight,
devmode.dmBitsPerPel, (int) devmode.dmBitsPerPel,
devmode.dmDisplayFrequency); //johnfitz -- refreshrate (int) devmode.dmDisplayFrequency); //johnfitz -- refreshrate
for (i=nummodes, existingmode = 0 ; i<nummodes ; i++) for (i=nummodes, existingmode = 0 ; i<nummodes ; i++)
{ {

View file

@ -370,7 +370,6 @@ VID_Restart -- johnfitz -- change video modes on the fly
void VID_Restart (void) void VID_Restart (void)
{ {
int i; int i;
vmode_t oldmode;
if (vid_locked || !vid_changed) if (vid_locked || !vid_changed)
return; return;
@ -378,8 +377,6 @@ void VID_Restart (void)
// //
// decide which mode to set // decide which mode to set
// //
oldmode = modelist[vid_default];
if (vid_fullscreen.value) if (vid_fullscreen.value)
{ {
for (i=1; i<nummodes; i++) for (i=1; i<nummodes; i++)
@ -1163,7 +1160,7 @@ void VID_Init (void)
static char vid_center[] = "SDL_VIDEO_CENTERED=center"; static char vid_center[] = "SDL_VIDEO_CENTERED=center";
const SDL_VideoInfo *info; const SDL_VideoInfo *info;
int i, existingmode; int i, existingmode;
int basenummodes, width, height, bpp, findbpp, done; int width, height, bpp, findbpp, done;
//johnfitz -- clean up init readouts //johnfitz -- clean up init readouts
//Con_Printf("------------- Init Video -------------\n"); //Con_Printf("------------- Init Video -------------\n");
@ -1189,7 +1186,7 @@ void VID_Init (void)
putenv (vid_center); /* SDL_putenv is problematic in versions <= 1.2.9 */ putenv (vid_center); /* SDL_putenv is problematic in versions <= 1.2.9 */
VID_InitDIB(); VID_InitDIB();
basenummodes = nummodes = 1; nummodes = 1;
VID_InitFullDIB(); VID_InitFullDIB();
// Config file is not read yet, so we don't know vid_fullscreen.value // Config file is not read yet, so we don't know vid_fullscreen.value

View file

@ -1355,10 +1355,9 @@ void M_UnbindCommand (const char *command)
void M_Keys_Draw (void) void M_Keys_Draw (void)
{ {
int i, l; int i, x, y;
int keys[2]; int keys[2];
const char *name; const char *name;
int x, y;
qpic_t *p; qpic_t *p;
p = Draw_CachePic ("gfx/ttl_cstm.lmp"); p = Draw_CachePic ("gfx/ttl_cstm.lmp");
@ -1376,8 +1375,6 @@ void M_Keys_Draw (void)
M_Print (16, y, bindnames[i][1]); M_Print (16, y, bindnames[i][1]);
l = strlen (bindnames[i][0]);
M_FindKeysForCommand (bindnames[i][0], keys); M_FindKeysForCommand (bindnames[i][0], keys);
if (keys[0] == -1) if (keys[0] == -1)

View file

@ -537,7 +537,6 @@ static void Test_Poll (void *unused)
int colors; int colors;
int frags; int frags;
int connectTime; int connectTime;
byte playerNumber;
net_landriverlevel = testDriver; net_landriverlevel = testDriver;
@ -562,7 +561,7 @@ static void Test_Poll (void *unused)
if (MSG_ReadByte() != CCREP_PLAYER_INFO) if (MSG_ReadByte() != CCREP_PLAYER_INFO)
Sys_Error("Unexpected repsonse to Player Info request\n"); Sys_Error("Unexpected repsonse to Player Info request\n");
playerNumber = MSG_ReadByte(); MSG_ReadByte(); /* playerNumber */
Q_strcpy(name, MSG_ReadString()); Q_strcpy(name, MSG_ReadString());
colors = MSG_ReadLong(); colors = MSG_ReadLong();
frags = MSG_ReadLong(); frags = MSG_ReadLong();

View file

@ -1307,6 +1307,7 @@ void PF_aim (void)
ent = G_EDICT(OFS_PARM0); ent = G_EDICT(OFS_PARM0);
speed = G_FLOAT(OFS_PARM1); speed = G_FLOAT(OFS_PARM1);
(void) speed; /* variable set but not used */
VectorCopy (ent->v.origin, start); VectorCopy (ent->v.origin, start);
start[2] += 20; start[2] += 20;

View file

@ -779,7 +779,7 @@ void BuildSurfaceDisplayList (msurface_t *fa)
{ {
int i, lindex, lnumverts; int i, lindex, lnumverts;
medge_t *pedges, *r_pedge; medge_t *pedges, *r_pedge;
int vertpage; // int vertpage;
float *vec; float *vec;
float s, t; float s, t;
glpoly_t *poly; glpoly_t *poly;
@ -787,7 +787,7 @@ void BuildSurfaceDisplayList (msurface_t *fa)
// reconstruct the polygon // reconstruct the polygon
pedges = currentmodel->edges; pedges = currentmodel->edges;
lnumverts = fa->numedges; lnumverts = fa->numedges;
vertpage = 0; // vertpage = 0;
// //
// draw texture // draw texture

View file

@ -187,24 +187,25 @@ float timescale = 0.01;
void R_EntityParticles (entity_t *ent) void R_EntityParticles (entity_t *ent)
{ {
int count; int i;
int i;
particle_t *p; particle_t *p;
float angle; float angle;
float sr, sp, sy, cr, cp, cy; float sp, sy, cp, cy;
// float sr, cr;
// int count;
vec3_t forward; vec3_t forward;
float dist; float dist;
dist = 64; dist = 64;
count = 50; // count = 50;
if (!avelocities[0][0]) if (!avelocities[0][0])
{ {
for (i=0 ; i<NUMVERTEXNORMALS*3 ; i++) for (i = 0; i < NUMVERTEXNORMALS*3; i++)
avelocities[0][i] = (rand()&255) * 0.01; avelocities[0][i] = (rand() & 255) * 0.01;
} }
for (i=0 ; i<NUMVERTEXNORMALS ; i++) for (i = 0; i < NUMVERTEXNORMALS; i++)
{ {
angle = cl.time * avelocities[i][0]; angle = cl.time * avelocities[i][0];
sy = sin(angle); sy = sin(angle);
@ -213,8 +214,8 @@ void R_EntityParticles (entity_t *ent)
sp = sin(angle); sp = sin(angle);
cp = cos(angle); cp = cos(angle);
angle = cl.time * avelocities[i][2]; angle = cl.time * avelocities[i][2];
sr = sin(angle); // sr = sin(angle);
cr = cos(angle); // cr = cos(angle);
forward[0] = cp*cy; forward[0] = cp*cy;
forward[1] = cp*sy; forward[1] = cp*sy;

View file

@ -1175,7 +1175,7 @@ Sbar_MiniDeathmatchOverlay
*/ */
void Sbar_MiniDeathmatchOverlay (void) void Sbar_MiniDeathmatchOverlay (void)
{ {
int i, k, l, top, bottom, x, y, f, numlines; int i, k, top, bottom, x, y, f, numlines;
char num[12]; char num[12];
float scale; //johnfitz float scale; //johnfitz
scoreboard_t *s; scoreboard_t *s;
@ -1190,7 +1190,6 @@ void Sbar_MiniDeathmatchOverlay (void)
Sbar_SortFrags (); Sbar_SortFrags ();
// draw the text // draw the text
l = scoreboardlines;
numlines = (scr_viewsize.value >= 110) ? 3 : 6; //johnfitz numlines = (scr_viewsize.value >= 110) ? 3 : 6; //johnfitz
//find us //find us