]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed all the signed/unsigned mismatch warnings
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 Oct 2002 15:28:26 +0000 (15:28 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 Oct 2002 15:28:26 +0000 (15:28 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2591 d7cf8633-e32d-0410-b094-e92efae38249

24 files changed:
common.c
console.c
gl_backend.c
gl_models.c
gl_textures.c
host_cmd.c
image.c
keys.c
makefile
menu.c
model_alias.c
model_brush.c
model_shared.c
net_dgrm.c
net_master.c
pr_edict.c
pr_exec.c
pr_execprogram.h
progs.h
quakeio.c
snd_dma.c
snd_oss.c
wad.c
zone.h

index 0f413b2ddde0cc493ed19b662cfde10571388041..584bd837881759c23879e48d1fbd64129613d3d1 100644 (file)
--- 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);
index 941e6124bbb59200cb660c5a2f4c2a7a048165a8..e323915b2c35b0a5069750a94644ba7daf41d420 100644 (file)
--- 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]);
index 9ce7459d2c5de3376f994ca4626ee63d49bec9b9..8125cb7592588e6f4a595399256d705e22ace705 100644 (file)
@@ -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
index 36e172e1b2d7982486a63793754a0e217b1896b1..d798e37874fcd4ce2c1f284f3ae688a6563d0471 100644 (file)
@@ -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];
index edd0b7dbac9ba494ea1774fe31567f2ca819c61f..076f12da5da407ca9c8a5327b6f7b2a53ae62a2d 100644 (file)
@@ -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;
index bd079b0209efb7278ebc24ee5f741d7f6b610af9..bd209df64949f1b82b94af9a16a3633772156cb4 100644 (file)
@@ -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 13120cee75a6cf2e8da1f4340075834f8c5b3fe7..287d43e12d01a5eee35711029ea777379504cdfb 100644 (file)
--- 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 b60c056a0dfe23a50bf62c9abd448e994e07dc54..eacffff03444352a4069f3d23cccd08593f8363b 100644 (file)
--- 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];
index 9e7802ac6bf139e4cb2fbe1bf6930c13f56a704c..29e9b3ca82cd7da24fbc0e5f9aa8ce3d42394c4e 100644 (file)
--- 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 256f2c548f10097e74a0eed8fc019ecc9bda6db9..b4ee44b8e00d5337cd97930656e5dbaa979d794b 100644 (file)
--- 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;
index 14faa5f70674546588f8a165cc7d5f9ee2dcb6fe..24829cfa80c9d10267f67419721baacec71a1501 100644 (file)
@@ -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);
index 050fed9eb64ed0a7f561e367092fc5434ca5cc74..3296a68da26c9597559b9167b8e4f3a6a0946751 100644 (file)
@@ -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 ; 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
index 7cf2603d114784e3e79865c9845f6d5692a2e846..2ab19e64a04295c3a0c1fa989d930131311dae6f 100644 (file)
@@ -148,7 +148,7 @@ Loads a model
 */
 static model_t *Mod_LoadModel (model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel)
 {
-       int crc;
+       unsigned int crc;
        void *buf;
 
        mod->used = 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);
 }
 
index fe34fba0d94bc64e1fcce33877da354387a80575..194739f71870e0a133a012d6546f92c5f5ba119a 100644 (file)
@@ -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;
index 6aa7499cec586ce2bfcf7a94c47c8e428a6c1f77..1f63d17f614b7800ab82b3cb686f601dae54b724 100644 (file)
@@ -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?
index 3d4553a489c5818b3ba197480be80745fe3474a9..396d8106ac43b8e9be2612dfab88d297e641a32c 100644 (file)
@@ -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 ; i<sizeof(*progs)/4 ; i++)
+       for (i = 0;i < (int) sizeof(*progs) / 4;i++)
                ((int *)progs)[i] = LittleLong ( ((int *)progs)[i] );
 
        if (progs->version != 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)];
index ee35aa1602ae9b78721b2ca45613f6c254c6d714..5681213ffb86c3f4f79bb5e0bf73bf22973b2659 100644 (file)
--- 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;
 
index f41a4c5919debca869768404812df366c2133701..be8468bcfccbde1adc3f10a2ad396e71ab92faa8 100644 (file)
                        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;
                        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 85a0e3a9d500c7e85fe66c539e5b317dd0c934a7..96b5012884ceb65c8b44288b56840dc2fc03a3b6 100644 (file)
--- 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;
 
index 65535f9352b0c4949066d99b578393219439a13a..d3dd6cfda4abe57c647011d94f5e2acf369e1fca 100644 (file)
--- 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;
index 0e91d01085ea880e64c443fef90e0f35c872fc60..6587918d63916921cb5350d61106f65d5c7e6d8c 100644 (file)
--- 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);
index c939d7441904c588197b08c8365001bcd025ffc7..5c67fc198bfff298acbb1b0dfb8a95b19f5e179f 100644 (file)
--- 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 ; i<sizeof(tryrates)/4 ; i++) {
+               for (i = 0;i < (int) sizeof(tryrates) / 4;i++)
                        if (!ioctl(audio_fd, SNDCTL_DSP_SPEED, &tryrates[i]))
                                break;
-               }
 
                shm->speed = tryrates[i];
     }
diff --git a/wad.c b/wad.c
index b5000082e122d2f7b3d4ad9a3ccded64c626b4d6..755ae5e6662319245c3c805fb9f33007eecbcabe 100644 (file)
--- 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<numlumps ; i++,lump_p++)
diff --git a/zone.h b/zone.h
index 8db00453c8ca23fc05c986391bab4c25c888c43a..d4abe16d4ee90518991a6bb696f09574a0c72fbb 100644 (file)
--- a/zone.h
+++ b/zone.h
@@ -55,7 +55,7 @@ typedef struct memheader_s
        const char *filename;
        int fileline;
        // should always be MEMHEADER_SENTINEL1
-       int sentinel1;
+       unsigned int sentinel1;
        // immediately followed by data, which is followed by a MEMHEADER_SENTINEL2 byte
 }
 memheader_t;
@@ -66,12 +66,12 @@ typedef struct memclump_s
        // contents of the clump
        qbyte block[MEMCLUMPSIZE];
        // should always be MEMCLUMP_SENTINEL
-       int sentinel1;
+       unsigned int sentinel1;
        // if a bit is on, it means that the MEMUNIT bytes it represents are
        // allocated, otherwise free
        int bits[MEMBITINTS];
        // should always be MEMCLUMP_SENTINEL
-       int sentinel2;
+       unsigned int sentinel2;
        // if this drops to 0, the clump is freed
        int blocksinuse;
        // largest block of memory available (this is reset to an optimistic
@@ -86,7 +86,7 @@ memclump_t;
 typedef struct mempool_s
 {
        // should always be MEMHEADER_SENTINEL1
-       int sentinel1;
+       unsigned int sentinel1;
        // chain of individual memory allocations
        struct memheader_s *chain;
 #if MEMCLUMPING
@@ -107,7 +107,7 @@ typedef struct mempool_s
        const char *filename;
        int fileline;
        // should always be MEMHEADER_SENTINEL1
-       int sentinel2;
+       unsigned int sentinel2;
 }
 mempool_t;