My attempt at handling GCC warnings, everything but incorrect pointer types, #pragma warnings, " is deprecated etc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3787 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2011-05-15 13:23:13 +00:00
parent 2091c2f83e
commit f6741d8dde
44 changed files with 942 additions and 769 deletions

View File

@ -268,7 +268,7 @@ static void CD_f (void)
}
}
/*
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (lParam != wDeviceID)
@ -302,7 +302,7 @@ LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
}
*/
void BGMVolume_Callback(struct cvar_s *var, char *oldvalue)
{

View File

@ -1409,7 +1409,7 @@ void SCR_DrawLoading (void)
char *s;
int qdepth;
int h2depth;
int mtype = M_GameType();
//int mtype = M_GameType(); //unused variable
y = vid.height/2;
qdepth = COM_FDepthFile("gfx/loading.lmp", true);
@ -1636,7 +1636,7 @@ SCR_SetUpToDrawConsole
void SCR_SetUpToDrawConsole (void)
{
#ifdef TEXTEDITOR
extern qboolean editoractive;
//extern qboolean editoractive; //unused variable
#endif
if (scr_drawloading)
return; // never a console with loading plaque

View File

@ -601,7 +601,7 @@ void CLQ3_ParseGameState(void)
char buffer[2048];
strcpy(buffer, va("cp %i ", cl.servercount));
FSQ3_GenerateClientPacksList(buffer, sizeof(buffer), ccs.fs_key);
CLQ3_SendClientCommand(buffer);
CLQ3_SendClientCommand("%s", buffer); // warning: format not a string literal and no format arguments
}
// load cgame, etc

View File

@ -1527,7 +1527,7 @@ void Con_NotifyBox (char *text)
// during startup for sound / cd warnings
Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");
Con_Printf (text);
Con_Printf ("%s", text);
Con_Printf ("Press a key.\n");
Con_Printf("\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");

View File

@ -294,6 +294,10 @@ void IN_ReInit (void)
void IN_Init (void)
{
#ifdef IN_XFLIP
cvar_t in_xflip = SCVAR("in_xflip", "0");
#endif
#ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input Controls");
#endif
@ -349,4 +353,24 @@ void IN_Commands (void) //used to Cbuf_AddText joystick button events in windows
}
/*
===========
IN_UpdateClipCursor
===========
*/
void IN_UpdateClipCursor (void)
{
if (mouseinitialized && mouseactive && !dinput)
{
ClipCursor (&window_rect);
}
}
void IN_RawInput_Read(HANDLE in_device_handle)
{
}
static int MapKey (int vkey)
{
}

View File

@ -260,7 +260,7 @@ void M_Menu_Audio_f (void)
{
menu_t *menu;
int cursorpositionY;
extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, snd_show, bgmbuffer;
extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate, bgmbuffer;
extern cvar_t cl_voip_play, cl_voip_send;
static const char *soundqualityoptions[] = {
@ -1128,6 +1128,7 @@ void M_Menu_Shadow_Lighting_f (void)
MC_AddWhiteText(menu, 16, y, "<><E282AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ", false); y+=8;
y+=8;
MC_AddSlider(menu, 16, y, " Shadows", &r_shadows,0,2,1); y+=8;
//MC_AddSlider(menu, 16, y, " Light Map Mode", &gl_lightmapmode,0,2,1); y+=8;
MC_AddSlider(menu, 16, y, " Light Map Saturation", &r_lightmap_saturation,0,1,0.1); y+=8;
MC_AddCheckBox(menu, 16, y, " Dynamic Lighting", &r_dynamic,0); y+=8;

View File

@ -220,6 +220,16 @@ qboolean Master_ServerIsGreater(serverinfo_t *a, serverinfo_t *b)
return Master_CompareInteger(a->tl, b->tl, SLIST_TEST_LESS);
case SLKEY_TOOMANY:
break;
// warning: enumeration value SLKEY_* not handled in switch
case SLKEY_MOD:
case SLKEY_PROTOCOL:
case SLKEY_NUMBOTS:
case SLKEY_NUMHUMANS:
case SLKEY_QCSTATUS:
case SLKEY_ISFAVORITE:
break;
}
return false;
}
@ -1149,7 +1159,7 @@ void MasterInfo_ProcessHTTPQW(struct dl_download *dl)
//don't try sending to servers we don't support
void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles)
{
static int mastersequence;
//static int mastersequence; // warning: unused variable âmastersequenceâ
if (!mast)
return;
switch(mast->type)
@ -1844,6 +1854,17 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
for (i = 0; i < adrlen; i++)
((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
break;
// warning: enumeration value NA_* not handled in switch
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
case NA_BROADCAST_IP6:
case NA_BROADCAST_IPX:
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
break;
}
p1 = MSG_ReadByte();

View File

@ -280,9 +280,9 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part
#ifndef TYPESONLY
//triangle fan sparks use these.
static double sint[7] = {0.000000, 0.781832, 0.974928, 0.433884, -0.433884, -0.974928, -0.781832};
static double cost[7] = {1.000000, 0.623490, -0.222521, -0.900969, -0.900969, -0.222521, 0.623490};
//triangle fan sparks use these. // defined but not used
//static double sint[7] = {0.000000, 0.781832, 0.974928, 0.433884, -0.433884, -0.974928, -0.781832};
//static double cost[7] = {1.000000, 0.623490, -0.222521, -0.900969, -0.900969, -0.222521, 0.623490};
#define crand() (rand()%32767/16383.5f-1)

View File

@ -399,6 +399,8 @@ static void Surf_AddDynamicLights (msurface_t *surf)
}
}
// warning: Surf_AddDynamicLightNorms defined but not used
/*
static void Surf_AddDynamicLightNorms (msurface_t *surf)
{
int lnum;
@ -470,6 +472,7 @@ static void Surf_AddDynamicLightNorms (msurface_t *surf)
}
}
}
*/
#ifdef PEXT_LIGHTSTYLECOL
static void Surf_AddDynamicLightsColours (msurface_t *surf)
@ -882,7 +885,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
int maps;
unsigned *bl;
int stride = LMBLOCK_WIDTH*lightmap_bytes;
//int stride = LMBLOCK_WIDTH*lightmap_bytes; //warning: unused variable stride
shift += 7; // increase to base value
surf->cached_dlight = (surf->dlightframe == r_framecount);
@ -2519,13 +2522,13 @@ void Surf_BuildLightmaps (void)
switch(qrenderer)
{
#ifdef D3DQUAKE
case QR_DIRECT3D:
#ifdef D3DQUAKE
/*always bgra, hope your card supports it*/
lightmap_bytes = 4;
lightmap_bgra = true;
break;
#endif
break;
#ifdef GLQUAKE
case QR_OPENGL:
/*favour bgra if the gpu supports it, otherwise use rgb only if it'll be used*/
@ -2550,6 +2553,8 @@ void Surf_BuildLightmaps (void)
lightmap_bytes = 1;
break;
#endif
case QR_NONE:
break;
}
for (j=1 ; j<MAX_MODELS ; j++)

