Clean up all the "set but not used" warnings.

gcc on my system is failing to treat this specific warning as an error :/
This commit is contained in:
Bill Currie 2011-06-19 10:48:02 +09:00
parent dedda7596d
commit 0f7390dd60
32 changed files with 41 additions and 69 deletions

View File

@ -4092,6 +4092,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
POP_FAILURE_POINT (sdummy, pdummy,
dummy_low_reg, dummy_high_reg,
reg_dummy, reg_dummy, reg_info_dummy);
(void)pdummy;
(void)sdummy;
}
/* Note fall through. */

View File

@ -331,7 +331,6 @@ Netchan_Transmit (netchan_t *chan, int length, byte *data)
qboolean
Netchan_Process (netchan_t *chan)
{
int qport;
unsigned int reliable_ack, reliable_message, sequence, sequence_ack;
if (!net_blocksend)
@ -343,9 +342,9 @@ Netchan_Process (netchan_t *chan)
sequence = MSG_ReadLong (net_message);
sequence_ack = MSG_ReadLong (net_message);
// read the qport if we are a server
// read the qport if we are a server, but drop it
if (chan->flags & NC_READ_QPORT)
qport = MSG_ReadShort (net_message);
MSG_ReadShort (net_message);
reliable_message = sequence >> 31;
reliable_ack = sequence_ack >> 31;

View File

@ -528,9 +528,9 @@ Test_Poll (void *unused)
connectTime = MSG_ReadLong (net_message);
strcpy (address, MSG_ReadString (net_message));
Sys_Printf ("%s\n frags:%3i colors:%u %u time:%u\n %s\n", name,
frags, colors >> 4, colors & 0x0f, connectTime / 60,
address);
Sys_Printf ("%d, %s\n frags:%3i colors:%u %u time:%u\n %s\n",
playerNumber, name, frags, colors >> 4, colors & 0x0f,
connectTime / 60, address);
}
testPollCount--;

View File

