silenced -Wsign-compare warnings.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-12-29 19:06:08 +00:00
parent 982070b2c5
commit 9ef1ddb76b
18 changed files with 133 additions and 125 deletions

View file

@ -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 */
{

View file

@ -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)

View file

@ -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 ; i<nummodels ; i++)
for (i = 1; i < nummodels; i++)
{
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
if (cl.model_precache[i] == NULL)
@ -364,14 +364,13 @@ void CL_ParseServerInfo (void)
}
S_BeginPrecaching ();
for (i=1 ; i<numsounds ; i++)
for (i = 1; i < numsounds; i++)
{
cl.sound_precache[i] = S_PrecacheSound (sound_precache[i]);
CL_KeepaliveMessage ();
}
S_EndPrecaching ();
// local state
cl_entities[0].model = cl.worldmodel = cl.model_precache[1];
@ -484,7 +483,8 @@ void CL_ParseUpdate (int bits)
skin = MSG_ReadByte();
else
skin = ent->baseline.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<<i) )
cl.punchangle[i] = MSG_ReadChar();
@ -697,7 +698,7 @@ void CL_ParseClientdata (void)
if (cl.items != i)
{ // set flash times
Sbar_Changed ();
for (j=0 ; j<32 ; j++)
for (j = 0; j < 32; j++)
if ( (i & (1<<j)) && !(cl.items & (1<<j)))
cl.item_gettime[j] = cl.time;
cl.items = i;
@ -750,7 +751,7 @@ void CL_ParseClientdata (void)
Sbar_Changed ();
}
for (i=0 ; i<4 ; i++)
for (i = 0; i < 4; i++)
{
j = MSG_ReadByte ();
if (cl.stats[STAT_SHELLS+i] != j)
@ -823,19 +824,23 @@ void CL_NewTranslation (int slot)
bottom = (cl.scores[slot].colors &15)<<4;
R_TranslatePlayerSkin (slot);
for (i=0 ; i<VID_GRADES ; i++, dest += 256, source+=256)
for (i = 0; i < VID_GRADES; i++, dest += 256, source+=256)
{
if (top < 128) // the artists made some backwards ranges. sigh.
memcpy (dest + TOP_RANGE, source + top, 16);
else
for (j=0 ; j<16 ; j++)
{
for (j = 0; j < 16; j++)
dest[TOP_RANGE+j] = source[top+15-j];
}
if (bottom < 128)
memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
else
for (j=0 ; j<16 ; j++)
{
for (j = 0; j < 16; j++)
dest[BOTTOM_RANGE+j] = source[bottom+15-j];
}
}
}
@ -884,7 +889,7 @@ void CL_ParseStaticSound (int version) //johnfitz -- added argument
int sound_num, vol, atten;
int i;
for (i=0 ; i<3 ; i++)
for (i = 0; i < 3; i++)
org[i] = MSG_ReadCoord ();
//johnfitz -- PROTOCOL_FITZQUAKE
@ -961,7 +966,7 @@ void CL_ParseServerMessage (void)
break;
case svc_nop:
// Con_Printf ("svc_nop\n");
// Con_Printf ("svc_nop\n");
break;
case svc_time:
@ -1095,19 +1100,16 @@ void CL_ParseServerMessage (void)
break;
case svc_setpause:
cl.paused = MSG_ReadByte ();
if (cl.paused)
{
cl.paused = MSG_ReadByte ();
if (cl.paused)
{
CDAudio_Pause ();
BGM_Pause ();
}
else
{
CDAudio_Resume ();
BGM_Resume ();
}
CDAudio_Pause ();
BGM_Pause ();
}
else
{
CDAudio_Resume ();
BGM_Resume ();
}
break;
@ -1219,3 +1221,4 @@ void CL_ParseServerMessage (void)
lastcmd = cmd; //johnfitz
}
}

View file

@ -763,7 +763,8 @@ float MSG_ReadFloat (void)
const char *MSG_ReadString (void)
{
static char string[2048];
int l, c;
int c;
size_t l;
l = 0;
do
@ -773,7 +774,7 @@ const char *MSG_ReadString (void)
break;
string[l] = c;
l++;
} while (l < sizeof(string)-1);
} while (l < sizeof(string) - 1);
string[l] = 0;

