1
0
Fork 0
forked from fte/fteqw

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

View file

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

View file

@ -601,7 +601,7 @@ void CLQ3_ParseGameState(void)
char buffer[2048]; char buffer[2048];
strcpy(buffer, va("cp %i ", cl.servercount)); strcpy(buffer, va("cp %i ", cl.servercount));
FSQ3_GenerateClientPacksList(buffer, sizeof(buffer), ccs.fs_key); 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 // load cgame, etc

View file

@ -1527,7 +1527,7 @@ void Con_NotifyBox (char *text)
// during startup for sound / cd warnings // 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("\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 ("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"); 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) void IN_Init (void)
{ {
#ifdef IN_XFLIP
cvar_t in_xflip = SCVAR("in_xflip", "0");
#endif
#ifdef IN_XFLIP #ifdef IN_XFLIP
Cvar_Register (&in_xflip, "Input Controls"); Cvar_Register (&in_xflip, "Input Controls");
#endif #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; menu_t *menu;
int cursorpositionY; 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; extern cvar_t cl_voip_play, cl_voip_send;
static const char *soundqualityoptions[] = { 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; 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; 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 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_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; 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); return Master_CompareInteger(a->tl, b->tl, SLIST_TEST_LESS);
case SLKEY_TOOMANY: case SLKEY_TOOMANY:
break; 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; return false;
} }
@ -1149,7 +1159,7 @@ void MasterInfo_ProcessHTTPQW(struct dl_download *dl)
//don't try sending to servers we don't support //don't try sending to servers we don't support
void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles) void MasterInfo_Request(master_t *mast, qboolean evenifwedonthavethefiles)
{ {
static int mastersequence; //static int mastersequence; // warning: unused variable âmastersequenceâ
if (!mast) if (!mast)
return; return;
switch(mast->type) switch(mast->type)
@ -1844,6 +1854,17 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
for (i = 0; i < adrlen; i++) for (i = 0; i < adrlen; i++)
((qbyte *)&info->adr.address)[i] = MSG_ReadByte(); ((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
break; 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(); p1 = MSG_ReadByte();

View file

@ -280,9 +280,9 @@ static void PScript_DrawParticleTypes (void (*texturedparticles)(int count, part
#ifndef TYPESONLY #ifndef TYPESONLY
//triangle fan sparks use these. //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 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}; //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) #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) static void Surf_AddDynamicLightNorms (msurface_t *surf)
{ {
int lnum; int lnum;
@ -470,6 +472,7 @@ static void Surf_AddDynamicLightNorms (msurface_t *surf)
} }
} }
} }
*/
#ifdef PEXT_LIGHTSTYLECOL #ifdef PEXT_LIGHTSTYLECOL
static void Surf_AddDynamicLightsColours (msurface_t *surf) static void Surf_AddDynamicLightsColours (msurface_t *surf)
@ -882,7 +885,7 @@ static void Surf_BuildLightMap (msurface_t *surf, qbyte *dest, qbyte *deluxdest,
int maps; int maps;
unsigned *bl; unsigned *bl;
int stride = LMBLOCK_WIDTH*lightmap_bytes; //int stride = LMBLOCK_WIDTH*lightmap_bytes; //warning: unused variable stride
shift += 7; // increase to base value shift += 7; // increase to base value
surf->cached_dlight = (surf->dlightframe == r_framecount); surf->cached_dlight = (surf->dlightframe == r_framecount);
@ -2519,13 +2522,13 @@ void Surf_BuildLightmaps (void)
switch(qrenderer) switch(qrenderer)
{ {
#ifdef D3DQUAKE
case QR_DIRECT3D: case QR_DIRECT3D:
#ifdef D3DQUAKE
/*always bgra, hope your card supports it*/ /*always bgra, hope your card supports it*/
lightmap_bytes = 4; lightmap_bytes = 4;
lightmap_bgra = true; lightmap_bgra = true;
break;
#endif #endif
break;
#ifdef GLQUAKE #ifdef GLQUAKE
case QR_OPENGL: case QR_OPENGL:
/*favour bgra if the gpu supports it, otherwise use rgb only if it'll be used*/ /*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; lightmap_bytes = 1;
break; break;
#endif #endif
case QR_NONE:
break;
} }
for (j=1 ; j<MAX_MODELS ; j++) for (j=1 ; j<MAX_MODELS ; j++)

View file

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

View file

@ -1971,7 +1971,7 @@ void Sbar_Hexen2DrawExtra (int pnum)
unsigned int i, slot; unsigned int i, slot;
unsigned int pclass; unsigned int pclass;
int ringpos[] = {6, 44, 81, 119}; 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; float val;
char *pclassname[] = { char *pclassname[] = {
"Unknown", "Unknown",

View file

@ -768,6 +768,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
qbyte *data; qbyte *data;
sfxcache_t *sc; sfxcache_t *sc;
int i; int i;
size_t result;
char *name = s->name; char *name = s->name;
@ -804,7 +805,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
{ {
com_filesize = COM_filelength(f); com_filesize = COM_filelength(f);
data = Hunk_TempAlloc (com_filesize); data = Hunk_TempAlloc (com_filesize);
fread(data, 1, com_filesize, f); result = fread(data, 1, com_filesize, f); //do something with result
fclose(f); fclose(f);
} }
else 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. //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. //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) static void SSDL_Shutdown(soundcardinfo_t *sc)
{ {
Con_Printf("Shutdown SDL sound\n"); Con_Printf("Shutdown SDL sound\n");

View file

@ -341,6 +341,7 @@ int Sys_DebugLog(char *file, char *fmt, ...)
va_list argptr; va_list argptr;
static char data[1024]; static char data[1024];
int fd; int fd;
size_t result;
va_start(argptr, fmt); va_start(argptr, fmt);
_vsnprintf (data,sizeof(data)-1, fmt, argptr); _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); fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fd) if (fd)
{ {
write(fd, data, strlen(data)); result = write(fd, data, strlen(data)); // do something with result
close(fd); close(fd);
return 0; return 0;
} }
@ -477,10 +478,11 @@ void *Sys_GetGameAPI(void *parms)
char curpath[MAX_OSPATH]; char curpath[MAX_OSPATH];
char *searchpath; char *searchpath;
const char *gamename = "gamei386.so"; const char *gamename = "gamei386.so";
size_t result;
void *ret; void *ret;
getcwd(curpath, sizeof(curpath)); result = getcwd(curpath, sizeof(curpath)); // do something with result?
Con_DPrintf("Searching for %s\n", gamename); 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 "winquake.h"
#include <ctype.h> // for isdigit();
#ifdef FISH #ifdef FISH
void R_RenderView_fisheye(void); void R_RenderView_fisheye(void);
cvar_t ffov = SCVAR("ffov", "0"); cvar_t ffov = SCVAR("ffov", "0");

View file

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

View file

@ -1100,6 +1100,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
char *fixup = NULL, fixval=0; char *fixup = NULL, fixval=0;
cvar_t *var; cvar_t *var;
static char temp[12]; static char temp[12];
size_t result;
namestart = cvarname; namestart = cvarname;
if (*cvarname == '{') if (*cvarname == '{')
@ -1117,7 +1118,7 @@ char *Cmd_ExpandCvar(char *cvarname, int maxaccesslevel, int *len)
fixval = *fixup; 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 if (fixval && *end == '\0') //only expand $0 if its actually ${0} - this avoids conflicting with the $0 macro
{ //purely numerical { //purely numerical
ret = Cmd_Argv(atoi(cvarname)); 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; 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) if (buffersize < inf->numbones)
return NULL; 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) 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 i;
int c; int c;
float l; float l;
@ -948,7 +948,7 @@ void R_LightArrays(vecV_t *coords, avec4_t *colours, int vertcount, vec3_t *norm
int i; int i;
float l; 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]) 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) 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; float blerp = 1-lerp;
int i; int i;
vecV_t *p1v, *p2v; vecV_t *p1v, *p2v;
@ -1880,7 +1880,9 @@ static void *Alias_LoadFrameGroup (daliasframetype_t *pframetype, int *seamremap
daliasinterval_t *intervals; daliasinterval_t *intervals;
float sinter; float sinter;
#ifndef SERVERONLY
vec3_t *normals, *svec, *tvec; vec3_t *normals, *svec, *tvec;
#endif
vecV_t *verts; vecV_t *verts;
int aliasframesize; int aliasframesize;
@ -3603,7 +3605,7 @@ qboolean Mod_LoadQ3Model(model_t *mod, void *buffer)
externalskins = LittleLong(surf->numShaders); externalskins = LittleLong(surf->numShaders);
if (externalskins) if (externalskins)
{ {
extern int gl_bumpmappingpossible; //extern int gl_bumpmappingpossible; // unused variable
char shadname[1024]; char shadname[1024];
skin = Hunk_Alloc((LittleLong(surf->numShaders)+externalskins)*((sizeof(galiasskin_t)+sizeof(texnums_t)))); 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; unsigned int num_animinfo=0, num_animkeys=0;
int hunkstart, hunkend, hunktotal; int hunkstart, hunkend, hunktotal;
extern cvar_t temp1; //extern cvar_t temp1; //unused variable
/*load the psk*/ /*load the psk*/
while (pos < com_filesize && !fail) 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; qboolean safe;
int i; int i;
size_t result;
FILE *f; FILE *f;
@ -3028,7 +3029,7 @@ void COM_InitArgv (int argc, const char **argv) //not allowed to tprint
fseek(f, 0, SEEK_SET); fseek(f, 0, SEEK_SET);
buffer = (char*)malloc(len+1); buffer = (char*)malloc(len+1);
fread(buffer, 1, len, f); result = fread(buffer, 1, len, f); // do something with result
buffer[len] = '\0'; buffer[len] = '\0';
while (*buffer && (argc < MAX_NUM_ARGVS)) while (*buffer && (argc < MAX_NUM_ARGVS))

View file

@ -172,6 +172,22 @@ void Cvar_List_f (void)
int gnum, i, num = 0; int gnum, i, num = 0;
int listflags = 0, cvarflags = 0; int listflags = 0, cvarflags = 0;
char strtmp[512]; 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; gsearch = search = NULL;
for (i = 1; i < Cmd_Argc(); i++) for (i = 1; i < Cmd_Argc(); i++)
@ -253,20 +269,7 @@ void Cvar_List_f (void)
break; break;
case 'h': case 'h':
// list options // list options
Con_Printf("cvarlist list all cvars matching given parameters\n" Con_Printf("%s", cvarlist_help);
"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:");
for (num = 1; num <= CVAR_LASTFLAG; num <<= 1) for (num = 1; num <= CVAR_LASTFLAG; num <<= 1)
{ {
@ -353,7 +356,7 @@ void Cvar_List_f (void)
Con_Printf("(%i) ", cmd->restriction); Con_Printf("(%i) ", cmd->restriction);
// print cvar name // print cvar name
Con_Printf(cmd->name); Con_Printf("%s", cmd->name);
// print current value // print current value
if (listflags & CLF_VALUES) 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) static void FSSTDIO_ReadFile(void *handle, flocation_t *loc, char *buffer)
{ {
FILE *f; FILE *f;
size_t result;
f = fopen(loc->rawname, "rb"); f = fopen(loc->rawname, "rb");
if (!f) //err... if (!f) //err...
return; return;
fseek(f, loc->offset, SEEK_SET); 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); fclose(f);
} }
static int FSSTDIO_EnumerateFiles (void *handle, const char *match, int (*func)(const char *, int, void *), void *parm) 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" #include "fs.h"
#ifdef AVAIL_ZLIB #ifdef AVAIL_ZLIB
#define ZEXPORT VARGS
#ifndef ZEXPORT
#define ZEXPORT VARGS
#endif
#include <zlib.h> #include <zlib.h>
typedef struct { typedef struct {

View file

@ -5660,7 +5660,9 @@ and recalculates the area connections
*/ */
void CM_ReadPortalState (FILE *f) 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 (); FloodAreaConnections ();
} }

View file

@ -311,7 +311,7 @@ void Log_Logfile_f (void)
if (log_name[LOG_CONSOLE].string[0]) if (log_name[LOG_CONSOLE].string[0])
f = log_name[LOG_CONSOLE].string; 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); 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 #endif
break; break;
#ifdef USEIPX
case NA_IPX: case NA_IPX:
case NA_BROADCAST_IPX: case NA_BROADCAST_IPX:
#ifdef USEIPX
n = amask->address.ipx; n = amask->address.ipx;
if (i > 80) if (i > 80)
i = 80; i = 80;
@ -884,6 +884,12 @@ void NET_IntegerToMask (netadr_t *a, netadr_t *amask, int bits)
break; break;
case NA_LOOPBACK: case NA_LOOPBACK:
break; 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 *ircuser = Cvar_Get("ircuser", "none", 0, "IRC Connect");
cvar_t *irchost = Cvar_Get("irchost", "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 *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 *ircsomething = Cvar_Get("ircsomething", "moo", 0, "IRC Connect");
cvar_t *ircclientaddr = Cvar_Get("ircclientaddr", "127.0.0.1", 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); FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_UDP6_EstablishConnection, true);
break; break;
#endif #endif
#ifdef USEIPX
case NA_IPX: case NA_IPX:
#ifdef USEIPX
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IPX_EstablishConnection, true); FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IPX_EstablishConnection, true);
break;
#endif #endif
break;
#ifdef IRCCONNECT #ifdef IRCCONNECT
case NA_IRC: case NA_IRC:
FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IRCConnect_EstablishConnection, true); FTENET_AddToCollection(svs.sockets, NULL, s, FTENET_IRCConnect_EstablishConnection, true);
@ -3223,6 +3229,13 @@ void SVNET_AddPort(void)
break; break;
#endif #endif
#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 #endif

View file

@ -571,6 +571,7 @@ void TL_LoadLanguage (char *name, char *shortname, int num) //this is one of the
FILE *f; FILE *f;
int size; int size;
char *buffer; char *buffer;
size_t result;
f = fopen(va("%s.trl", shortname), "rb"); f = fopen(va("%s.trl", shortname), "rb");
if (!f) 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); fseek(f, 0, SEEK_SET);
buffer = malloc(size+1); buffer = malloc(size+1);
buffer[size] = '\0'; buffer[size] = '\0';
fread(buffer, 1, size, f); result = fread(buffer, 1, size, f); // do something with result
fclose(f); fclose(f);
TL_ParseLanguage(name, buffer, num); 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; return r_nulltex;
} }
break; 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); tex = d3d_lookup_texture(identifier);