@ -771,14 +771,13 @@ BuildSurfaceDisplayList (msurface_t *fa)
{
float s, t;
float *vec;
int lindex, lnumverts, vertpage, i;
int lindex, lnumverts, i;
glpoly_t *poly;
medge_t *pedges, *r_pedge;
// reconstruct the polygon
pedges = currentmodel->edges;
lnumverts = fa->numedges;
vertpage = 0;
// draw texture
poly = Hunk_Alloc (sizeof (glpoly_t) + (lnumverts - 4) *

View File

@ -54,11 +54,11 @@ R_TimeGraph (void)
static int timex;
int a;
int l;
float r_time2;
//XXX float r_time2;
static int r_timings[MAX_TIMINGS];
int x;
r_time2 = Sys_DoubleTime ();
//XXX r_time2 = Sys_DoubleTime ();
a = graphval;
@ -84,7 +84,7 @@ R_TimeGraph (void)
void
R_ZGraph (void)
{
int a, x, w, i;
int x, w;
static int height[256];
if (r_refdef.vrect.width <= 256)
@ -95,8 +95,5 @@ R_ZGraph (void)
height[r_framecount & 255] = ((int) r_origin[2]) & 31;
x = 0;
for (a = 0; a < w; a++) {
i = (r_framecount - a) & 255;
}
R_LineGraph (x, r_refdef.vrect.height - 2, height, w);
}

View File

@ -154,9 +154,9 @@ R_RecursiveMarkLights (const vec3_t lightorigin, dlight_t *light, int bit,
float ndist, maxdist;
mplane_t *splitplane;
msurface_t *surf;
mvertex_t *vertices;
//XXX mvertex_t *vertices;
vertices = r_worldentity.model->vertexes;
//XXX vertices = r_worldentity.model->vertexes;
maxdist = light->radius;
loc0:

View File

@ -109,12 +109,9 @@ D_DrawSolidSurface (surf_t *surf, int color)
static void
D_CalcGradients (msurface_t *pface)
{
mplane_t *pplane;
float mipscale, t;
vec3_t p_temp1, p_saxis, p_taxis;
pplane = pface->plane;
mipscale = 1.0 / (float) (1 << miplevel);
TransformVector (pface->texinfo->vecs[0], p_saxis);

View File

@ -139,12 +139,9 @@ D_DrawSolidSurface (surf_t *surf, int color)
static void
D_CalcGradients (msurface_t *pface)
{
mplane_t *pplane;
float mipscale, t;
vec3_t p_temp1, p_saxis, p_taxis;
pplane = pface->plane;
mipscale = 1.0 / (float) (1 << miplevel);
TransformVector (pface->texinfo->vecs[0], p_saxis);

View File

@ -199,13 +199,13 @@ static void
XLateKey (XKeyEvent * ev, int *k, int *u)
{
char buffer[4];
int bytes, unicode;
int unicode;
int key = 0;
KeySym keysym, shifted_keysym;
XComposeStatus compose;
keysym = XLookupKeysym (ev, 0);
bytes = XLookupString (ev, buffer, sizeof(buffer), &shifted_keysym,
XLookupString (ev, buffer, sizeof(buffer), &shifted_keysym,
&compose);
unicode = (byte) buffer[0];

View File

@ -283,7 +283,8 @@ VID_SetMode (const char *name, unsigned char *palette)
struct fb_var_screeninfo var;
struct fb_fix_screeninfo fix;
int err;
unsigned long smem_start, smem_offset;
//unsigned long smem_start;
unsigned long smem_offset;
long pagesize, pagemask;
errno = 0;
@ -329,7 +330,7 @@ VID_SetMode (const char *name, unsigned char *palette)
err = ioctl(fb_fd, FBIOGET_FSCREENINFO, &fix);
if (err)
Sys_Error ("Video mode failed: %s", name);
smem_start = (unsigned long)fix.smem_start & pagemask;
//smem_start = (unsigned long)fix.smem_start & pagemask;
smem_offset = (unsigned long)fix.smem_start & ~pagemask;
fb_map_length = (smem_offset+fix.smem_len+~pagemask) & pagemask;
fb_map_addr = mmap(0, fb_map_length, PROT_WRITE, MAP_SHARED,

View File

@ -924,6 +924,7 @@ PF_aim (progs_t *pr)
ent = P_EDICT (pr, 0);
speed = P_FLOAT (pr, 1);
(void)speed; //FIXME
VectorCopy (SVvector (ent, origin), start);
start[2] += 20;

View File

@ -651,7 +651,6 @@ void
CL_ParsePlayerinfo (void)
{
int flags, msec, num, i;
player_info_t *info;
player_state_t *state;
num = MSG_ReadByte (net_message);
@ -663,7 +662,6 @@ CL_ParsePlayerinfo (void)
return;
}
info = &cl.players[num];
state = &cl.frames[parsecountmod].playerstate[num];
state->pls.number = num;

View File

@ -855,7 +855,7 @@ static void
CL_ConnectionlessPacket (void)
{
const char *s;
int c, clcp_temp;
int c;
MSG_BeginReading (net_message);
MSG_ReadLong (net_message); // skip the -1
@ -863,7 +863,6 @@ CL_ConnectionlessPacket (void)
c = MSG_ReadByte (net_message);
if (net_message->badread)
return;
clcp_temp = 0;
if (!cls.demoplayback
&& (cl_paranoid->int_val
|| !NET_CompareAdr (net_from, cls.server_addr)))
@ -1000,7 +999,7 @@ CL_ConnectionlessPacket (void)
if (c == M2C_MASTER_REPLY)
{
Sys_Printf ("Master Server Reply\n");
clcp_temp = MSG_ReadByte (net_message);
MSG_ReadByte (net_message);
s = MSG_ReadString (net_message);
MSL_ParseServerList (s);
return;

View File

@ -54,7 +54,7 @@ void
CL_NetGraph (void)
{
char st[80];
int lost, a, l, x, y, h, i;
int lost, a, l, x, y, i;
if (!r_netgraph->int_val)
return;
@ -62,8 +62,6 @@ CL_NetGraph (void)
x = hudswap ? vid.conwidth - (NET_TIMINGS + 16): 0;
y = vid.conheight - sb_lines - 24 - r_graphheight->int_val - 1;
h = r_graphheight->int_val % 8;
if (r_netgraph_box->int_val)
Draw_TextBox (x, y, NET_TIMINGS / 8, r_graphheight->int_val / 8 + 1,
r_netgraph_alpha->value * 255);

View File

@ -726,7 +726,7 @@ CL_ParseServerData (void)
{
const char *str;
int protover;
qboolean cflag = false;
//FIXME qboolean cflag = false;
Sys_MaskPrintf (SYS_DEV, "Serverdata packet received.\n");
@ -750,7 +750,7 @@ CL_ParseServerData (void)
if (!strequal (qfs_gamedir->gamedir, str)) {
// save current config
Host_WriteConfiguration ();
cflag = true;
//FIXME cflag = true;
QFS_Gamedir (str);
}

View File

@ -625,6 +625,7 @@ CL_ParseProjectiles (qboolean nail2)
num = MSG_ReadByte (net_message);
else
num = 0;
(void) num; //FIXME
for (j = 0; j < 6; j++)
bits[j] = MSG_ReadByte (net_message);

View File

@ -135,12 +135,11 @@ locs_load (const char *filename)
char tmp[PATH_MAX];
char *t1, *t2;
const char *line;
int templength = 0;
vec3_t loc;
QFile *file;
snprintf (tmp, sizeof (tmp), "maps/%s", filename);
templength = QFS_FOpenFile (tmp, &file);
QFS_FOpenFile (tmp, &file);
if (!file) {
Sys_Printf ("Couldn't load %s\n", tmp);
return;

View File

@ -262,7 +262,7 @@ PM_GroundMove (void)
{
float downdist, updist;
trace_t trace;
vec3_t start, dest;
vec3_t dest;
vec3_t original, originalvel, down, up, downvel;
pmove.velocity[2] = 0;
@ -275,7 +275,6 @@ PM_GroundMove (void)
dest[2] = pmove.origin[2];
// first try moving directly to the next spot
VectorCopy (dest, start);
trace = PM_PlayerMove (pmove.origin, dest);
if (trace.fraction == 1) {
VectorCopy (trace.endpos, pmove.origin);

View File

@ -993,7 +993,7 @@ void
Sbar_TeamOverlay (view_t *view)
{
char num[20];
int pavg, plow, phigh, i, k, l, x, y;
int pavg, plow, phigh, i, k, x, y;
team_t *tm;
info_key_t *player_team = cl.players[cl.playernum].team;
@ -1020,8 +1020,6 @@ Sbar_TeamOverlay (view_t *view)
Sbar_SortTeams ();
// draw the text
l = scoreboardlines;
for (i = 0; i < scoreboardteams && y <= view->ylen - 10; i++) {
k = teamsort[i];
tm = teams + k;
@ -1122,6 +1120,7 @@ Sbar_LogFrags (void)
// draw pl
p = s->pl;
(void) p; //FIXME
// get time
if (cl.intermission)

View File

@ -630,20 +630,20 @@ SV_Punish (int mode)
dstring_t *text = dstring_new();
const char *cmd = 0;
const char *cmd_do = 0;
const char *cmd_undo = 0;
//FIXME const char *cmd_undo = 0;
int field_offs = 0;
switch (mode) {
case 0:
cmd = "cuff";
cmd_do = "cuffed";
cmd_undo = "un-cuffed";
//FIXME cmd_undo = "un-cuffed";
field_offs = field_offset (client_t, cuff_time);
break;
case 1:
cmd = "mute";
cmd_do = "muted";
cmd_undo = "can speak";
//FIXME cmd_undo = "can speak";
field_offs = field_offset (client_t, lockedtill);
break;
}

View File

@ -1755,10 +1755,8 @@ SV_ReadPackets (void)
//NOTE star volatile, not volatile star
client_t *volatile cl; // * volatile for longjmp
int qport, i;
qboolean good;
double until;
good = false;
while (NET_GetPacket ()) {
if (net_packetlog->int_val)
Log_Incoming_Packet (net_message->message->data,
@ -1801,7 +1799,6 @@ SV_ReadPackets (void)
if (Netchan_Process (&cl->netchan)) {
// this is a valid, sequenced packet, so process it
svs.stats.packets++;
good = true;
cl->send_message = true; // reply at end of frame
if (cl->state != cs_zombie) {
SV_ExecuteClientMessage (cl);

View File

@ -958,6 +958,7 @@ PF_aim (progs_t *pr)
}
speed = P_FLOAT (pr, 1);
(void) speed; //FIXME
VectorCopy (SVvector (ent, origin), start);
start[2] += 20;

View File

@ -561,6 +561,7 @@ PF_getwave (progs_t *pr)
modes = (unsigned int) P_FLOAT (pr, 1);
balance = P_FLOAT (pr, 4);
(void) balance; //FIXME
if (modes & GWAVE_USEOFFSET)
offset = P_FLOAT (pr, 5);

View File

@ -534,7 +534,6 @@ SV_qtvChanging (void)
{
sv_qtv_t *proxy;
int i, len;
sizebuf_t *buf;
const char *msg;
msg = va ("%cchanging", qtv_stringcmd);
@ -545,7 +544,7 @@ SV_qtvChanging (void)
continue;
SVR_Pause (proxy->recorder);
buf = MSG_ReliableCheckBlock (&proxy->backbuf, len);
MSG_ReliableCheckBlock (&proxy->backbuf, len);
MSG_ReliableWrite_SZ (&proxy->backbuf, msg, len);
}
SV_qtvSendMessages ();
@ -556,7 +555,6 @@ SV_qtvReconnect (void)
{
sv_qtv_t *proxy;
int i, len;
sizebuf_t *buf;
const char *msg;
msg = va ("%creconnect", qtv_stringcmd);
@ -566,7 +564,7 @@ SV_qtvReconnect (void)
if (!proxy->info)
continue;
buf = MSG_ReliableCheckBlock (&proxy->backbuf, len);
MSG_ReliableCheckBlock (&proxy->backbuf, len);
MSG_ReliableWrite_SZ (&proxy->backbuf, msg, len);
}
}

View File

@ -213,7 +213,7 @@ write_msg (sizebuf_t *msg, int type, int to, float time, sizebuf_t *dst)
static void
write_to_msg (int type, int to, float time, sizebuf_t *dst)
{
int pos = 0, oldm, oldd;
int pos = 0;
header_t *p;
int size;
sizebuf_t msg;
@ -221,8 +221,6 @@ write_to_msg (int type, int to, float time, sizebuf_t *dst)
p = (header_t *) rec.dbuf->sz.data;
rec.dbuf->h = NULL;
oldm = rec.dbuf->bufsize;
oldd = rec.dbuffer.start;
while (pos < rec.dbuf->bufsize) {
size = p->size;
pos += HEADER + size;

View File

@ -385,7 +385,7 @@ void
SV_StartSound (edict_t *entity, int channel, const char *sample, int volume,
float attenuation)
{
int ent, field_mask, sound_num, i;
int ent, sound_num, i;
qboolean use_phs;
qboolean reliable = false;
vec3_t origin;
@ -427,7 +427,6 @@ SV_StartSound (edict_t *entity, int channel, const char *sample, int volume,
channel = (ent << 3) | channel;
field_mask = 0;
if (volume != DEFAULT_SOUND_PACKET_VOLUME)
channel |= SND_VOLUME;
if (attenuation != DEFAULT_SOUND_PACKET_ATTENUATION)

View File

@ -827,7 +827,7 @@ render_map (bsp_t *bsp)
Zoffset1 = (options.z_pad * (vert2->Z - midZ) / (maxZ - minZ));
offs0 = options.image_pad + options.z_pad + (Zoffset0 * Z_Xdir);
offs1 = options.image_pad + options.z_pad + (Zoffset1 * Z_Xdir);
offs1 = options.image_pad + options.z_pad + (Zoffset1 * Z_Ydir);
bresline (image, (vert1->X - minX) / options.scaledown + offs0,
(vert1->Y - minY) / options.scaledown + offs0,

View File

@ -274,8 +274,6 @@ FindPlane (const plane_t *dplane, int *side)
dp = planes;
for (i = 0; i < numbrushplanes; i++, dp++) {
vec3_t t;
VectorSubtract (dp->normal, pl.normal, t);
dot = DotProduct (dp->normal, pl.normal);
if (dot > 1.0 - ANGLEEPSILON
&& fabs(dp->dist - pl.dist) < DISTEPSILON) { // regular match

View File

@ -783,13 +783,10 @@ class_find_method (class_type_t *class_type, method_t *method)
method_t *m;
dstring_t *sel;
class_t *class = 0, *start_class;
const char *class_name;
const char *category_name = 0;
switch (class_type->type) {
case ct_category:
methods = class_type->c.category->methods;
category_name = class_type->c.category->name;
class = class_type->c.category->class;
break;
case ct_class:
@ -799,7 +796,6 @@ class_find_method (class_type_t *class_type, method_t *method)
case ct_protocol:
return 0; // probably in error recovery
}
class_name = class->name;
start_methods = methods;
start_class = class;
while (class) {

View File

@ -1122,7 +1122,6 @@ build_qfo (void)
qfo_t *qfo;
int size;
int i, j;
qfo_mspace_t *space;
qfo_reloc_t *reloc;
qfo_def_t **defs;
@ -1130,7 +1129,6 @@ build_qfo (void)
qfo->spaces = calloc (work->num_spaces, sizeof (qfo_mspace_t));
qfo->num_spaces = work->num_spaces;
for (i = 0; i < work->num_spaces; i++) {
space = &work->spaces[i];
qfo->spaces[i].type = work->spaces[i].type;
qfo->spaces[i].id = work->spaces[i].id;
qfo->spaces[i].d = work->spaces[i].d;

View File

@ -258,7 +258,6 @@ convert_qfo (void)
{
int size;
int i;
ddef_t *ld;
pr.progs = qfo_to_progs (qfo, &size);
@ -283,7 +282,7 @@ convert_qfo (void)
pr.local_defs = P (ddef_t, locals);
#undef P
ld = pr.local_defs = calloc (qfo->num_defs, sizeof (ddef_t));
pr.local_defs = calloc (qfo->num_defs, sizeof (ddef_t));
pr.auxfunction_map = calloc (pr.progs->numfunctions,
sizeof (pr_auxfunction_t *));

View File

@ -34,6 +34,7 @@ main (int argc, char **argv)
break;
case 'l':
loop_info = 1;
(void) loop_info; //FIXME
break;
case 's':
sample_info = 1;