From 6fb3daf04a26ac42b15c02c2276f6820ffe795a8 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 30 Oct 2002 15:28:26 +0000 Subject: [PATCH] fixed all the signed/unsigned mismatch warnings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2591 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 4 ++-- console.c | 2 +- gl_backend.c | 4 ++-- gl_models.c | 4 ++-- gl_textures.c | 2 +- host_cmd.c | 6 +++--- image.c | 2 +- keys.c | 6 +++--- makefile | 2 +- menu.c | 6 +++--- model_alias.c | 20 ++++++++++---------- model_brush.c | 6 +++--- model_shared.c | 4 ++-- net_dgrm.c | 30 +++++++++++++++--------------- net_master.c | 8 ++++---- pr_edict.c | 10 +++++----- pr_exec.c | 2 +- pr_execprogram.h | 4 ++-- progs.h | 2 +- quakeio.c | 4 ++-- snd_dma.c | 6 +++--- snd_oss.c | 3 +-- wad.c | 6 +++--- zone.h | 10 +++++----- 24 files changed, 76 insertions(+), 77 deletions(-) diff --git a/common.c b/common.c index 0f413b2d..584bd837 100644 --- a/common.c +++ b/common.c @@ -375,7 +375,7 @@ char *MSG_ReadString (void) break; string[l] = c; l++; - } while (l < sizeof(string)-1); + } while (l < (int)sizeof(string)-1); string[l] = 0; @@ -1083,7 +1083,7 @@ void COM_CopyFile (char *netpath, char *cachepath) while (remaining) { - if (remaining < sizeof(buf)) + if (remaining < (int)sizeof(buf)) count = remaining; else count = sizeof(buf); diff --git a/console.c b/console.c index 941e6124..e323915b 100644 --- a/console.c +++ b/console.c @@ -543,7 +543,7 @@ void Con_DrawNotify (void) sprintf(temptext, "say_team:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); else sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); - while (strlen(temptext) >= con_linewidth) + while (strlen(temptext) >= (size_t) con_linewidth) { DrawQ_String (0, v, temptext, con_linewidth, 8, 8, 1, 1, 1, 1, 0); strcpy(temptext, &temptext[con_linewidth]); diff --git a/gl_backend.c b/gl_backend.c index 9ce7459d..8125cb75 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -323,8 +323,8 @@ void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double typedef struct gltextureunit_s { - unsigned int t1d, t2d, t3d, tcubemap; - unsigned int arrayenabled; + int t1d, t2d, t3d, tcubemap; + int arrayenabled; float rgbscale, alphascale; int combinergb, combinealpha; // FIXME: add more combine stuff diff --git a/gl_models.c b/gl_models.c index 36e172e1..d798e378 100644 --- a/gl_models.c +++ b/gl_models.c @@ -180,8 +180,8 @@ void R_AliasLerpVerts(int vertcount, float *vertices, float *normals, skinframe_t *R_FetchSkinFrame(const entity_render_t *ent) { model_t *model = ent->model; - unsigned int s = (unsigned int) ent->skinnum; - if (s >= model->numskins) + int s = ent->skinnum; + if ((unsigned int)s >= (unsigned int)model->numskins) s = 0; if (model->skinscenes[s].framecount > 1) return &model->skinframes[model->skinscenes[s].firstframe + (int) (cl.time * 10) % model->skinscenes[s].framecount]; diff --git a/gl_textures.c b/gl_textures.c index edd0b7db..076f12da 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -120,7 +120,7 @@ gltexture_t; typedef struct gltexturepool_s { - int sentinel; + unsigned int sentinel; struct gltextureimage_s *imagechain; struct gltexture_s *gltchain; struct gltexturepool_s *next; diff --git a/host_cmd.c b/host_cmd.c index bd079b02..bd209df6 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -567,7 +567,7 @@ void Host_PerformLoadGame(char *name) entnum = -1; while (!Qeof(f)) { - for (i = 0;i < sizeof(buf) - 1;i++) + for (i = 0;i < (int)sizeof(buf) - 1;i++) { r = Qgetc (f); if (r == EOF || !r) @@ -730,7 +730,7 @@ void Host_Say(qboolean teamonly) } while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r')) p2--; - for (j = strlen(text);j < (sizeof(text) - 2) && p1 < p2;) + for (j = strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;) text[j++] = *p1++; text[j++] = '\n'; text[j++] = 0; @@ -811,7 +811,7 @@ void Host_Tell_f(void) } while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r')) p2--; - for (j = strlen(text);j < (sizeof(text) - 2) && p1 < p2;) + for (j = strlen(text);j < (int)(sizeof(text) - 2) && p1 < p2;) text[j++] = *p1++; text[j++] = '\n'; text[j++] = 0; diff --git a/image.c b/image.c index 13120cee..287d43e1 100644 --- a/image.c +++ b/image.c @@ -91,7 +91,7 @@ qbyte* LoadPCX (const qbyte *f, int matchwidth, int matchheight) const qbyte *palette, *fin, *enddata; int x, y, x2, dataByte; - if (loadsize < sizeof(pcx) + 768) + if (loadsize < (int)sizeof(pcx) + 768) { Con_Printf ("Bad pcx file\n"); return NULL; diff --git a/keys.c b/keys.c index b60c056a..eacffff0 100644 --- a/keys.c +++ b/keys.c @@ -211,7 +211,7 @@ void Key_Console (int key) if (key == K_DEL) // delete char on cursor { - if (key_linepos < strlen(key_lines[edit_line])) + if ((size_t)key_linepos < strlen(key_lines[edit_line])) strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1); return; } @@ -221,9 +221,9 @@ void Key_Console (int key) // otherwise just go right one if (key == K_RIGHTARROW) { - if (strlen(key_lines[edit_line]) == key_linepos) + if (strlen(key_lines[edit_line]) == (size_t)key_linepos) { - if (strlen(key_lines[(edit_line + 31) & 31]) <= key_linepos) + if (strlen(key_lines[(edit_line + 31) & 31]) <= (size_t)key_linepos) return; // no character to get key_lines[edit_line][key_linepos] = key_lines[(edit_line + 31) & 31][key_linepos]; diff --git a/makefile b/makefile index 9e7802ac..29e9b3ca 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ ##### Variables that you may want to modify ##### #choose the compiler you want to use -CC=gcc-3.1 +CC=gcc-cvs #recommended for: anyone not using ALSA 0.5 OBJ_SND=snd_oss.o snd_dma.o snd_mix.o snd_mem.o diff --git a/menu.c b/menu.c index 256f2c54..b4ee44b8 100644 --- a/menu.c +++ b/menu.c @@ -1974,7 +1974,7 @@ void M_Menu_Video_f (void) m_entersound = true; // Look for the current resolution - for (video_resolution = 0; video_resolution < sizeof (video_resolutions) / sizeof (video_resolutions[0]); video_resolution++) + for (video_resolution = 0; video_resolution < (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0])); video_resolution++) { if (video_resolutions[video_resolution][0] == current_vid_width && video_resolutions[video_resolution][1] == current_vid_height) @@ -2012,7 +2012,7 @@ void M_Video_Draw (void) // Fullscreen M_Print(16, video_cursor_table[2], " Fullscreen"); M_DrawCheckbox(220, video_cursor_table[2], vid_fullscreen.integer); - + // Stencil M_Print(16, video_cursor_table[3], " Stencil"); M_DrawCheckbox(220, video_cursor_table[3], vid_stencil.integer); @@ -2037,7 +2037,7 @@ void M_Menu_Video_AdjustSliders (int dir) int new_resolution = video_resolution + dir; if (new_resolution < 0) video_resolution = sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1; - else if (new_resolution > sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1) + else if (new_resolution > (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1)) video_resolution = 0; else video_resolution = new_resolution; diff --git a/model_alias.c b/model_alias.c index 14faa5f7..24829cfa 100644 --- a/model_alias.c +++ b/model_alias.c @@ -870,7 +870,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) // go through the lumps, swapping things { - unsigned int i, numposes; + int i, numposes; zymscene_t *scene; // zymlump_t lump_scenes; // zymscene_t scene[numscenes]; // name and other information for each scene (see zymscene struct) loadmodel->animscenes = Mem_Alloc(loadmodel->mempool, sizeof(animscene_t) * loadmodel->numframes); @@ -883,9 +883,9 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) loadmodel->animscenes[i].framecount = BigLong(scene->length); loadmodel->animscenes[i].framerate = BigFloat(scene->framerate); loadmodel->animscenes[i].loop = (BigLong(scene->flags) & ZYMSCENEFLAG_NOLOOP) == 0; - if ((unsigned int) loadmodel->animscenes[i].firstframe >= numposes) + if ((unsigned int) loadmodel->animscenes[i].firstframe >= (unsigned int) numposes) Host_Error("Mod_LoadZymoticModel: scene firstframe (%i) >= numposes (%i)\n", loadmodel->animscenes[i].firstframe, numposes); - if ((unsigned int) loadmodel->animscenes[i].firstframe + (unsigned int) loadmodel->animscenes[i].framecount > numposes) + if ((unsigned int) loadmodel->animscenes[i].firstframe + (unsigned int) loadmodel->animscenes[i].framecount > (unsigned int) numposes) Host_Error("Mod_LoadZymoticModel: scene firstframe (%i) + framecount (%i) >= numposes (%i)\n", loadmodel->animscenes[i].firstframe, loadmodel->animscenes[i].framecount, numposes); if (loadmodel->animscenes[i].framerate < 0) Host_Error("Mod_LoadZymoticModel: scene framerate (%f) < 0\n", loadmodel->animscenes[i].framerate); @@ -894,7 +894,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i; + int i; float *poses; // zymlump_t lump_poses; // float pose[numposes][numbones][3][4]; // animation data loadmodel->zymdata_poses = Mem_Alloc(loadmodel->mempool, pheader->lump_poses.length); @@ -904,7 +904,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i; + int i; zymbone_t *bone; // zymlump_t lump_bones; // zymbone_t bone[numbones]; loadmodel->zymdata_bones = Mem_Alloc(loadmodel->mempool, pheader->numbones * sizeof(zymbone_t)); @@ -920,7 +920,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i, *bonecount; + int i, *bonecount; // zymlump_t lump_vertbonecounts; // int vertbonecounts[numvertices]; // how many bones influence each vertex (separate mainly to make this compress better) loadmodel->zymdata_vertbonecounts = Mem_Alloc(loadmodel->mempool, pheader->numbones * sizeof(int)); bonecount = (void *) (pheader->lump_vertbonecounts.start + pbase); @@ -933,7 +933,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i; + int i; zymvertex_t *vertdata; // zymlump_t lump_verts; // zymvertex_t vert[numvertices]; // see vertex struct loadmodel->zymdata_verts = Mem_Alloc(loadmodel->mempool, pheader->lump_verts.length); @@ -948,7 +948,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i; + int i; float *intexcoord, *outtexcoord; // zymlump_t lump_texcoords; // float texcoords[numvertices][2]; loadmodel->zymdata_texcoords = outtexcoord = Mem_Alloc(loadmodel->mempool, pheader->numverts * sizeof(float[4])); @@ -962,7 +962,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i, count, a, b, c, *renderlist, *renderlistend, *outrenderlist; + int i, count, a, b, c, *renderlist, *renderlistend, *outrenderlist; // zymlump_t lump_render; // int renderlist[rendersize]; // sorted by shader with run lengths (int count), shaders are sequentially used, each run can be used with glDrawElements (each triangle is 3 int indices) loadmodel->zymdata_renderlist = Mem_Alloc(loadmodel->mempool, pheader->lump_render.length); // byteswap, validate, and swap winding order of tris @@ -996,7 +996,7 @@ void Mod_LoadZymoticModel(model_t *mod, void *buffer) } { - unsigned int i; + int i; char *shadername; // zymlump_t lump_shaders; // char shadername[numshaders][32]; // shaders used on this model shadername = (void *) (pheader->lump_shaders.start + pbase); diff --git a/model_brush.c b/model_brush.c index 050fed9e..3296a68d 100644 --- a/model_brush.c +++ b/model_brush.c @@ -383,10 +383,10 @@ static void Mod_LoadTextures (lump_t *l) Image_Copy8bitRGBA(mtdata, basepixels, basepixels_width * basepixels_height, palette_nofullbrights); if (!glowpixels) { - for (j = 0;j < tx->width*tx->height;j++) + for (j = 0;j < (int)(tx->width*tx->height);j++) if (((qbyte *)&palette_onlyfullbrights[mtdata[j]])[3] > 0) // fullbright break; - if (j < tx->width * tx->height) + if (j < (int)(tx->width * tx->height)) { glowpixels_width = tx->width; glowpixels_height = tx->height; @@ -2783,7 +2783,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer) // swap all the lumps mod_base = (qbyte *)header; - for (i=0 ; iused = true; @@ -414,7 +414,7 @@ void Mod_ValidateElements(const int *elements, int numtriangles, int numverts, c { int i; for (i = 0;i < numtriangles * 3;i++) - if ((unsigned int)elements[i] >= numverts) + if ((unsigned int)elements[i] >= (unsigned int)numverts) Con_Printf("Mod_ValidateElements: out of bounds element detected at %s:%d\n", filename, fileline); } diff --git a/net_dgrm.c b/net_dgrm.c index fe34fba0..194739f7 100644 --- a/net_dgrm.c +++ b/net_dgrm.c @@ -330,7 +330,7 @@ int Datagram_GetMessage (qsocket_t *sock) if (length == 0) break; - if (length == -1) + if ((int)length == -1) { Con_Printf("Read error\n"); return -1; @@ -526,7 +526,7 @@ static void Test_Poll(void) while (1) { len = dfunc.Read (testSocket, net_message.data, net_message.maxsize, &clientaddr); - if (len < sizeof(int)) + if (len < (int)sizeof(int)) break; net_message.cursize = len; @@ -536,7 +536,7 @@ static void Test_Poll(void) MSG_ReadLong(); if (control == -1) break; - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) break; if ((control & NETFLAG_LENGTH_MASK) != len) break; @@ -650,7 +650,7 @@ static void Test2_Poll(void) name[0] = 0; len = dfunc.Read (test2Socket, net_message.data, net_message.maxsize, &clientaddr); - if (len < sizeof(int)) + if (len < (int)sizeof(int)) goto Reschedule; net_message.cursize = len; @@ -660,7 +660,7 @@ static void Test2_Poll(void) MSG_ReadLong(); if (control == -1) goto Error; - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) goto Error; if ((control & NETFLAG_LENGTH_MASK) != len) goto Error; @@ -841,16 +841,16 @@ static qsocket_t *_Datagram_CheckNewConnections (void) SZ_Clear(&net_message); len = dfunc.Read (acceptsock, net_message.data, net_message.maxsize, &clientaddr); - if (len < sizeof(int)) + if (len < (int)sizeof(int)) return NULL; net_message.cursize = len; MSG_BeginReading (); control = BigLong(*((int *)net_message.data)); MSG_ReadLong(); - + // Messages starting by 0xFFFFFFFF are master server messages - if (control == 0xFFFFFFFF) + if ((unsigned int)control == 0xFFFFFFFF) { int responsesize = Master_HandleMessage(); if (responsesize > 0) @@ -860,7 +860,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void) } return NULL; } - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) return NULL; if ((control & NETFLAG_LENGTH_MASK) != len) return NULL; @@ -1096,7 +1096,7 @@ static qboolean Datagram_HandleServerInfo (struct qsockaddr *readaddr) int control; int c, n, i; - if (net_message.cursize < sizeof(int)) + if (net_message.cursize < (int)sizeof(int)) return false; // don't answer our own query @@ -1113,7 +1113,7 @@ static qboolean Datagram_HandleServerInfo (struct qsockaddr *readaddr) MSG_ReadLong(); if (control == -1) return false; - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) return false; if ((control & NETFLAG_LENGTH_MASK) != net_message.cursize) return false; @@ -1240,7 +1240,7 @@ static qboolean _Datagram_SearchForInetHosts (const char *master) Con_DPrintf("Datagram_SearchForInetHosts: Recv received %d byte message\n", net_message.cursize); Master_ParseServerList (&dfunc); } - + while ((ret = dfunc.Read (dfunc.controlSock, net_message.data, net_message.maxsize, &readaddr)) > 0) { net_message.cursize = ret; @@ -1264,7 +1264,7 @@ qboolean Datagram_SearchForInetHosts (const char *master) if (_Datagram_SearchForInetHosts (master)) result = true; } - + return result; } @@ -1331,7 +1331,7 @@ static qsocket_t *_Datagram_Connect (const char *host) continue; } - if (ret < sizeof(int)) + if (ret < (int)sizeof(int)) { ret = 0; continue; @@ -1347,7 +1347,7 @@ static qsocket_t *_Datagram_Connect (const char *host) ret = 0; continue; } - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) { ret = 0; continue; diff --git a/net_master.c b/net_master.c index 6aa7499c..1f63d17f 100644 --- a/net_master.c +++ b/net_master.c @@ -85,7 +85,7 @@ const char* Master_BuildGetServers (void) cvar_t* sv_master; char request [256]; - if (nextmaster >= sizeof (sv_masters) / sizeof (sv_masters[0])) + if (nextmaster >= (int)(sizeof (sv_masters) / sizeof (sv_masters[0]))) { nextmaster = 0; return NULL; @@ -123,8 +123,8 @@ const char* Master_BuildHeartbeat (void) { static int nextmaster = 0; cvar_t* sv_master; - - if (nextmaster >= sizeof (sv_masters) / sizeof (sv_masters[0])) + + if (nextmaster >= (int)(sizeof (sv_masters) / sizeof (sv_masters[0]))) { nextmaster = 0; return NULL; @@ -233,7 +233,7 @@ void Master_ParseServerList (net_landriver_t* dfunc) struct qsockaddr svaddr; char ipstring [32]; - if (net_message.cursize < sizeof(int)) + if (net_message.cursize < (int)sizeof(int)) return; // is the cache full? diff --git a/pr_edict.c b/pr_edict.c index 3d4553a4..396d8106 100644 --- a/pr_edict.c +++ b/pr_edict.c @@ -911,7 +911,7 @@ qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s) } *(int *)d = G_INT(def->ofs); break; - + case ev_function: func = ED_FindFunction (s); if (!func) @@ -1194,7 +1194,7 @@ void PR_LoadProgs (void) pr_crc = CRC_Block((qbyte *)progs, com_filesize); // byte swap the header - for (i=0 ; iversion != PROG_VERSION) @@ -1255,7 +1255,7 @@ void PR_LoadProgs (void) } // append the darkplaces fields - for (i = 0;i < DPFIELDS;i++) + for (i = 0;i < (int) DPFIELDS;i++) { pr_fielddefs[progs->numfielddefs].type = dpfields[i].type; pr_fielddefs[progs->numfielddefs].ofs = progs->entityfields; @@ -1574,14 +1574,14 @@ int EDICT_TO_PROG(edict_t *e) { int n; n = e - sv.edicts; - if ((unsigned int)n >= sv.max_edicts) + if ((unsigned int)n >= (unsigned int)sv.max_edicts) Host_Error("EDICT_TO_PROG: invalid edict %8p (number %i compared to world at %8p)\n", e, n, sv.edicts); return n;// EXPERIMENTAL //return (qbyte *)e->v - (qbyte *)sv.edictsfields; } edict_t *PROG_TO_EDICT(int n) { - if ((unsigned int)n >= sv.max_edicts) + if ((unsigned int)n >= (unsigned int)sv.max_edicts) Host_Error("PROG_TO_EDICT: invalid edict number %i\n", n); return sv.edictstable[n]; // EXPERIMENTAL //return sv.edictstable[(n) / (progs->entityfields * 4)]; diff --git a/pr_exec.c b/pr_exec.c index ee35aa16..5681213f 100644 --- a/pr_exec.c +++ b/pr_exec.c @@ -36,7 +36,7 @@ int localstack[LOCALSTACK_SIZE]; int localstack_used; -qboolean pr_trace; +int pr_trace; dfunction_t *pr_xfunction; int pr_xstatement; diff --git a/pr_execprogram.h b/pr_execprogram.h index f41a4c59..be8468bc 100644 --- a/pr_execprogram.h +++ b/pr_execprogram.h @@ -169,7 +169,7 @@ case OP_ADDRESS: pr_xstatement = st - pr_statements; #if PRBOUNDSCHECK - if ((unsigned int)OPB->_int >= progs->entityfields) + if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields)) { Host_Error("Progs attempted to address an invalid field (%i) in an edict\n", OPB->_int); return; @@ -191,7 +191,7 @@ case OP_LOAD_FNC: pr_xstatement = st - pr_statements; #if PRBOUNDSCHECK - if ((unsigned int)OPB->_int >= progs->entityfields) + if ((unsigned int)(OPB->_int) >= (unsigned int)(progs->entityfields)) { Host_Error("Progs attempted to read an invalid field in an edict (%i)\n", OPB->_int); return; diff --git a/progs.h b/progs.h index 85a0e3a9..96b50128 100644 --- a/progs.h +++ b/progs.h @@ -172,7 +172,7 @@ extern int pr_numbuiltins; extern int pr_argc; -extern qboolean pr_trace; +extern int pr_trace; extern dfunction_t *pr_xfunction; extern int pr_xstatement; diff --git a/quakeio.c b/quakeio.c index 65535f93..d3dd6cfd 100644 --- a/quakeio.c +++ b/quakeio.c @@ -116,7 +116,7 @@ Qopen (const char *path, const char *mode) Qexpand_squiggle (path, e_path); path = e_path; - for (p = m; *mode && p - m < (sizeof (m) - 1); mode++) { + for (p = m; *mode && p - m < (int)(sizeof (m) - 1); mode++) { if (*mode == 'z') { zip = 1; continue; @@ -160,7 +160,7 @@ Qdopen (int fd, const char *mode) char m[80], *p; int zip = 0; - for (p = m; *mode && p - m < (sizeof (m) - 1); mode++) { + for (p = m; *mode && p - m < (int)(sizeof (m) - 1); mode++) { if (*mode == 'z') { zip = 1; continue; diff --git a/snd_dma.c b/snd_dma.c index 0e91d010..6587918d 100644 --- a/snd_dma.c +++ b/snd_dma.c @@ -302,7 +302,7 @@ S_TouchSound void S_TouchSound (char *name) { sfx_t *sfx; - + if (!sound_started) return; @@ -866,7 +866,7 @@ void S_Update_(void) // mix ahead of current position endtime = soundtime + _snd_mixahead.value * shm->speed; samps = shm->samples >> (shm->channels-1); - if (endtime - soundtime > samps) + if (endtime > (unsigned int)(soundtime + samps)) endtime = soundtime + samps; #ifdef _WIN32 @@ -1083,7 +1083,7 @@ void S_RawSamples_Dequeue(int *samples, unsigned int length) out[i] = in[i]; //Con_Printf("S_RawSamples_Dequeue: normal %i\n", l); } - if (l < length) + if (l < (int)length) { memset(samples + l * 2, 0, (length - l) * sizeof(int[2])); //Con_Printf("S_RawSamples_Dequeue: padding with %i samples\n", length - l); diff --git a/snd_oss.c b/snd_oss.c index c939d744..5c67fc19 100644 --- a/snd_oss.c +++ b/snd_oss.c @@ -113,10 +113,9 @@ qboolean SNDDMA_Init(void) shm->speed = atoi(com_argv[i+1]); else { - for (i=0 ; ispeed = tryrates[i]; } diff --git a/wad.c b/wad.c index b5000082..755ae5e6 100644 --- a/wad.c +++ b/wad.c @@ -70,7 +70,7 @@ void W_LoadWadFile (char *filename) { lumpinfo_t *lump_p; wadinfo_t *header; - unsigned i; + int i; int infotableofs; void *temp; @@ -155,7 +155,7 @@ void W_LoadTextureWadFile (char *filename, int complain) { lumpinfo_t *lumps, *lump_p; wadinfo_t header; - unsigned i, j; + int i, j; int infotableofs; QFile *file; int numlumps; @@ -183,7 +183,7 @@ void W_LoadTextureWadFile (char *filename, int complain) if (!(lumps = Mem_Alloc(tempmempool, sizeof(lumpinfo_t)*numlumps))) {Con_Printf ("W_LoadTextureWadFile: unable to allocate temporary memory for lump table");return;} - if (Qread(file, lumps, sizeof(lumpinfo_t) * numlumps) != sizeof(lumpinfo_t) * numlumps) + if (Qread(file, lumps, sizeof(lumpinfo_t) * numlumps) != (int)sizeof(lumpinfo_t) * numlumps) {Con_Printf ("W_LoadTextureWadFile: unable to read lump table");return;} for (i=0, lump_p = lumps ; i