View file

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

View file

@ -2543,7 +2543,7 @@ static void Shader_MakeCache ( char *path )
cache->hash_next = shader_hash[key]; cache->hash_next = shader_hash[key];
cache->path = path; cache->path = path;
cache->offset = ptr - buf; 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; shader_hash[key] = cache;
ptr = Shader_Skip ( ptr ); ptr = Shader_Skip ( ptr );
@ -4012,7 +4012,7 @@ static qboolean Shader_ParseShader(char *shortname, char *usename, shader_t *s)
Shader_Free(s); Shader_Free(s);
memset ( s, 0, sizeof( shader_t ) ); 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); Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
Shader_ReadShader(s, file); Shader_ReadShader(s, file);
@ -4131,7 +4131,7 @@ static int R_LoadShader ( char *name, shader_gen_t *defaultgen, const char *gena
if (defaultgen) if (defaultgen)
{ {
memset(s, 0, sizeof(shader_t)); 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")) if (!strcmp(shortname, "textures/common/clip"))
Shader_DefaultScript(shortname, s, Shader_DefaultScript(shortname, s,
"{\n" "{\n"
@ -4218,7 +4218,7 @@ void Shader_DoReload(void)
s->generator = defaultgen; s->generator = defaultgen;
s->genargs = genargs; 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); Hash_Add(&shader_active_hash, s->name, s, &s->bucket);
R_BuildDefaultTexnums(&oldtn, s); 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) static void Sh_WorldLightingPass(void)
{ {
msurface_t *s; msurface_t *s;
@ -1590,6 +1591,7 @@ static void Sh_WorldLightingPass(void)
RQuantAdd(RQUANT_LITFACES, s->mesh->numindexes); RQuantAdd(RQUANT_LITFACES, s->mesh->numindexes);
} }
} }
*/
/* /*
draws faces facing the light 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; static entity_t skyent;
batch_t b; 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; float skydist = gl_skyboxdist.value;
if (skydist<1) 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; string_t st;
dfunction_t *func; dfunction_t *func;
int type; int type = 0; // warning about beign used without initializing it
switch(structtype) switch(structtype)
{ {

View file

@ -624,7 +624,7 @@ int PR_ToggleBreakpoint(progfuncs_t *progfuncs, char *filename, int linenum, int
unsigned int i; unsigned int i;
int pn = pr_typecurrent; int pn = pr_typecurrent;
dfunction_t *f; dfunction_t *f;
int op; int op = 0; //warning about not being initialized before use
for (pn = 0; (unsigned)pn < maxprogs; pn++) for (pn = 0; (unsigned)pn < maxprogs; pn++)
{ {
@ -843,7 +843,7 @@ void PR_ExecuteCode (progfuncs_t *progfuncs, int s)
{ {
eval_t *t, *swtch=NULL; eval_t *t, *swtch=NULL;
int swtchtype; int swtchtype = 0; //warning about not being initialized before use
dstatement16_t *st16; dstatement16_t *st16;
dstatement32_t *st32; dstatement32_t *st32;
dfunction_t *newf; 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 *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; int arg;
QCC_type_t *t, *p; QCC_type_t *t, *p;
int extraparms=false; int extraparms=false;
@ -8333,7 +8333,7 @@ void QCC_PR_ParseDefs (char *classname)
QCC_def_t *def, *d; QCC_def_t *def, *d;
QCC_function_t *f; QCC_function_t *f;
QCC_dfunction_t *df; QCC_dfunction_t *df;
int i; int i = 0; // warning: i may be used uninitialized in this function
pbool shared=false; pbool shared=false;
pbool isstatic=defaultstatic; pbool isstatic=defaultstatic;
pbool externfnc=false; pbool externfnc=false;

View file

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

View file

@ -278,6 +278,7 @@ void QCC_BspModels (void)
char *m; char *m;
char cmd[1024]; char cmd[1024];
char name[256]; char name[256];
size_t result;
p = QCC_CheckParm ("-bspmodels"); p = QCC_CheckParm ("-bspmodels");
if (!p) if (!p)
@ -294,7 +295,7 @@ void QCC_BspModels (void)
strcpy (name, m); strcpy (name, m);
name[strlen(m)-4] = 0; name[strlen(m)-4] = 0;
sprintf (cmd, "qbsp %s/%s ; light -extra %s/%s", gamedir, name, gamedir, name); 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 writeonly;
static float dimension_send_default; static float dimension_send_default;
static float zero_default; static float zero_default;
static vec3_t vecwriteonly; //static vec3_t vecwriteonly; // 523:16: warning: unused variable vecwriteonly
int i; int i;
int *v; int *v;
nqglobalvars_t *pr_globals = pr_nqglobal_struct; 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) static void QCBUILTIN PF_svcoredump (progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
int size = 1024*1024*8; 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); COM_WriteFile("ssqccore.txt", buffer, size);
BZ_Free(buffer); BZ_Free(buffer);
} }
*/
static void QCBUILTIN PF_sv_movetogoal (progfuncs_t *prinst, struct globalvars_s *pr_globals) 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); RETURN_SSTRING(s+8);
} }
// warning: PF_strcatp defined but not used
/*
static void QCBUILTIN PF_strcatp(progfuncs_t *prinst, struct globalvars_s *pr_globals) 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); 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); 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) static void QCBUILTIN PF_redstring(progfuncs_t *prinst, struct globalvars_s *pr_globals)
{ {
char *string = PR_GetStringOfs(prinst, OFS_PARM0), *s; 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); RETURN_TSTRING(buf);
} }
*/
#ifdef SVCHAT #ifdef SVCHAT
void SV_Chat(char *filename, float starttag, edict_t *edict); 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); static void SV_Physics_Toss (edict_t *ent);
// warning: SV_CheckAllEnts defined but not used
/* /*
================ ================
SV_CheckAllEnts SV_CheckAllEnts
================ ================
*/
static void SV_CheckAllEnts (void) static void SV_CheckAllEnts (void)
{ {
int e; int e;
@ -102,6 +103,7 @@ static void SV_CheckAllEnts (void)
Con_Printf ("entity in invalid position\n"); 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); ent->v->velocity[1] = side[1] * (1 + d);
} }
// warning: SV_TryUnstick defined but not used
/* /*
===================== =====================
SV_TryUnstick 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... This is a hack, but in the interest of good gameplay...
====================== ======================
*/
static int SV_TryUnstick (edict_t *ent, vec3_t oldvel) static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
{ {
int i; int i;
@ -1436,6 +1439,7 @@ static int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
VectorClear (ent->v->velocity); VectorClear (ent->v->velocity);
return 7; // still not moving return 7; // still not moving
} }
*/
/* /*
===================== =====================
@ -1797,7 +1801,7 @@ SV_RunEntity
void SV_RunEntity (edict_t *ent) void SV_RunEntity (edict_t *ent)
{ {
edict_t *movechain; 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) if (ent->entnum > 0 && ent->entnum <= sv.allocated_client_slots)
{ //a client woo. { //a client woo.

View file

@ -36,9 +36,14 @@ char rank_cvargroup[] = "server rankings";
void inline READ_PLAYERSTATS(int x, rankstats_t *os) void inline READ_PLAYERSTATS(int x, rankstats_t *os)
{ {
int i; int i;
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+sizeof(rankheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET); 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->kills = swaplong(os->kills);
os->deaths = swaplong(os->deaths); 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) void inline READ_PLAYERHEADER(int x, rankheader_t *oh)
{ {
size_t result;
fseek(rankfile, sizeof(rankfileheader_t)+((x-1)*sizeof(rankinfo_t)), SEEK_SET); 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->prev = swaplong(oh->prev); //score is held for convineance.
oh->next = swaplong(oh->next); oh->next = swaplong(oh->next);
@ -125,6 +136,7 @@ void inline WRITEHEADER(void)
qboolean Rank_OpenRankings(void) qboolean Rank_OpenRankings(void)
{ {
char syspath[MAX_OSPATH]; char syspath[MAX_OSPATH];
size_t result;
qboolean created; qboolean created;
if (!rankfile) if (!rankfile)
{ {
@ -150,7 +162,11 @@ qboolean Rank_OpenRankings(void)
memset(&rankfileheader, 0, sizeof(rankfileheader)); memset(&rankfileheader, 0, sizeof(rankfileheader));
fseek(rankfile, 0, SEEK_SET); 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.version = swaplong(rankfileheader.version);
rankfileheader.usedslots = swaplong(rankfileheader.usedslots); rankfileheader.usedslots = swaplong(rankfileheader.usedslots);

View file

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

View file

@ -968,7 +968,7 @@ void SV_Modellist_f (void)
{ {
char mname[MAX_QPATH]; char mname[MAX_QPATH];
char vweaplist[1024] = "//vwep"; 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++) for (i = 0; sv.strings.vw_model_precache[i]; i++)
{ {

View file

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