From 9ef1ddb76b19c98898ae573a7e2f39159e936f50 Mon Sep 17 00:00:00 2001 From: sezero Date: Thu, 29 Dec 2011 19:06:08 +0000 Subject: [PATCH] silenced -Wsign-compare warnings. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/bgmusic.c | 11 ++++-- Quake/cd_win.c | 2 +- Quake/cl_parse.c | 87 +++++++++++++++++++++++--------------------- Quake/common.c | 5 ++- Quake/console.c | 34 ++++++++--------- Quake/cvar.c | 2 +- Quake/gl_model.c | 9 ++--- Quake/gl_texmgr.c | 28 +++++++------- Quake/gl_texmgr.h | 10 ++--- Quake/gl_vidnt.c | 2 +- Quake/gl_vidsdl.c | 2 +- Quake/host_cmd.c | 12 +++--- Quake/keys.c | 8 ++-- Quake/menu.c | 4 +- Quake/net_dgrm.c | 32 ++++++++-------- Quake/snd_alsa.c | 4 +- Quake/sys_sdl_unix.c | 2 +- Quake/zone.c | 4 +- 18 files changed, 133 insertions(+), 125 deletions(-) diff --git a/Quake/bgmusic.c b/Quake/bgmusic.c index 19f18087..a16e54e6 100644 --- a/Quake/bgmusic.c +++ b/Quake/bgmusic.c @@ -388,10 +388,11 @@ static void BGM_UpdateStream (void) /* our max buffer size */ fileBytes = fileSamples * (bgmstream->info.width * bgmstream->info.channels); - if (fileBytes > sizeof(raw)) + if (fileBytes > (int) sizeof(raw)) { - fileBytes = sizeof(raw); - fileSamples = fileBytes / (bgmstream->info.width * bgmstream->info.channels); + fileBytes = (int) sizeof(raw); + fileSamples = fileBytes / + (bgmstream->info.width * bgmstream->info.channels); } /* Read */ @@ -405,7 +406,9 @@ static void BGM_UpdateStream (void) if (res > 0) /* data: add to raw buffer */ { S_RawSamples(fileSamples, bgmstream->info.rate, - bgmstream->info.width, bgmstream->info.channels, raw, bgmvolume.value); + bgmstream->info.width, + bgmstream->info.channels, + raw, bgmvolume.value); } else if (res == 0) /* EOF */ { diff --git a/Quake/cd_win.c b/Quake/cd_win.c index 2d0ab2b1..3cdc86d4 100644 --- a/Quake/cd_win.c +++ b/Quake/cd_win.c @@ -401,7 +401,7 @@ static void CD_f (void) LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - if (lParam != wDeviceID) + if (lParam != (LONG)wDeviceID) return 1; switch (wParam) diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index ac9c47b0..037a9b3c 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -131,22 +131,22 @@ CL_ParseStartSoundPacket */ void CL_ParseStartSoundPacket(void) { - vec3_t pos; - int channel, ent; - int sound_num; - int volume; - int field_mask; - float attenuation; - int i; + vec3_t pos; + int channel, ent; + int sound_num; + int volume; + int field_mask; + float attenuation; + int i; - field_mask = MSG_ReadByte(); + field_mask = MSG_ReadByte(); - if (field_mask & SND_VOLUME) + if (field_mask & SND_VOLUME) volume = MSG_ReadByte (); else volume = DEFAULT_SOUND_PACKET_VOLUME; - if (field_mask & SND_ATTENUATION) + if (field_mask & SND_ATTENUATION) attenuation = MSG_ReadByte () / 64.0; else attenuation = DEFAULT_SOUND_PACKET_ATTENUATION; @@ -178,10 +178,10 @@ void CL_ParseStartSoundPacket(void) if (ent > cl_max_edicts) //johnfitz -- no more MAX_EDICTS Host_Error ("CL_ParseStartSoundPacket: ent = %i", ent); - for (i=0 ; i<3 ; i++) + for (i = 0; i < 3; i++) pos[i] = MSG_ReadCoord (); - S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation); + S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation); } /* @@ -305,7 +305,7 @@ void CL_ParseServerInfo (void) // precache models memset (cl.model_precache, 0, sizeof(cl.model_precache)); - for (nummodels=1 ; ; nummodels++) + for (nummodels = 1 ; ; nummodels++) { str = MSG_ReadString (); if (!str[0]) @@ -326,7 +326,7 @@ void CL_ParseServerInfo (void) // precache sounds memset (cl.sound_precache, 0, sizeof(cl.sound_precache)); - for (numsounds=1 ; ; numsounds++) + for (numsounds = 1 ; ; numsounds++) { str = MSG_ReadString (); if (!str[0]) @@ -352,7 +352,7 @@ void CL_ParseServerInfo (void) // copy the naked name of the map file to the cl structure -- O.S COM_StripExtension (COM_SkipPath(model_precache[1]), cl.mapname, sizeof(cl.mapname)); - for (i=1 ; ibaseline.skin; - if (skin != ent->skinnum) { + if (skin != ent->skinnum) + { ent->skinnum = skin; if (num > 0 && num <= cl.maxclients) R_TranslateNewPlayerSkin (num - 1); //johnfitz -- was R_TranslatePlayerSkin @@ -526,7 +526,7 @@ void CL_ParseUpdate (int bits) ent->msg_angles[0][2] = ent->baseline.angles[2]; //johnfitz -- lerping for movetype_step entities - if ( bits & U_STEP ) + if (bits & U_STEP) { ent->lerpflags |= LERP_MOVESTEP; ent->forcelink = true; @@ -559,9 +559,10 @@ void CL_ParseUpdate (int bits) //HACK: if this bit is set, assume this is PROTOCOL_NEHAHRA if (bits & U_TRANS) { - float a,b; + float a, b; - if (warn_about_nehahra_protocol) { + if (warn_about_nehahra_protocol) + { Con_Warning ("nonstandard update bit, assuming Nehahra protocol\n"); warn_about_nehahra_protocol = false; } @@ -628,7 +629,7 @@ void CL_ParseBaseline (entity_t *ent, int version) //johnfitz -- added argument ent->baseline.colormap = MSG_ReadByte(); ent->baseline.skin = MSG_ReadByte(); - for (i=0 ; i<3 ; i++) + for (i = 0; i < 3; i++) { ent->baseline.origin[i] = MSG_ReadCoord (); ent->baseline.angles[i] = MSG_ReadAngle (); @@ -670,7 +671,7 @@ void CL_ParseClientdata (void) cl.idealpitch = 0; VectorCopy (cl.mvelocity[0], cl.mvelocity[1]); - for (i=0 ; i<3 ; i++) + for (i = 0; i < 3; i++) { if (bits & (SU_PUNCH1<string = Z_Strdup (value); else { - size_t len; + int len; if (!strcmp(var->string, value)) return; // no change diff --git a/Quake/gl_model.c b/Quake/gl_model.c index 443fc8eb..b0601a45 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -1582,7 +1582,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer) // swap all the lumps mod_base = (byte *)header; - for (i=0 ; inumframes) - 1) * - sizeof (pheader->frames[0]); + size = sizeof(aliashdr_t) + + (LittleLong (pinmodel->numframes) - 1) * sizeof (pheader->frames[0]); pheader = (aliashdr_t *) Hunk_AllocName (size, loadname); mod->flags = LittleLong (pinmodel->flags); @@ -2349,7 +2348,7 @@ void Mod_LoadSpriteModel (model_t *mod, void *buffer) numframes = LittleLong (pin->numframes); - size = sizeof (msprite_t) + (numframes - 1) * sizeof (psprite->frames); + size = sizeof (msprite_t) + (numframes - 1) * sizeof (psprite->frames); psprite = (msprite_t *) Hunk_AllocName (size, loadname); diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index 3125370a..ba932b61 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -330,7 +330,7 @@ gltexture_t *TexMgr_NewTexture (void) glt->next = active_gltextures; active_gltextures = glt; - glGenTextures(1, (GLuint *)&glt->texnum); + glGenTextures(1, &glt->texnum); numgltextures++; return glt; } @@ -356,7 +356,7 @@ void TexMgr_FreeTexture (gltexture_t *kill) kill->next = free_gltextures; free_gltextures = kill; - glDeleteTextures(1, (const GLuint *)&kill->texnum); + glDeleteTextures(1, &kill->texnum); numgltextures--; return; } @@ -368,7 +368,7 @@ void TexMgr_FreeTexture (gltexture_t *kill) kill->next = free_gltextures; free_gltextures = kill; - glDeleteTextures(1, (const GLuint *)&kill->texnum); + glDeleteTextures(1, &kill->texnum); numgltextures--; return; } @@ -528,9 +528,9 @@ void TexMgr_RecalcWarpImageSize (void) gl_warpimagesize = TexMgr_SafeTextureSize (512); - while (gl_warpimagesize > vid.width) + while (gl_warpimagesize > (int)vid.width) gl_warpimagesize >>= 1; - while (gl_warpimagesize > vid.height) + while (gl_warpimagesize > (int)vid.height) gl_warpimagesize >>= 1; if (gl_warpimagesize == oldsize) @@ -978,14 +978,14 @@ void TexMgr_LoadImage32 (gltexture_t *glt, unsigned *data) picmip = (glt->flags & TEXPREF_NOPICMIP) ? 0 : q_max((int)gl_picmip.value, 0); mipwidth = TexMgr_SafeTextureSize (glt->width >> picmip); mipheight = TexMgr_SafeTextureSize (glt->height >> picmip); - while (glt->width > mipwidth) + while ((int) glt->width > mipwidth) { TexMgr_MipMapW (data, glt->width, glt->height); glt->width >>= 1; if (glt->flags & TEXPREF_ALPHA) TexMgr_AlphaEdgeFix ((byte *)data, glt->width, glt->height); } - while (glt->height > mipheight) + while ((int) glt->height > mipheight) { TexMgr_MipMapH (data, glt->width, glt->height); glt->height >>= 1; @@ -1049,10 +1049,10 @@ void TexMgr_LoadImage8 (gltexture_t *glt, byte *data) // detect false alpha cases if (glt->flags & TEXPREF_ALPHA && !(glt->flags & TEXPREF_CONCHARS)) { - for (i = 0; i < glt->width*glt->height; i++) + for (i = 0; i < (int) (glt->width * glt->height); i++) if (data[i] == 255) //transparent index break; - if (i == glt->width*glt->height) + if (i == (int) (glt->width * glt->height)) glt->flags -= TEXPREF_ALPHA; } @@ -1081,13 +1081,13 @@ void TexMgr_LoadImage8 (gltexture_t *glt, byte *data) // pad each dimention, but only if it's not going to be downsampled later if (glt->flags & TEXPREF_PAD) { - if (glt->width < TexMgr_SafeTextureSize(glt->width)) + if ((int) glt->width < TexMgr_SafeTextureSize(glt->width)) { data = TexMgr_PadImageW (data, glt->width, glt->height, padbyte); glt->width = TexMgr_Pad(glt->width); padw = true; } - if (glt->height < TexMgr_SafeTextureSize(glt->height)) + if ((int) glt->height < TexMgr_SafeTextureSize(glt->height)) { data = TexMgr_PadImageH (data, glt->width, glt->height, padbyte); glt->height = TexMgr_Pad(glt->height); @@ -1328,7 +1328,7 @@ void TexMgr_ReloadImages (void) for (glt=active_gltextures; glt; glt=glt->next) { - glGenTextures(1, (GLuint *)&glt->texnum); + glGenTextures(1, &glt->texnum); TexMgr_ReloadImage (glt, -1, -1); } } @@ -1355,7 +1355,7 @@ void TexMgr_ReloadNobrightImages (void) ================================================================================ */ -int currenttexture = -1; // to avoid unnecessary texture sets +GLuint currenttexture = (GLuint)-1; // to avoid unnecessary texture sets GLenum TEXTURE0, TEXTURE1; //johnfitz qboolean mtexenabled = false; @@ -1367,7 +1367,7 @@ GL_SelectTexture -- johnfitz -- rewritten void GL_SelectTexture (GLenum target) { static GLenum currenttarget; - static int ct0, ct1; + static GLuint ct0, ct1; if (target == currenttarget) return; diff --git a/Quake/gl_texmgr.h b/Quake/gl_texmgr.h index 3583889f..e6df5800 100644 --- a/Quake/gl_texmgr.h +++ b/Quake/gl_texmgr.h @@ -43,15 +43,15 @@ typedef uintptr_t src_offset_t; typedef struct gltexture_s { //managed by texture manager - unsigned int texnum; + GLuint texnum; struct gltexture_s *next; - model_t *owner; + model_t *owner; //managed by image loading - char name[64]; + char name[64]; unsigned int width; //size of image as it exists in opengl unsigned int height; //size of image as it exists in opengl unsigned int flags; - char source_file[MAX_QPATH]; //relative filepath to data source, or "" if source is in memory + char source_file[MAX_QPATH]; //relative filepath to data source, or "" if source is in memory src_offset_t source_offset; //byte offset into file, or memory address enum srcformat source_format; //format of pixel data (indexed, lightmap, or rgba) unsigned int source_width; //size of image in source data @@ -60,7 +60,7 @@ typedef struct gltexture_s { char shirt; //0-13 shirt color, or -1 if never colormapped char pants; //0-13 pants color, or -1 if never colormapped //used for rendering - int visframe; //matches r_framecount if texture was bound this frame + int visframe; //matches r_framecount if texture was bound this frame } gltexture_t; extern gltexture_t *notexture; diff --git a/Quake/gl_vidnt.c b/Quake/gl_vidnt.c index beda2bdb..d2897a0b 100644 --- a/Quake/gl_vidnt.c +++ b/Quake/gl_vidnt.c @@ -917,7 +917,7 @@ char *GL_MakeNiceExtensionsList (const char *in) int i, count; //each space will be replaced by 4 chars, so count the spaces before we malloc - for (i = 0, count = 1; i < strlen(in); i++) + for (i = 0, count = 1; i < (int) strlen(in); i++) if (in[i] == ' ') count++; out = Z_Malloc (strlen(in) + count*3 + 1); //usually about 1-2k diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index 42cdd72e..6defd21f 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -518,7 +518,7 @@ char *GL_MakeNiceExtensionsList (const char *in) int i, count; //each space will be replaced by 4 chars, so count the spaces before we malloc - for (i = 0, count = 1; i < strlen(in); i++) + for (i = 0, count = 1; i < (int) strlen(in); i++) if (in[i] == ' ') count++; out = (char *) Z_Malloc (strlen(in) + count*3 + 1); //usually about 1-2k diff --git a/Quake/host_cmd.c b/Quake/host_cmd.c index cb1ec9a9..0978f343 100644 --- a/Quake/host_cmd.c +++ b/Quake/host_cmd.c @@ -1176,7 +1176,7 @@ void Host_Loadgame_f (void) entnum = -1; // -1 is the globals while (!feof(f)) { - for (i = 0; i < sizeof(str) - 1; i++) + for (i = 0; i < (int) sizeof(str) - 1; i++) { r = fgetc (f); if (r == EOF || !r) @@ -1188,7 +1188,7 @@ void Host_Loadgame_f (void) break; } } - if (i == sizeof(str) - 1) + if (i == (int) sizeof(str) - 1) { fclose (f); Sys_Error ("Loadgame buffer overflow"); @@ -1330,8 +1330,8 @@ void Host_Say(qboolean teamonly) q_snprintf (text, sizeof(text), "\001<%s> %s", hostname.string, p); // check length & truncate if necessary - j = strlen(text); - if (j >= sizeof(text) - 1) + j = (int) strlen(text); + if (j >= (int) sizeof(text) - 1) { text[sizeof(text) - 2] = '\n'; text[sizeof(text) - 1] = '\0'; @@ -1408,8 +1408,8 @@ void Host_Tell_f(void) q_snprintf (text, sizeof(text), "%s: %s", host_client->name, p); // check length & truncate if necessary - j = strlen(text); - if (j >= sizeof(text) - 1) + j = (int) strlen(text); + if (j >= (int) sizeof(text) - 1) { text[sizeof(text) - 2] = '\n'; text[sizeof(text) - 1] = '\0'; diff --git a/Quake/keys.c b/Quake/keys.c index 1ecabcf2..4b87d255 100644 --- a/Quake/keys.c +++ b/Quake/keys.c @@ -233,7 +233,7 @@ void Key_Console (int key) case K_DEL: key_tabpartial[0] = 0; - if (key_linepos < strlen(key_lines[edit_line])) + if (key_linepos < (int) strlen(key_lines[edit_line])) strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1); return; @@ -274,7 +274,7 @@ void Key_Console (int key) // when mouse is released to the window manager // case K_MWHEELUP: con_backscroll += keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2; - if (con_backscroll > con_totallines - (vid.height>>3) - 1) + if (con_backscroll > con_totallines - (int)(vid.height>>3) - 1) con_backscroll = con_totallines - (vid.height>>3) - 1; return; @@ -294,9 +294,9 @@ void Key_Console (int key) return; case K_RIGHTARROW: - if (strlen(key_lines[edit_line]) == key_linepos) + if ((int) strlen(key_lines[edit_line]) == key_linepos) { - if (strlen(key_lines[(edit_line + 31) & 31]) <= key_linepos) + if ((int) strlen(key_lines[(edit_line + 31) & 31]) <= key_linepos) return; // no character to get key_lines[edit_line][key_linepos] = key_lines[(edit_line + 31) & 31][key_linepos]; diff --git a/Quake/menu.c b/Quake/menu.c index 00b3a1fb..189b297a 100644 --- a/Quake/menu.c +++ b/Quake/menu.c @@ -1355,7 +1355,7 @@ void M_Keys_Draw (void) M_Print (18, 32, "Enter to change, backspace to clear"); // search for known bindings - for (i = 0; i < NUMCOMMANDS; i++) + for (i = 0; i < (int)NUMCOMMANDS; i++) { y = 48 + 8*i; @@ -1424,7 +1424,7 @@ void M_Keys_Key (int k) case K_RIGHTARROW: S_LocalSound ("misc/menu1.wav"); keys_cursor++; - if (keys_cursor >= NUMCOMMANDS) + if (keys_cursor >= (int)NUMCOMMANDS) keys_cursor = 0; break; diff --git a/Quake/net_dgrm.c b/Quake/net_dgrm.c index a2f8eea7..4a88c242 100644 --- a/Quake/net_dgrm.c +++ b/Quake/net_dgrm.c @@ -50,7 +50,7 @@ static struct { unsigned int length; unsigned int sequence; - byte data[MAX_DATAGRAM]; + byte data[MAX_DATAGRAM]; } packetBuffer; static int myDriverLevel; @@ -80,7 +80,8 @@ static void NET_Ban_f (void) { char addrStr [32]; char maskStr [32]; - void (*print_fn) (const char *fmt, ...) __fp_attribute__((__format__(__printf__,1,2))); + void (*print_fn)(const char *fmt, ...) + __fp_attribute__((__format__(__printf__,1,2))); if (cmd_source == src_command) { @@ -301,7 +302,8 @@ int Datagram_GetMessage (qsocket_t *sock) while (1) { - length = sfunc.Read (sock->socket, (byte *)&packetBuffer, NET_DATAGRAMSIZE, &readaddr); + length = (unsigned int) sfunc.Read(sock->socket, (byte *)&packetBuffer, + NET_DATAGRAMSIZE, &readaddr); // if ((rand() & 255) > 220) // continue; @@ -309,7 +311,7 @@ int Datagram_GetMessage (qsocket_t *sock) if (length == 0) break; - if (length == -1) + if (length == (unsigned int)-1) { Con_Printf("Read error\n"); return -1; @@ -540,7 +542,7 @@ static void Test_Poll (void *unused) 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; @@ -550,7 +552,7 @@ static void Test_Poll (void *unused) 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; @@ -565,7 +567,7 @@ static void Test_Poll (void *unused) connectTime = MSG_ReadLong(); Q_strcpy(address, MSG_ReadString()); - Con_Printf("%s\n frags:%3i colors:%u %u time:%u\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address); + Con_Printf("%s\n frags:%3i colors:%d %d time:%d\n %s\n", name, frags, colors >> 4, colors & 0x0f, connectTime / 60, address); } testPollCount--; @@ -669,7 +671,7 @@ static void Test2_Poll (void *unused) 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; @@ -679,7 +681,7 @@ static void Test2_Poll (void *unused) 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; @@ -876,7 +878,7 @@ 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; @@ -885,7 +887,7 @@ static qsocket_t *_Datagram_CheckNewConnections (void) MSG_ReadLong(); if (control == -1) 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; @@ -1143,7 +1145,7 @@ static void _Datagram_SearchForHosts (qboolean xmit) while ((ret = dfunc.Read (dfunc.controlSock, net_message.data, net_message.maxsize, &readaddr)) > 0) { - if (ret < sizeof(int)) + if (ret < (int) sizeof(int)) continue; net_message.cursize = ret; @@ -1160,7 +1162,7 @@ static void _Datagram_SearchForHosts (qboolean xmit) MSG_ReadLong(); if (control == -1) continue; - if ((control & (~NETFLAG_LENGTH_MASK)) != NETFLAG_CTL) + if ((control & (~NETFLAG_LENGTH_MASK)) != (int)NETFLAG_CTL) continue; if ((control & NETFLAG_LENGTH_MASK) != ret) continue; @@ -1298,7 +1300,7 @@ static qsocket_t *_Datagram_Connect (const char *host) continue; } - if (ret < sizeof(int)) + if (ret < (int) sizeof(int)) { ret = 0; continue; @@ -1314,7 +1316,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/Quake/snd_alsa.c b/Quake/snd_alsa.c index 465fe017..07e6d3ea 100644 --- a/Quake/snd_alsa.c +++ b/Quake/snd_alsa.c @@ -130,7 +130,7 @@ qboolean SNDDMA_Init (dma_t *dma) } else { - if (rate != tryrates[i]) + if (rate != (unsigned int) tryrates[i]) { Con_Printf ("Warning: Rate set (%u) didn't match requested rate (%d)!\n", rate, tryrates[i]); // goto error; @@ -146,7 +146,7 @@ qboolean SNDDMA_Init (dma_t *dma) } else { - if (rate != (int)sndspeed.value) + if (rate != (unsigned int) sndspeed.value) { Con_Printf ("Warning: Rate set (%u) didn't match requested rate (%d)!\n", rate, (int)sndspeed.value); // goto error; diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c index 090f5482..d14fd062 100644 --- a/Quake/sys_sdl_unix.c +++ b/Quake/sys_sdl_unix.c @@ -235,7 +235,7 @@ const char *Sys_ConsoleInput (void) } con_text[textlen] = c; textlen++; - if (textlen < sizeof(con_text)) + if (textlen < (int) sizeof(con_text)) con_text[textlen] = '\0'; else { diff --git a/Quake/zone.c b/Quake/zone.c index 41de8d85..e5a34219 100644 --- a/Quake/zone.c +++ b/Quake/zone.c @@ -318,7 +318,7 @@ void Hunk_Check (void) { if (h->sentinal != HUNK_SENTINAL) Sys_Error ("Hunk_Check: trahsed sentinal"); - if (h->size < sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) + if (h->size < (int) sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) Sys_Error ("Hunk_Check: bad size"); h = (hunk_t *)((byte *)h+h->size); } @@ -375,7 +375,7 @@ void Hunk_Print (qboolean all) // if (h->sentinal != HUNK_SENTINAL) Sys_Error ("Hunk_Check: trahsed sentinal"); - if (h->size < sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) + if (h->size < (int) sizeof(hunk_t) || h->size + (byte *)h - hunk_base > hunk_size) Sys_Error ("Hunk_Check: bad size"); next = (hunk_t *)((byte *)h+h->size);