View file

@ -80,7 +80,7 @@ const char *Con_Quakebar (int len)
static char bar[42];
int i;
len = q_min(len, sizeof(bar) - 2);
len = q_min(len, (int)sizeof(bar) - 2);
len = q_min(len, con_linewidth);
bar[0] = '\35';
@ -1146,7 +1146,7 @@ void Con_DrawInput (void)
text += 1 + key_linepos - con_linewidth;
// draw input string
for (i=0; i <= strlen(text) - 1; i++) //only write enough letters to go from *text to cursor
for (i = 0; i <= (int)strlen(text) - 1; i++) //only write enough letters to go from *text to cursor
Draw_Character ((i+1)<<3, vid.conheight - 16, text[i]);
// johnfitz -- new cursor handling
@ -1164,9 +1164,9 @@ The typing input line at the bottom should only be drawn if typing is allowed
*/
void Con_DrawConsole (int lines, qboolean drawinput)
{
int i, x, y, j, sb, rows;
char ver[32];
char *text;
int i, x, y, j, sb, rows;
char ver[32];
char *text;
if (lines <= 0)
return;
@ -1178,29 +1178,29 @@ void Con_DrawConsole (int lines, qboolean drawinput)
Draw_ConsoleBackground ();
// draw the buffer text
rows = (con_vislines+7)/8;
rows = (con_vislines +7)/8;
y = vid.conheight - rows*8;
rows -= 2; //for input and version lines
sb = (con_backscroll) ? 2 : 0;
for (i = con_current - rows + 1 ; i <= con_current - sb ; i++, y+=8)
for (i = con_current - rows + 1; i <= con_current - sb; i++, y += 8)
{
j = i - con_backscroll;
if (j<0)
if (j < 0)
j = 0;
text = con_text + (j % con_totallines)*con_linewidth;
for (x=0 ; x<con_linewidth ; x++)
Draw_Character ( (x+1)<<3, y, text[x]);
for (x = 0; x < con_linewidth; x++)
Draw_Character ( (x + 1)<<3, y, text[x]);
}
// draw scrollback arrows
if (con_backscroll)
{
y+=8; // blank line
for (x=0 ; x<con_linewidth ; x+=4)
Draw_Character ((x+1)<<3, y, '^');
y+=8;
y += 8; // blank line
for (x = 0; x < con_linewidth; x += 4)
Draw_Character ((x + 1)<<3, y, '^');
y += 8;
}
// draw the input prompt, user text, and cursor
@ -1208,10 +1208,10 @@ void Con_DrawConsole (int lines, qboolean drawinput)
Con_DrawInput ();
//draw version number in bottom right
y+=8;
y += 8;
sprintf (ver, "QuakeSpasm %1.2f.%d", (float)FITZQUAKE_VERSION, QUAKESPASM_VER_PATCH);
for (x=0; x<strlen(ver); x++)
Draw_Character ((con_linewidth-strlen(ver)+x+2)<<3, y, ver[x] /*+ 128*/);
for (x = 0; x < (int)strlen(ver); x++)
Draw_Character ((con_linewidth - strlen(ver) + x + 2)<<3, y, ver[x] /*+ 128*/);
}

View file

@ -379,7 +379,7 @@ void Cvar_SetQuick (cvar_t *var, const char *value)
var->string = Z_Strdup (value);
else
{
size_t len;
int len;
if (!strcmp(var->string, value))
return; // no change

View file

@ -1582,7 +1582,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer)
// swap all the lumps
mod_base = (byte *)header;
for (i=0 ; i<sizeof(dheader_t)/4 ; i++)
for (i = 0; i < (int) sizeof(dheader_t) / 4; i++)
((int *)header)[i] = LittleLong ( ((int *)header)[i]);
// load into heap
@ -2096,9 +2096,8 @@ void Mod_LoadAliasModel (model_t *mod, void *buffer)
// allocate space for a working header, plus all the data except the frames,
// skin and group info
//
size = sizeof (aliashdr_t)
+ (LittleLong (pinmodel->numframes) - 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);

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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';

View file

@ -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];

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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
{

View file

@ -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);