View File

@ -1026,13 +1026,14 @@ void M_Menu_Video_f (void)
"32",
NULL
};
static const char *texturefilternames[] =
//unused
/*static const char *texturefilternames[] =
{
"Nearest",
"Bilinear",
"Trilinear",
NULL
};
};*/
static const char *refreshrates[] =
{

View File

@ -1971,7 +1971,7 @@ void Sbar_Hexen2DrawExtra (int pnum)
unsigned int i, slot;
unsigned int pclass;
int ringpos[] = {6, 44, 81, 119};
char *ringimages[] = {"gfx/ring_f.lmp", "gfx/ring_w.lmp", "gfx/ring_t.lmp", "gfx/ring_r.lmp"};
//char *ringimages[] = {"gfx/ring_f.lmp", "gfx/ring_w.lmp", "gfx/ring_t.lmp", "gfx/ring_r.lmp"}; //unused variable
float val;
char *pclassname[] = {
"Unknown",

View File

@ -768,6 +768,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
qbyte *data;
sfxcache_t *sc;
int i;
size_t result;
char *name = s->name;
@ -804,7 +805,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
{
com_filesize = COM_filelength(f);
data = Hunk_TempAlloc (com_filesize);
fread(data, 1, com_filesize, f);
result = fread(data, 1, com_filesize, f); //do something with result
fclose(f);
}
else

View File

@ -14,6 +14,30 @@
//FIXME: One thing I saw in quakeforge was that quakeforge basically leaves the audio locked except for a really short period of time.
//An interesting idea, which ensures the driver can only paint in a small time-frame. this would possibly allow lower latency painting.
/*
==================
S_BlockSound
==================
*/
//all devices
void S_BlockSound (void)
{
soundcardinfo_t *sc;
wavhandle_t *wh;
snd_blocked++;
for (sc = sndcardinfo; sc; sc=sc->next)
{
if (sc->Submit == WAV_Submit && !sc->inactive_sound)
{
wh = sc->handle;
if (snd_blocked == 1)
waveOutReset (wh->hWaveOut);
}
}
}
static void SSDL_Shutdown(soundcardinfo_t *sc)
{
Con_Printf("Shutdown SDL sound\n");

View File

@ -341,6 +341,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
va_list argptr;
static char data[1024];
int fd;
size_t result;
va_start(argptr, fmt);
_vsnprintf (data,sizeof(data)-1, fmt, argptr);
@ -353,7 +354,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd)
{
write(fd, data, strlen(data));
result = write(fd, data, strlen(data)); // do something with result
close(fd);
return 0;
}
@ -477,10 +478,11 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH];
char *searchpath;
const char *gamename = "gamei386.so";
size_t result;
void *ret;
getcwd(curpath, sizeof(curpath));
result = getcwd(curpath, sizeof(curpath)); // do something with result?
Con_DPrintf("Searching for %s\n", gamename);

View File

@ -23,6 +23,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "winquake.h"
#include <ctype.h> // for isdigit();
#ifdef FISH
void R_RenderView_fisheye(void);
cvar_t ffov = SCVAR("ffov", "0");

View File

@ -765,6 +765,8 @@ static char *Macro_demoplayback (void)
{
switch (cls.demoplayback)
{
case DPB_EZTV: // warning: enumeration value DPB_EZTV not handled in switch
break;
case DPB_NONE:
return "0";
case DPB_QUAKEWORLD:

View File

@ -1100,6 +1100,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
char *fixup = NULL, fixval=0;
cvar_t *var;
static char temp[12];
size_t result;
namestart = cvarname;
if (*cvarname == '{')
@ -1117,7 +1118,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
fixval = *fixup;
}
strtol(cvarname, &end, 10);
result = strtol(cvarname, &end, 10); // do something with result
if (fixval && *end == '\0') //only expand $0 if its actually ${0} - this avoids conflicting with the $0 macro
{ //purely numerical
ret = Cmd_Argv(atoi(cvarname));

View File

@ -767,7 +767,7 @@ float *Alias_GetBonePositions(galiasinfo_t *inf, framestate_t *fstate, float *bu
galiasgroup_t *g1, *g2;
galiasbone_t *bones = (galiasbone_t *)((char*)inf+inf->ofsbones);
//galiasbone_t *bones = (galiasbone_t *)((char*)inf+inf->ofsbones); //unsed variable
if (buffersize < inf->numbones)
return NULL;
@ -897,7 +897,7 @@ vec3_t *tempNormals;
void R_LightArraysByte_BGR(vecV_t *coords, byte_vec4_t *colours, int vertcount, vec3_t *normals)
{
extern cvar_t r_vertexdlights;
//extern cvar_t r_vertexdlights; //unused
int i;
int c;
float l;
@ -948,7 +948,7 @@ void R_LightArrays(vecV_t *coords, avec4_t *colours, int vertcount, vec3_t *norm
int i;
float l;
float *lightdir = currententity->light_dir;
//float *lightdir = currententity->light_dir; //unused variable
if (!currententity->light_range[0] && !currententity->light_range[1] && !currententity->light_range[2])
{
@ -1031,7 +1031,7 @@ void R_LightArrays(vecV_t *coords, avec4_t *colours, int vertcount, vec3_t *norm
static void R_LerpFrames(mesh_t *mesh, galiaspose_t *p1, galiaspose_t *p2, float lerp, qbyte alpha, float expand, qboolean nolightdir)
{
extern cvar_t r_nolerp, r_nolightdir;
extern cvar_t r_nolerp; // r_nolightdir is unused
float blerp = 1-lerp;
int i;
vecV_t *p1v, *p2v;
@ -1880,7 +1880,9 @@ static void *Alias_LoadFrameGroup (daliasframetype_t *pframetype, int *seamremap
daliasinterval_t *intervals;
float sinter;
#ifndef SERVERONLY
vec3_t *normals, *svec, *tvec;
#endif
vecV_t *verts;
int aliasframesize;
@ -3603,7 +3605,7 @@ qboolean Mod_LoadQ3Model(model_t *mod, void *buffer)
externalskins = LittleLong(surf->numShaders);
if (externalskins)
{
extern int gl_bumpmappingpossible;
//extern int gl_bumpmappingpossible; // unused variable
char shadname[1024];
skin = Hunk_Alloc((LittleLong(surf->numShaders)+externalskins)*((sizeof(galiasskin_t)+sizeof(texnums_t))));
@ -4200,7 +4202,7 @@ qboolean Mod_LoadPSKModel(model_t *mod, void *buffer)
unsigned int num_animinfo=0, num_animkeys=0;
int hunkstart, hunkend, hunktotal;
extern cvar_t temp1;
//extern cvar_t temp1; //unused variable
/*load the psk*/
while (pos < com_filesize && !fail)

View File

@ -3015,6 +3015,7 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint
{
qboolean safe;
int i;
size_t result;
FILE *f;
@ -3028,7 +3029,7 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint
fseek(f, 0, SEEK_SET);
buffer = (char*)malloc(len+1);
fread(buffer, 1, len, f);
result = fread(buffer, 1, len, f); // do something with result
buffer[len] = '\0';
while (*buffer && (argc < MAX_NUM_ARGVS))

View File

@ -172,6 +172,22 @@ void Cvar_List_f (void)
int gnum, i, num = 0;
int listflags = 0, cvarflags = 0;
char strtmp[512];
static char *cvarlist_help =
"cvarlist list all cvars matching given parameters\n"
"Syntax: cvarlist [-FLdhlrv] [-f flag] [-g group] [cvar]\n"
" -F shows cvar flags\n"
" -L shows latched values\n"
" -a shows cvar alternate names\n"
" -d shows default cvar values\n"
" -f shows only cvars with a matching flag, more than one -f can be used\n"
" -g shows only cvar groups using wildcards in group\n"
" -h shows this help message\n"
" -l shows cvar restriction levels\n"
" -r removes group and list headers\n"
" -v shows current values\n"
" cvar indicates the cvar to show, wildcards (*,?) accepted\n"
"Cvar flags are:"
;
gsearch = search = NULL;
for (i = 1; i < Cmd_Argc(); i++)
@ -253,20 +269,7 @@ void Cvar_List_f (void)
break;
case 'h':
// list options
Con_Printf("cvarlist list all cvars matching given parameters\n"
"Syntax: cvarlist [-FLdhlrv] [-f flag] [-g group] [cvar]\n"
" -F shows cvar flags\n"
" -L shows latched values\n"
" -a shows cvar alternate names\n"
" -d shows default cvar values\n"
" -f shows only cvars with a matching flag, more than one -f can be used\n"
" -g shows only cvar groups using wildcards in group\n"
" -h shows this help message\n"
" -l shows cvar restriction levels\n"
" -r removes group and list headers\n"
" -v shows current values\n"
" cvar indicates the cvar to show, wildcards (*,?) accepted\n"
"Cvar flags are:");
Con_Printf("%s", cvarlist_help);
for (num = 1; num <= CVAR_LASTFLAG; num <<= 1)
{
@ -353,7 +356,7 @@ void Cvar_List_f (void)
Con_Printf("(%i) ", cmd->restriction);
// print cvar name
Con_Printf(cmd->name);
Con_Printf("%s", cmd->name);
// print current value
if (listflags & CLF_VALUES)

View File

@ -214,11 +214,13 @@ static qboolean FSSTDIO_FLocate(void *handle, flocation_t *loc, const char *file
static void FSSTDIO_ReadFile(void *handle, flocation_t *loc, char *buffer)
{
FILE *f;
size_t result;
f = fopen(loc->rawname, "rb");
if (!f) //err...
return;
fseek(f, loc->offset, SEEK_SET);
fread(buffer, 1, loc->len, f);
result = fread(buffer, 1, loc->len, f); // do soemthing with result
fclose(f);
}
static int FSSTDIO_EnumerateFiles (void *handle, const char *match, int (*func)(const char *, int, void *), void *parm)

View File

@ -2,7 +2,10 @@
#include "fs.h"
#ifdef AVAIL_ZLIB
#define ZEXPORT VARGS
#ifndef ZEXPORT
#define ZEXPORT VARGS
#endif
#include <zlib.h>
typedef struct {

View File

@ -5660,7 +5660,9 @@ and recalculates the area connections
*/
void CM_ReadPortalState (FILE *f)
{
fread (portalopen, 1, sizeof(portalopen), f);
size_t result;
result = fread (portalopen, 1, sizeof(portalopen), f); // do something with result
FloodAreaConnections ();
}

View File

@ -311,7 +311,7 @@ void Log_Logfile_f (void)
if (log_name[LOG_CONSOLE].string[0])
f = log_name[LOG_CONSOLE].string;
Con_Printf(va("Logging to %s/%s.log.\n", d, f));
Con_Printf("%s", va("Logging to %s/%s.log.\n", d, f));
Cvar_SetValue(&log_enable[LOG_CONSOLE], 1);
}

View File

@ -861,9 +861,9 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
}
#endif
break;
#ifdef USEIPX
case NA_IPX:
case NA_BROADCAST_IPX:
#ifdef USEIPX
n = amask->address.ipx;
if (i > 80)
i = 80;
@ -884,6 +884,12 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
break;
case NA_LOOPBACK:
break;
// warning: enumeration value âNA_*â not handled in switch
case NA_TCP:
case NA_TCPV6:
case NA_IRC:
break;
}
}
@ -2134,7 +2140,7 @@ qboolean FTENET_IRCConnect_GetPacket(ftenet_generic_connection_t *gcon)
cvar_t *ircuser = Cvar_Get("ircuser", "none", 0, "IRC Connect");
cvar_t *irchost = Cvar_Get("irchost", "none", 0, "IRC Connect");
cvar_t *ircnick = Cvar_Get("ircnick", "ftesv", 0, "IRC Connect");
cvar_t *ircchannel = Cvar_Get("ircchannel", "#ftetest", 0, "IRC Connect");
//cvar_t *ircchannel = Cvar_Get("ircchannel", "#ftetest", 0, "IRC Connect"); //warning: unused variable ircchannel
cvar_t *ircsomething = Cvar_Get("ircsomething", "moo", 0, "IRC Connect");
cvar_t *ircclientaddr = Cvar_Get("ircclientaddr", "127.0.0.1", 0, "IRC Connect");
@ -3203,11 +3209,11 @@ void SVNET_AddPort(void)
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_UDP6_EstablishConnection, true);
break;
#endif
#ifdef USEIPX
case NA_IPX:
#ifdef USEIPX
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IPX_EstablishConnection, true);
break;
#endif
break;
#ifdef IRCCONNECT
case NA_IRC:
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IRCConnect_EstablishConnection, true);
@ -3223,6 +3229,13 @@ void SVNET_AddPort(void)
break;
#endif
#endif
// warning: enumeration value NA_* not handled in switch
case NA_INVALID:
case NA_LOOPBACK:
case NA_BROADCAST_IP:
case NA_BROADCAST_IP6:
case NA_BROADCAST_IPX:
break;
}
}
#endif

View File

@ -571,6 +571,7 @@ void TL_LoadLanguage (char *name, char *shortname, int num) //this is one of the
FILE *f;
int size;
char *buffer;
size_t result;
f = fopen(va("%s.trl", shortname), "rb");
if (!f)
@ -580,7 +581,7 @@ void TL_LoadLanguage (char *name, char *shortname, int num) //this is one of the
fseek(f, 0, SEEK_SET);
buffer = malloc(size+1);
buffer[size] = '\0';
fread(buffer, 1, size, f);
result = fread(buffer, 1, size, f); // do something with result
fclose(f);
TL_ParseLanguage(name, buffer, num);

View File

@ -370,6 +370,24 @@ texid_t D3D9_LoadTexture (char *identifier, int width, int height, enum uploadfm
return r_nulltex;
}
break;
case TF_INVALID:
case TF_RGBA32:
case TF_BGRA32:
case TF_RGBX32:
case TF_RGB24:
case TF_BGR24_FLIP:
case TF_SOLID8:
case TF_TRANS8:
case TF_HEIGHT8:
case TF_HEIGHT8PAL:
case TF_H2_T7G1:
case TF_H2_TRANS8_0:
case TF_H2_T4A4:
case TF_PALETTES:
case TF_8PAL24:
case TF_8PAL32:
break;
}
tex = d3d_lookup_texture(identifier);

View File

@ -1938,6 +1938,11 @@ void BE_GenModelBatches(batch_t **batches)
case mod_sprite:
R_Sprite_GenerateBatch(ent, batches, R_DB_Sprite);
break;
// warning: enumeration value mod_* not handled in switch
case mod_dummy:
case mod_halflife:
case mod_heightmap:
break;
}
break;
case RT_SPRITE:

View File

@ -2543,7 +2543,7 @@ static void Shader_MakeCache ( char *path )
cache->hash_next = shader_hash[key];
cache->path = path;
cache->offset = ptr - buf;
Com_sprintf ( cache->name, MAX_QPATH, token );
Com_sprintf ( cache->name, MAX_QPATH, "%s", token ); // warning: format not a string literal and no format arguments
shader_hash[key] = cache;
ptr = Shader_Skip ( ptr );
@ -4012,7 +4012,7 @@ static qboolean Shader_ParseShader(char *shortname, char *usename, shader_t *s)
Shader_Free(s);
memset ( s, 0, sizeof( shader_t ) );
Com_sprintf ( s->name, MAX_QPATH, usename );
Com_sprintf ( s->name, MAX_QPATH, "%s",usename ); // warning: format not a string literal and no format arguments
Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
Shader_ReadShader(s, file);
@ -4131,7 +4131,7 @@ static int R_LoadShader ( char *name, shader_gen_t *defaultgen, const char *gena
if (defaultgen)
{
memset(s, 0, sizeof(shader_t));
Com_sprintf(s->name, MAX_QPATH, shortname);
Com_sprintf(s->name, MAX_QPATH, "%s", shortname); // warning: format not a string literal and no format arguments
if (!strcmp(shortname, "textures/common/clip"))
Shader_DefaultScript(shortname, s,
"{\n"
@ -4218,7 +4218,7 @@ void Shader_DoReload(void)
s->generator = defaultgen;
s->genargs = genargs;
Com_sprintf ( s->name, MAX_QPATH, shortname );
Com_sprintf ( s->name, MAX_QPATH, "%s", shortname ); // warning: format not a string literal and no format arguments
Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
R_BuildDefaultTexnums(&oldtn, s);
}

View File

@ -1564,7 +1564,8 @@ static void Sh_DrawShadowMapLight(dlight_t *l, vec3_t colour, qbyte *vvis)
// warning: Sh_WorldLightingPass defined but not used
/*
static void Sh_WorldLightingPass(void)
{
msurface_t *s;
@ -1590,6 +1591,7 @@ static void Sh_WorldLightingPass(void)
RQuantAdd(RQUANT_LITFACES, s->mesh->numindexes);
}
}
*/
/*
draws faces facing the light

View File

@ -459,7 +459,7 @@ static void R_DrawSkyMesh(batch_t *batch, mesh_t *m, shader_t *shader)
{
static entity_t skyent;
batch_t b;
float time = cl.gametime+realtime-cl.gametimemark;
//float time = cl.gametime+realtime-cl.gametimemark; //warning: unused variable time
float skydist = gl_skyboxdist.value;
if (skydist<1)

View File

@ -1055,7 +1055,7 @@ pbool ED_ParseEpair (progfuncs_t *progfuncs, void *base, ddefXX_t *key, char *s,
string_t st;
dfunction_t *func;
int type;
int type = 0; // warning about beign used without initializing it
switch(structtype)
{

View File

@ -624,7 +624,7 @@ int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int
unsigned int i;
int pn = pr_typecurrent;
dfunction_t *f;
int op;
int op = 0; //warning about not being initialized before use
for (pn = 0; (unsigned)pn < maxprogs; pn++)
{
@ -843,7 +843,7 @@ void PR_ExecuteCode (progfuncs_t *progfuncs, int s)
{
eval_t *t, *swtch=NULL;
int swtchtype;
int swtchtype = 0; //warning about not being initialized before use
dstatement16_t *st16;
dstatement32_t *st32;
dfunction_t *newf;

View File

@ -3034,7 +3034,7 @@ PR_ParseFunctionCall
*/
QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could have no name set if it's a field call.
{
QCC_def_t *e, *d, *old, *oself, *out;
QCC_def_t *e, *d, *old = {0}, *oself, *out; // warning: old may be used uninitialized in this function
int arg;
QCC_type_t *t, *p;
int extraparms=false;
@ -8333,7 +8333,7 @@ void QCC_PR_ParseDefs (char *classname)
QCC_def_t *def, *d;
QCC_function_t *f;
QCC_dfunction_t *df;
int i;
int i = 0; // warning: i may be used uninitialized in this function
pbool shared=false;
pbool isstatic=defaultstatic;
pbool externfnc=false;

View File

@ -231,8 +231,8 @@ pbool QCC_PR_SimpleGetToken (void);
int ParsePrecompilerIf(void)
{
CompilerConstant_t *c;
int eval;
char *start = pr_file_p;
int eval = 0;
//char *start = pr_file_p; //warning: unused variable âstartâ
if (!QCC_PR_SimpleGetToken())
{
if (*pr_file_p == '(')
@ -830,7 +830,7 @@ pbool QCC_PR_Precompiler(void)
{
#define MAXSOURCEFILESLIST 8
extern char sourcefileslist[MAXSOURCEFILESLIST][1024];
extern int currentsourcefile;
//extern int currentsourcefile; // warning: unused variable âcurrentsourcefileâ
extern int numsourcefiles;
int i;

View File

@ -278,6 +278,7 @@ void QCC_BspModels (void)
char *m;
char cmd[1024];
char name[256];
size_t result;
p = QCC_CheckParm ("-bspmodels");
if (!p)
@ -294,7 +295,7 @@ void QCC_BspModels (void)
strcpy (name, m);
name[strlen(m)-4] = 0;
sprintf (cmd, "qbsp %s/%s ; light -extra %s/%s", gamedir, name, gamedir, name);
system (cmd);
result = system (cmd); // do something with the result
}
}

View File

@ -520,7 +520,7 @@ void PR_LoadGlabalStruct(void)
static float writeonly;
static float dimension_send_default;
static float zero_default;
static vec3_t vecwriteonly;
//static vec3_t vecwriteonly; // 523:16: warning: unused variable vecwriteonly
int i;
int *v;
nqglobalvars_t *pr_globals = pr_nqglobal_struct;
@ -3580,6 +3580,8 @@ void QCBUILTIN PF_precache_vwep_model (progfuncs_t *prinst, struct globalvars_s
}
}
// warning: PF_svcoredump defined but not used
/*
static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
int size = 1024*1024*8;
@ -3588,6 +3590,7 @@ static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *p
COM_WriteFile("ssqccore.txt", buffer, size);
BZ_Free(buffer);
}
*/
static void QCBUILTIN PF_sv_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
@ -5044,6 +5047,8 @@ static void QCBUILTIN PF_newstring(progfuncs_t *prinst, struct globalvars_s *pr_
RETURN_SSTRING(s+8);
}
// warning: PF_strcatp defined but not used
/*
static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *buf = PR_GetStringOfs(prinst, OFS_PARM0); char *add = PR_GetStringOfs(prinst, OFS_PARM1);
@ -5066,7 +5071,10 @@ static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_gl
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
}
*/
// warning: PF_redstring defined but not used
/*
static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{
char *string = PR_GetStringOfs(prinst, OFS_PARM0), *s;
@ -5078,6 +5086,7 @@ static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_
RETURN_TSTRING(buf);
}
*/
#ifdef SVCHAT
void SV_Chat(char *filename, float starttag, edict_t *edict);

View File

@ -75,11 +75,12 @@ extern cvar_t sv_nomsec;
static void SV_Physics_Toss (edict_t *ent);
// warning: SV_CheckAllEnts defined but not used
/*
================
SV_CheckAllEnts
================
*/
static void SV_CheckAllEnts (void)
{
int e;
@ -102,6 +103,7 @@ static void SV_CheckAllEnts (void)
Con_Printf ("entity in invalid position\n");
}
}
*/
/*
================
@ -1376,6 +1378,7 @@ static void SV_WallFriction (edict_t *ent, trace_t *trace)
ent->v->velocity[1] = side[1] * (1 + d);
}
// warning: SV_TryUnstick defined but not used
/*
=====================
SV_TryUnstick
@ -1387,7 +1390,7 @@ Try fixing by pushing one pixel in each direction.
This is a hack, but in the interest of good gameplay...
======================
*/
static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
{
int i;
@ -1436,6 +1439,7 @@ static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
VectorClear (ent->v->velocity);
return 7; // still not moving
}
*/
/*
=====================
@ -1797,7 +1801,7 @@ SV_RunEntity
void SV_RunEntity (edict_t *ent)
{
edict_t *movechain;
vec3_t initial_origin,initial_angle;
vec3_t initial_origin = {0},initial_angle = {0}; // warning: initial_?[?] may be used uninitialized in this function
if (ent->entnum > 0 && ent->entnum <= sv.allocated_client_slots)
{ //a client woo.

View File

@ -36,9 +36,14 @@ char rank_cvargroup[] = "server rankings";
void inline READ_PLAYERSTATS(int x, rankstats_t *os)
{
int i;
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+sizeof(rankheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET);
fread(os, sizeof(rankstats_t), 1, rankfile);
result = fread(os, sizeof(rankstats_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in READ_PLAYERSTATS\n");
os->kills = swaplong(os->kills);
os->deaths = swaplong(os->deaths);
@ -73,9 +78,15 @@ void inline WRITE_PLAYERSTATS(int x, rankstats_t *os)
void inline READ_PLAYERHEADER(int x, rankheader_t *oh)
{
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET);
fread(oh, sizeof(rankheader_t), 1, rankfile);
result = fread(oh, sizeof(rankheader_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in WRITE_PLAYERSTATS\n");
oh->prev = swaplong(oh->prev); //score is held for convineance.
oh->next = swaplong(oh->next);
@ -125,6 +136,7 @@ void inline WRITEHEADER(void)
qboolean Rank_OpenRankings(void)
{
char syspath[MAX_OSPATH];
size_t result;
qboolean created;
if (!rankfile)
{
@ -150,7 +162,11 @@ qboolean Rank_OpenRankings(void)
memset(&rankfileheader, 0, sizeof(rankfileheader));
fseek(rankfile, 0, SEEK_SET);
fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile);
result = fread(&rankfileheader, sizeof(rankfileheader_t), 1, rankfile);
// ignoring return value of fread, declared with attribute warn_unused_result
if (result != 1)
fprintf(stderr, "fread() error in Rank_OpenRankings\n");
rankfileheader.version = swaplong(rankfileheader.version);
rankfileheader.usedslots = swaplong(rankfileheader.usedslots);

View File

@ -104,6 +104,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
va_list argptr;
char data[1024];
int fd;
size_t result;
va_start(argptr, fmt);
_vsnprintf (data,sizeof(data)-1, fmt, argptr);
@ -115,7 +116,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd)
{
write(fd, data, strlen(data));
result = write(fd, data, strlen(data)); // do something with the result
close(fd);
return 0;
}
@ -825,10 +826,11 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH];
char *searchpath;
const char *gamename = "gamei386.so";
size_t result;
void *ret;
getcwd(curpath, sizeof(curpath));
result = getcwd(curpath, sizeof(curpath)); // do soemthing with the result
searchpath = 0;
while((searchpath = COM_NextPath(searchpath)))

View File

@ -968,7 +968,7 @@ void SV_Modellist_f (void)
{
char mname[MAX_QPATH];
char vweaplist[1024] = "//vwep";
int pos = strlen(vweaplist);
//int pos = strlen(vweaplist); // warning: unused variable pos
for (i = 0; sv.strings.vw_model_precache[i]; i++)
{

View File

@ -2573,6 +2573,11 @@ void SVQ3_SendGameState(client_t *client)
}
}
break;
// warning: enumeration value GT_? not handled in switch
case GT_HALFLIFE:
case GT_QUAKE2:
case GT_MAX:
break;
}
// write svc_eom command