fix a bunch of warnings
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 Jan 2010 23:15:03 +0000 (23:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 31 Jan 2010 23:15:03 +0000 (23:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9905 d7cf8633-e32d-0410-b094-e92efae38249

26 files changed:
cap_avi.c
cl_demo.c
cl_gecko.c
cl_particles.c
client.h
cmd.c
common.c
console.c
csprogs.c
dpvsimpledecode.c
ft2.c
gl_backend.c
gl_draw.c
gl_rmain.c
gl_rsurf.c
gl_textures.c
host.c
image.c
lhnet.c
menu.c
model_alias.c
model_brush.c
model_shared.c
netconn.c
protocol.c
prvm_cmds.c

index 1292f12..e7cf88d 100644 (file)
--- a/cap_avi.c
+++ b/cap_avi.c
@@ -309,7 +309,8 @@ static void SCR_CaptureVideo_RIFF_Finish(qboolean final)
 static void SCR_CaptureVideo_RIFF_OverflowCheck(int framesize)
 {
        LOAD_FORMATSPECIFIC_AVI();
-       fs_offset_t cursize, curfilesize;
+       fs_offset_t cursize;
+       //fs_offset_t curfilesize;
        if (format->riffstacklevel != 2)
                Sys_Error("SCR_CaptureVideo_RIFF_OverflowCheck: chunk stack leakage!\n");
        
@@ -319,7 +320,7 @@ static void SCR_CaptureVideo_RIFF_OverflowCheck(int framesize)
        // check where we are in the file
        SCR_CaptureVideo_RIFF_Flush();
        cursize = SCR_CaptureVideo_RIFF_GetPosition() - format->riffstackstartoffset[0];
-       curfilesize = SCR_CaptureVideo_RIFF_GetPosition();
+       //curfilesize = SCR_CaptureVideo_RIFF_GetPosition();
 
        // if this would overflow the windows limit of 1GB per RIFF chunk, we need
        // to close the current RIFF chunk and open another for future frames
index 5e77cad..08f8474 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -179,7 +179,7 @@ Handles playback of demos
 */
 void CL_ReadDemoMessage(void)
 {
-       int r, i;
+       int i;
        float f;
 
        if (!cls.demoplayback)
@@ -251,7 +251,7 @@ void CL_ReadDemoMessage(void)
                VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
                for (i = 0;i < 3;i++)
                {
-                       r = (int)FS_Read(cls.demofile, &f, 4);
+                       FS_Read(cls.demofile, &f, 4);
                        cl.mviewangles[0][i] = LittleFloat(f);
                }
 
index b4f6542..c5c7f09 100644 (file)
@@ -37,10 +37,10 @@ typedef struct OSGK_BaseObject_s OSGK_BaseObject;
 static int (*osgk_addref) (OSGK_BaseObject* obj);
 static int (*osgk_release) (OSGK_BaseObject* obj);
 
-static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj)
+/*static OSGK_INLINE int osgk_addref_real (OSGK_BaseObject* obj)
 {
   return osgk_addref (obj);
-}
+}*/
 
 static OSGK_INLINE int osgk_release_real (OSGK_BaseObject* obj)
 {
@@ -71,11 +71,11 @@ static OSGK_Embedding* (*osgk_embedding_create2) (
   unsigned int apiVer, OSGK_EmbeddingOptions* options, 
   OSGK_GeckoResult* geckoResult);
 
-static OSGK_INLINE OSGK_Embedding* osgk_embedding_create (
+/*static OSGK_INLINE OSGK_Embedding* osgk_embedding_create (
   OSGK_GeckoResult* geckoResult)
 {
   return osgk_embedding_create2 (OSGK_API_VERSION, 0, geckoResult);
-}
+}*/
 
 static OSGK_INLINE OSGK_Embedding* osgk_embedding_create_with_options (
   OSGK_EmbeddingOptions* options, OSGK_GeckoResult* geckoResult)
index 5e17b0c..3747c31 100644 (file)
@@ -1307,14 +1307,12 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o
 // these parameters, only trail handling does
 void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins, const vec3_t originmaxs, const vec3_t velocitymins, const vec3_t velocitymaxs, entity_t *ent, int palettecolor, qboolean spawndlight, qboolean spawnparticles)
 {
-       vec3_t center;
        qboolean found = false;
        if (effectnameindex < 1 || effectnameindex >= MAX_PARTICLEEFFECTNAME || !particleeffectname[effectnameindex][0])
        {
                Con_DPrintf("Unknown effect number %i received from server\n", effectnameindex);
                return; // no such effect
        }
-       VectorLerp(originmins, 0.5, originmaxs, center);
        if (!cl_particles_quake.integer && particleeffectinfo[0].effectnameindex)
        {
                int effectinfoindex;
@@ -1322,7 +1320,6 @@ void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins
                int tex, staintex;
                particleeffectinfo_t *info;
                vec3_t center;
-               vec3_t centervelocity;
                vec3_t traildir;
                vec3_t trailpos;
                vec3_t rvec;
@@ -1333,7 +1330,6 @@ void CL_ParticleTrail(int effectnameindex, float pcount, const vec3_t originmins
                particle_t *part;
                // note this runs multiple effects with the same name, each one spawns only one kind of particle, so some effects need more than one
                VectorLerp(originmins, 0.5, originmaxs, center);
-               VectorLerp(velocitymins, 0.5, velocitymaxs, centervelocity);
                supercontents = CL_PointSuperContents(center);
                underwater = (supercontents & (SUPERCONTENTS_WATER | SUPERCONTENTS_SLIME)) != 0;
                VectorSubtract(originmaxs, originmins, traildir);
@@ -2596,11 +2592,11 @@ void R_DrawParticle_TransparentCallback(const entity_render_t *ent, const rtligh
 
 void R_DrawParticles (void)
 {
-       int i, a, content;
+       int i, a;
        int drawparticles = r_drawparticles.integer;
        float minparticledist;
        particle_t *p;
-       float gravity, dvel, decalfade, frametime, f, dist, oldorg[3];
+       float gravity, frametime, f, dist, oldorg[3];
        float drawdist2;
        int hitent;
        trace_t trace;
@@ -2615,8 +2611,6 @@ void R_DrawParticles (void)
 
        minparticledist = DotProduct(r_refdef.view.origin, r_refdef.view.forward) + 4.0f;
        gravity = frametime * cl.movevars_gravity;
-       dvel = 1+4*frametime;
-       decalfade = frametime * 255 / cl_decals_fadetime.value;
        update = frametime > 0;
        drawdist2 = r_drawparticles_drawdistance.value * r_refdef.view.quality;
        drawdist2 = drawdist2*drawdist2;
@@ -2636,8 +2630,6 @@ void R_DrawParticles (void)
                                continue;
                        p->delayedspawn = 0;
 
-                       content = 0;
-
                        p->size += p->sizeincrease * frametime;
                        p->alpha -= p->alphafade * frametime;
 
index 9bac816..150212a 100644 (file)
--- a/client.h
+++ b/client.h
@@ -758,7 +758,7 @@ typedef struct particletype_s
 }
 particletype_t;
 
-typedef enum
+typedef enum ptype_e
 {
        pt_dead, pt_alphastatic, pt_static, pt_spark, pt_beam, pt_rain, pt_raindecal, pt_snow, pt_bubble, pt_blood, pt_smoke, pt_decal, pt_entityparticle, pt_total
 }
diff --git a/cmd.c b/cmd.c
index 9e4059e..d68a289 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -1633,7 +1633,6 @@ void Cmd_ExecuteString (const char *text, cmd_source_t src)
                                        Con_Printf("Command \"%s\" can not be executed\n", Cmd_Argv(0));
                                found = true;
                                goto command_found;
-                               break;
                        case src_client:
                                if (cmd->clientfunction)
                                {
index 12a4255..3b7135a 100644 (file)
--- a/common.c
+++ b/common.c
@@ -734,7 +734,6 @@ int COM_Wordwrap(const char *string, size_t length, float continuationWidth, flo
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
                                isContinuation = false;
                                goto out;
-                               break;
                        case '\n': // end of line
                                result += processLine(passthroughPL, startOfLine, cursor - startOfLine, spaceUsedInLine, isContinuation);
                                isContinuation = false;
index dc3ca9c..b709f13 100644 (file)
--- a/console.c
+++ b/console.c
@@ -2171,7 +2171,6 @@ int Nicks_CompleteCountPossible(char *line, int pos, char *s, qboolean isCon)
 {
        char name[128];
        int i, p;
-       int length;
        int match;
        int spos;
        int count = 0;
@@ -2195,7 +2194,6 @@ int Nicks_CompleteCountPossible(char *line, int pos, char *s, qboolean isCon)
                if(!name[0])
                        continue;
 
-               length = strlen(name);
                match = -1;
                spos = pos - 1; // no need for a minimum of characters :)
 
index a30dd10..bb43a0e 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -670,7 +670,7 @@ void CSQC_ReadEntities (void)
                {
                        entnum = MSG_ReadShort();
                        if(!entnum || msg_badread)
-                               return;
+                               break;
                        realentnum = entnum & 0x7FFF;
                        prog->globals.client->self = cl.csqc_server2csqcentitynumber[realentnum];
                        if(entnum & 0x8000)
@@ -798,7 +798,7 @@ void Cmd_ClearCsqcFuncs (void);
 
 // returns true if the packet is valid, false if end of file is reached
 // used for dumping the CSQC download into demo files
-qboolean MakeDownloadPacket(const char *filename, unsigned char *data, unsigned long len, int crc, int cnt, sizebuf_t *buf, int protocol)
+qboolean MakeDownloadPacket(const char *filename, unsigned char *data, size_t len, int crc, int cnt, sizebuf_t *buf, int protocol)
 {
        int packetsize = buf->maxsize - 7; // byte short long
        int npackets = (len + packetsize - 1) / (packetsize);
@@ -867,7 +867,7 @@ void CL_VM_Init (void)
        }
        if (csprogsdata)
        {
-               csprogsdatacrc = CRC_Block(csprogsdata, csprogsdatasize);
+               csprogsdatacrc = CRC_Block(csprogsdata, (size_t)csprogsdatasize);
                if (csprogsdatacrc != requiredcrc || csprogsdatasize != requiredsize)
                {
                        if (cls.demoplayback)
@@ -955,7 +955,7 @@ void CL_VM_Init (void)
                        i = 0;
 
                        CL_CutDemo(&demobuf, &demofilesize);
-                       while(MakeDownloadPacket(csqc_progname.string, csprogsdata, csprogsdatasize, csprogsdatacrc, i++, &sb, cls.protocol))
+                       while(MakeDownloadPacket(csqc_progname.string, csprogsdata, (size_t)csprogsdatasize, csprogsdatacrc, i++, &sb, cls.protocol))
                                CL_WriteDemoMessage(&sb);
                        CL_PasteDemo(&demobuf, &demofilesize);
 
index 202cd6a..3f6567b 100644 (file)
@@ -279,7 +279,6 @@ static int dpvsimpledecode_setpixelformat(dpvsimpledecodestream_t *s, unsigned i
        default:
                s->error = DPVSIMPLEDECODEERROR_UNSUPPORTEDBPP;
                return s->error;
-               break;
        }
        for (Rshift = 0;!(Rmask & 1);Rshift++, Rmask >>= 1);
        for (Gshift = 0;!(Gmask & 1);Gshift++, Gmask >>= 1);
diff --git a/ft2.c b/ft2.c
index 29ddf92..ce92935 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -312,11 +312,13 @@ qboolean Font_Attach(ft2_font_t *font, ft2_attachment_t *attachment)
 
 float Font_VirtualToRealSize(float sz)
 {
-       int vh, vw, si;
+       int vh;
+       //int vw;
+       int si;
        float sn;
        if(sz < 0)
                return sz;
-       vw = ((vid.width > 0) ? vid.width : vid_width.value);
+       //vw = ((vid.width > 0) ? vid.width : vid_width.value);
        vh = ((vid.height > 0) ? vid.height : vid_height.value);
        // now try to scale to our actual size:
        sn = sz * vh / vid_conheight.value;
index 737df7e..fd0cff6 100644 (file)
@@ -1681,8 +1681,6 @@ void R_Mesh_TexBind(unsigned int unitnum, rtexture_t *tex)
        }
 }
 
-static const float gl_identitymatrix[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1};
-
 void R_Mesh_TexMatrix(unsigned int unitnum, const matrix4x4_t *matrix)
 {
        gltextureunit_t *unit = gl_state.units + unitnum;
index 19a52ed..de8bc08 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -458,11 +458,9 @@ void Draw_Frame(void)
        int i;
        cachepic_t *pic;
        static double nextpurgetime;
-       int purgeframe;
        if (nextpurgetime > realtime)
                return;
        nextpurgetime = realtime + 0.05;
-       purgeframe = draw_frame - 1;
        for (i = 0, pic = cachepics;i < numcachepics;i++, pic++)
        {
                if (pic->autoload && pic->tex && pic->lastusedframe < draw_frame)
@@ -1124,12 +1122,13 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max
        size_t bytes_left;
        ft2_font_map_t *fontmap = NULL;
        ft2_font_map_t *map = NULL;
-       ft2_font_map_t *prevmap = NULL;
+       //ft2_font_map_t *prevmap = NULL;
        ft2_font_t *ft2 = fnt->ft2;
        // float ftbase_x;
        qboolean snap = true;
        qboolean least_one = false;
-       float dw, dh; // display w/h
+       float dw; // display w
+       //float dh; // display h
        const float *width_of;
 
        if (!h) h = w;
@@ -1152,7 +1151,7 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max
        }
 
        dw = w * sw;
-       dh = h * sh;
+       //dh = h * sh;
 
        if (*maxlen < 1)
                *maxlen = 1<<30;
@@ -1283,7 +1282,7 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max
                        if (prevch && Font_GetKerningForMap(ft2, map_index, w, h, prevch, ch, &kx, NULL))
                                x += kx * dw;
                        x += map->glyphs[mapch].advance_x * dw;
-                       prevmap = map;
+                       //prevmap = map;
                        prevch = ch;
                }
        }
@@ -1311,7 +1310,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
        Uchar prevch = 0; // used for kerning
        int tempcolorindex;
        int map_index = 0;
-       ft2_font_map_t *prevmap = NULL; // the previous map
+       //ft2_font_map_t *prevmap = NULL; // the previous map
        ft2_font_map_t *map = NULL;     // the currently used map
        ft2_font_map_t *fontmap = NULL; // the font map for the size
        float ftbase_y;
@@ -1611,7 +1610,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
                                        av = vertex3f;
                                }
 
-                               prevmap = map;
+                               //prevmap = map;
                                prevch = ch;
                        }
                        if (shadow)
index b400122..7d5d259 100644 (file)
@@ -8860,7 +8860,7 @@ void R_LoadQWSkin(r_qwskincache_t *cache, const char *skinname)
                f = FS_LoadFile(name, tempmempool, true, &filesize);
                if (f)
                {
-                       if (LoadPCX_QWSkin(f, filesize, pixels, 296, 194))
+                       if (LoadPCX_QWSkin(f, (int)filesize, pixels, 296, 194))
                                skinframe = R_SkinFrame_LoadInternalQuake(name, textureflags, true, r_fullbrights.integer, pixels, image_width, image_height);
                        Mem_Free(f);
                }
@@ -11436,7 +11436,6 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float
        tridecal_t *decal;
        tridecal_t *decals;
        int i;
-       int maxdecals;
 
        // expand or initialize the system
        if (decalsystem->maxdecals <= decalsystem->numdecals)
@@ -11463,7 +11462,6 @@ static void R_DecalSystem_SpawnTriangle(decalsystem_t *decalsystem, const float
        }
 
        // grab a decal and search for another free slot for the next one
-       maxdecals = decalsystem->maxdecals;
        decals = decalsystem->decals;
        decal = decalsystem->decals + (i = decalsystem->freedecal++);
        for (i = decalsystem->freedecal;i < decalsystem->numdecals && decals[i].color4ub[0][3];i++)
@@ -11520,13 +11518,11 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor
        const msurface_t *surfaces;
        const int *surfacelist;
        const texture_t *texture;
-       int numvertices;
        int numtriangles;
        int numsurfacelist;
        int surfacelistindex;
        int surfaceindex;
        int triangleindex;
-       int decalsurfaceindex;
        int cornerindex;
        int index;
        int numpoints;
@@ -11536,7 +11532,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor
        float localmins[3];
        float localmaxs[3];
        float localsize;
-       float ilocalsize;
        float v[9][3];
        float tc[9][2];
        float c[9][4];
@@ -11572,7 +11567,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor
        Matrix4x4_Transform3x3(&rsurface.inversematrix, worldnormal, localnormal);
        VectorNormalize(localnormal);
        localsize = worldsize*rsurface.inversematrixscale;
-       ilocalsize = 1.0f / localsize;
        localmins[0] = localorigin[0] - localsize;
        localmins[1] = localorigin[1] - localsize;
        localmins[2] = localorigin[2] - localsize;
@@ -11642,8 +11636,6 @@ static void R_DecalSystem_SplatEntity(entity_render_t *ent, const vec3_t worldor
                        continue;
                if (texture->surfaceflags & Q3SURFACEFLAG_NOMARKS)
                        continue;
-               decalsurfaceindex = ent == r_refdef.scene.worldentity ? surfaceindex : -1;
-               numvertices = surface->num_vertices;
                numtriangles = surface->num_triangles;
                for (triangleindex = 0, e = model->surfmesh.data_element3i + 3*surface->num_firsttriangle;triangleindex < numtriangles;triangleindex++, e += 3)
                {
@@ -11858,7 +11850,6 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent)
        decalsystem_t *decalsystem = &ent->decalsystem;
        int numdecals;
        tridecal_t *decal;
-       float fadedelay;
        float faderate;
        float alpha;
        float *v3f;
@@ -11892,7 +11883,6 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent)
        decalsystem->lastupdatetime = cl.time;
        decal = decalsystem->decals;
 
-       fadedelay = cl_decals_time.value;
        faderate = 1.0f / max(0.001f, cl_decals_fadetime.value);
 
        // update vertex positions for animated models
@@ -12038,7 +12028,6 @@ void R_DrawDebugModel(void)
 {
        entity_render_t *ent = rsurface.entity;
        int i, j, k, l, flagsmask;
-       const int *elements;
        q3mbrush_t *brush;
        const msurface_t *surface;
        dp_model_t *model = ent->model;
@@ -12107,7 +12096,6 @@ void R_DrawDebugModel(void)
                                                GL_Color(r_refdef.view.colorscale, r_refdef.view.colorscale, r_refdef.view.colorscale, r_showtris.value);
                                        else
                                                GL_Color(0, r_refdef.view.colorscale, 0, r_showtris.value);
-                                       elements = (model->surfmesh.data_element3i + 3 * surface->num_firsttriangle);
                                        R_Mesh_VertexPointer(rsurface.vertex3f, 0, 0);
                                        R_Mesh_ColorPointer(NULL, 0, 0);
                                        R_Mesh_TexCoordPointer(0, 0, NULL, 0, 0);
@@ -12182,8 +12170,7 @@ int r_maxsurfacelist = 0;
 const msurface_t **r_surfacelist = NULL;
 void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass)
 {
-       int i, j, endj, f, flagsmask;
-       texture_t *t;
+       int i, j, endj, flagsmask;
        dp_model_t *model = r_refdef.scene.worldmodel;
        msurface_t *surfaces;
        unsigned char *update;
@@ -12229,8 +12216,6 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep
                return;
        }
 
-       f = 0;
-       t = NULL;
        rsurface.uselightmaptexture = false;
        rsurface.texture = NULL;
        rsurface.rtlight = NULL;
@@ -12279,8 +12264,7 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep
 
 void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean writedepth, qboolean depthonly, qboolean debug, qboolean prepass)
 {
-       int i, j, endj, f, flagsmask;
-       texture_t *t;
+       int i, j, endj, flagsmask;
        dp_model_t *model = ent->model;
        msurface_t *surfaces;
        unsigned char *update;
@@ -12350,8 +12334,6 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr
                return;
        }
 
-       f = 0;
-       t = NULL;
        rsurface.uselightmaptexture = false;
        rsurface.texture = NULL;
        rsurface.rtlight = NULL;
index 9478d23..2c56c3e 100644 (file)
@@ -1174,7 +1174,6 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
        dp_model_t *model = ent->model;
        const msurface_t *surface;
        int i, k, kend, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex, batchfirsttriangle;
-       qboolean usebufferobject;
        const int *element3i;
        static msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
        static int batchelements[BATCHSIZE*3];
@@ -1240,14 +1239,8 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
                                RSurf_PrepareVerticesForBatch(true, true, 1, &surface);
                                for (m = surface->num_firsttriangle, mend = m + surface->num_triangles;m < mend;m++)
                                {
-                                       if (lighttrispvs && r_test.integer)
-                                       {
-                                               if (!CHECKPVSBIT(lighttrispvs, m))
-                                               {
-                                                       usebufferobject = false;
-                                                       continue;
-                                               }
-                                       }
+                                       if (lighttrispvs && r_test.integer && !CHECKPVSBIT(lighttrispvs, m))
+                                               continue;
                                        if (batchnumtriangles >= BATCHSIZE)
                                        {
                                                r_refdef.stats.lights_lighttriangles += batchnumtriangles;
@@ -1257,7 +1250,6 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, int numsurfaces, const int *surface
                                                        R_Shadow_RenderLighting(batchfirstvertex, batchlastvertex + 1 - batchfirstvertex, batchfirsttriangle, batchnumtriangles, ent->model->surfmesh.data_element3i, ent->model->surfmesh.data_element3s, ent->model->surfmesh.ebo3i, ent->model->surfmesh.ebo3s);
                                                else
                                                        R_Shadow_RenderLighting(batchfirstvertex, batchlastvertex + 1 - batchfirstvertex, 0, batchnumtriangles, batchelements, NULL, 0, 0);
-                                               usebufferobject = true;
                                                batchnumtriangles = 0;
                                                batchfirsttriangle = m;
                                        }
index 65daa7b..52846b2 100644 (file)
@@ -161,7 +161,6 @@ static gltexturepool_t *gltexturepoolchain = NULL;
 static unsigned char *resizebuffer = NULL, *colorconvertbuffer;
 static int resizebuffersize = 0;
 static const unsigned char *texturebuffer;
-static int texturebuffersize = 0;
 
 static textypeinfo_t *R_GetTexTypeInfo(textype_t textype, int flags)
 {
@@ -180,15 +179,11 @@ static textypeinfo_t *R_GetTexTypeInfo(textype_t textype, int flags)
        case TEXTYPE_RGBA:
                if ((flags & TEXF_COMPRESS) && gl_texturecompression.integer >= 1 && vid.support.arb_texture_compression)
                        return (flags & TEXF_ALPHA) ? &textype_rgba_alpha_compress : &textype_rgba_compress;
-               else
-                       return (flags & TEXF_ALPHA) ? &textype_rgba_alpha : &textype_rgba;
-               break;
+               return (flags & TEXF_ALPHA) ? &textype_rgba_alpha : &textype_rgba;
        case TEXTYPE_BGRA:
                if ((flags & TEXF_COMPRESS) && gl_texturecompression.integer >= 1 && vid.support.arb_texture_compression)
                        return (flags & TEXF_ALPHA) ? &textype_bgra_alpha_compress : &textype_bgra_compress;
-               else
-                       return (flags & TEXF_ALPHA) ? &textype_bgra_alpha : &textype_bgra;
-               break;
+               return (flags & TEXF_ALPHA) ? &textype_bgra_alpha : &textype_bgra;
        case TEXTYPE_ALPHA:
                return &textype_alpha;
        case TEXTYPE_SHADOWMAP:
@@ -197,9 +192,9 @@ static textypeinfo_t *R_GetTexTypeInfo(textype_t textype, int flags)
                return &textype_colorbuffer;
        default:
                Host_Error("R_GetTexTypeInfo: unknown texture format");
-               return NULL;
+               break;
        }
-       return NULL; // this line only to hush compiler warnings
+       return NULL;
 }
 
 // dynamic texture code [11/22/2007 Black]
@@ -547,7 +542,6 @@ static void r_textures_shutdown(void)
        }
 
        resizebuffersize = 0;
-       texturebuffersize = 0;
        resizebuffer = NULL;
        colorconvertbuffer = NULL;
        texturebuffer = NULL;
@@ -1200,7 +1194,9 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
 
 rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filename, int flags, qboolean *hasalphaflag, float *avgcolor)
 {
-       int i, size, dds_flags, dds_format_flags, dds_miplevels, dds_width, dds_height, textype;
+       int i, size, dds_format_flags, dds_miplevels, dds_width, dds_height;
+       //int dds_flags;
+       textype_t textype;
        int bytesperblock, bytesperpixel;
        int mipcomplete;
        gltexture_t *glt;
@@ -1233,7 +1229,7 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen
                return NULL;
        }
 
-       dds_flags = BuffLittleLong(dds+8);
+       //dds_flags = BuffLittleLong(dds+8);
        dds_format_flags = BuffLittleLong(dds+80);
        dds_miplevels = (BuffLittleLong(dds+108) & 0x400000) ? BuffLittleLong(dds+28) : 1;
        dds_width = BuffLittleLong(dds+16);
diff --git a/host.c b/host.c
index 3c5dfe7..f579dd9 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1006,7 +1006,7 @@ static void Host_Init (void)
        if (COM_CheckParm("-benchmark"))
                srand(0); // predictable random sequence for -benchmark
        else
-               srand(time(NULL));
+               srand((unsigned int)time(NULL));
 
        // FIXME: this is evil, but possibly temporary
        // LordHavoc: doesn't seem very temporary...
diff --git a/image.c b/image.c
index f9cd487..4fccb16 100644 (file)
--- a/image.c
+++ b/image.c
@@ -914,7 +914,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
                f = FS_LoadFile(name, tempmempool, true, &filesize);
                if (f)
                {
-                       data = format->loadfunc(f, filesize);
+                       data = format->loadfunc(f, (int)filesize);
                        Mem_Free(f);
                        if(format->loadfunc == JPEG_LoadImage_BGRA) // jpeg can't do alpha, so let's simulate it by loading another jpeg
                        {
@@ -922,7 +922,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
                                f = FS_LoadFile(name2, tempmempool, true, &filesize);
                                if(f)
                                {
-                                       data2 = format->loadfunc(f, filesize);
+                                       data2 = format->loadfunc(f, (int)filesize);
                                        Mem_Free(f);
                                        Image_CopyAlphaFromBlueBGRA(data, data2, image_width, image_height);
                                        Mem_Free(data2);
@@ -1497,9 +1497,7 @@ void Image_HeightmapToNormalmap_BGRA(const unsigned char *inpixels, unsigned cha
        const unsigned char *b, *row[3];
        int p[5];
        unsigned char *out;
-       float iwidth, iheight, ibumpscale, n[3];
-       iwidth = 1.0f / width;
-       iheight = 1.0f / height;
+       float ibumpscale, n[3];
        ibumpscale = (255.0f * 6.0f) / bumpscale;
        out = outpixels;
        for (y = 0, y1 = height-1;y < height;y1 = y, y++)
diff --git a/lhnet.c b/lhnet.c
index cd60917..5d60a21 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -124,7 +124,7 @@ int LHNETADDRESS_FromPort(lhnetaddress_t *vaddress, lhnetaddresstype_t addressty
        switch(addresstype)
        {
        default:
-               return 0;
+               break;
        case LHNETADDRESSTYPE_LOOP:
                // local:port  (loopback)
                memset(address, 0, sizeof(*address));
diff --git a/menu.c b/menu.c
index 6033cb8..4cc1f19 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -822,7 +822,7 @@ static void M_ScanSaves (void)
        char    buf[SAVEGAME_COMMENT_LENGTH + 256];
        const char *t;
        qfile_t *f;
-       int             version;
+//     int             version;
 
        for (i=0 ; i<MAX_SAVEGAMES ; i++)
        {
@@ -834,11 +834,12 @@ static void M_ScanSaves (void)
                        continue;
                // read enough to get the comment
                len = FS_Read(f, buf, sizeof(buf) - 1);
-               buf[sizeof(buf) - 1] = 0;
+               len = min(len, sizeof(buf)-1);
+               buf[len] = 0;
                t = buf;
                // version
                COM_ParseToken_Simple(&t, false, false);
-               version = atoi(com_token);
+               //version = atoi(com_token);
                // description
                COM_ParseToken_Simple(&t, false, false);
                strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
index 7a2c8d6..fe4793a 100644 (file)
@@ -743,7 +743,7 @@ static void Mod_MDLMD2MD3_TraceBox(dp_model_t *model, const frameblend_t *frameb
        {
                VectorAdd(start, boxmins, shiftstart);
                VectorAdd(end, boxmins, shiftend);
-               Mod_MDLMD2MD3_TraceLine(model, frameblend, skeleton, trace, start, end, hitsupercontentsmask);
+               Mod_MDLMD2MD3_TraceLine(model, frameblend, skeleton, trace, shiftstart, shiftend, hitsupercontentsmask);
                VectorSubtract(trace->endpos, boxmins, trace->endpos);
                return;
        }
@@ -997,7 +997,7 @@ void Mod_IDP0_Load(dp_model_t *mod, void *buffer, void *bufferend)
        loadmodel->numframes = LittleLong(pinmodel->numframes);
        BOUNDI(loadmodel->numframes,0,65536);
        loadmodel->synctype = (synctype_t)LittleLong (pinmodel->synctype);
-       BOUNDI(loadmodel->synctype,0,2);
+       BOUNDI((int)loadmodel->synctype,0,2);
        // convert model flags to EF flags (MF_ROCKET becomes EF_ROCKET, etc)
        i = LittleLong (pinmodel->flags);
        loadmodel->effects = ((i & 255) << 24) | (i & 0x00FFFF00);
@@ -2402,7 +2402,7 @@ void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
        pskmatt_t *matts;
        pskboneinfo_t *bones;
        pskrawweights_t *rawweights;
-       pskboneinfo_t *animbones;
+       //pskboneinfo_t *animbones;
        pskaniminfo_t *anims;
        pskanimkeys_t *animkeys;
        void *animfilebuffer, *animbuffer, *animbufferend;
@@ -2654,7 +2654,7 @@ void Mod_PSKMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend)
                                Host_Error("%s: %s has unsupported recordsize", animname, pchunk->id);
                        // byteswap in place and keep the pointer
                        numanimbones = numrecords;
-                       animbones = (pskboneinfo_t *)animbuffer;
+                       //animbones = (pskboneinfo_t *)animbuffer;
                        // NOTE: supposedly psa does not need to match the psk model, the
                        // bones missing from the psa would simply use their base
                        // positions from the psk, but this is hard for me to implement
index 8e830b0..8aa9c06 100644 (file)
@@ -3402,7 +3402,6 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
        int i, j, k;
        dheader_t *header;
        dmodel_t *bm;
-       mempool_t *mainmempool;
        float dist, modelyawradius, modelradius;
        msurface_t *surface;
        int numshadowmeshtriangles;
@@ -3532,8 +3531,6 @@ void Mod_Q1BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
        mod->numframes = 2;             // regular and alternate animation
        mod->numskins = 1;
 
-       mainmempool = mod->mempool;
-
        // make a single combined shadow mesh to allow optimized shadow volume creation
        numshadowmeshtriangles = 0;
        for (j = 0, surface = loadmodel->data_surfaces;j < loadmodel->num_surfaces;j++, surface++)
@@ -4502,7 +4499,7 @@ static void Mod_Q3BSP_LoadTriangles(lump_t *l)
 static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump)
 {
        q3dlightmap_t *input_pointer;
-       int i, j, k, count, power, power2, mask, endlightmap, mergewidth, mergeheight;
+       int i, j, k, count, power, power2, endlightmap, mergewidth, mergeheight;
        unsigned char *c;
 
        unsigned char *convertedpixels;
@@ -4670,7 +4667,6 @@ static void Mod_Q3BSP_LoadLightmaps(lump_t *l, lump_t *faceslump)
 
        power = loadmodel->brushq3.num_lightmapmergepower;
        power2 = power * 2;
-       mask = (1 << power) - 1;
        for (i = 0;i < count;i++)
        {
                // figure out which merged lightmap texture this fits into
@@ -6676,7 +6672,7 @@ void Mod_OBJ_Load(dp_model_t *mod, void *buffer, void *bufferend)
        {
                VectorCopy(vertexhashdata[j].v, loadmodel->surfmesh.data_vertex3f + 3*j);
                VectorCopy(vertexhashdata[j].vn, loadmodel->surfmesh.data_normal3f + 3*j);
-               VectorCopy(vertexhashdata[j].vt, loadmodel->surfmesh.data_texcoordtexture2f + 2*j);
+               Vector2Copy(vertexhashdata[j].vt, loadmodel->surfmesh.data_texcoordtexture2f + 2*j);
        }
 
        // load the textures
index e1d86cb..45fd314 100644 (file)
@@ -2693,7 +2693,6 @@ static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int first
                        outbufferpos += l;
                for (transformindex = 0;transformindex < model->num_bones;transformindex++)
                {
-                       float a, b, c;
                        float angles[3];
                        float mtest[4][3];
                        matrix4x4_t posematrix;
@@ -2715,12 +2714,11 @@ static void Mod_Decompile_SMD(dp_model_t *model, const char *filename, int first
                        if (angles[1] >= 180) angles[1] -= 360;
                        if (angles[2] >= 180) angles[2] -= 360;
 
-                       a = DEG2RAD(angles[ROLL]);
-                       b = DEG2RAD(angles[PITCH]);
-                       c = DEG2RAD(angles[YAW]);
-
 #if 0
 {
+                       float a = DEG2RAD(angles[ROLL]);
+                       float b = DEG2RAD(angles[PITCH]);
+                       float c = DEG2RAD(angles[YAW]);
                        float cy, sy, cp, sp, cr, sr;
                        float test[4][3];
                        // smd matrix construction, for comparing
@@ -3622,7 +3620,7 @@ static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model)
        float lm_basescalepixels;
        int lm_borderpixels;
        int lm_texturesize;
-       int lm_maxpixels;
+       //int lm_maxpixels;
        const int *e;
        lightmaptriangle_t *triangle;
        unsigned char *lightmappixels;
@@ -3635,7 +3633,7 @@ static void Mod_GenerateLightmaps_CreateLightmaps(dp_model_t *model)
        lm_basescalepixels = 1.0f / max(0.0001f, mod_generatelightmaps_unitspersample.value);
        lm_borderpixels = mod_generatelightmaps_borderpixels.integer;
        lm_texturesize = bound(lm_borderpixels*2+1, 64, (int)vid.maxtexturesize_2d);
-       lm_maxpixels = lm_texturesize-(lm_borderpixels*2+1);
+       //lm_maxpixels = lm_texturesize-(lm_borderpixels*2+1);
        Mod_AllocLightmap_Init(&lmstate, lm_texturesize, lm_texturesize);
        lightmapnumber = 0;
        for (surfaceindex = 0;surfaceindex < model->num_surfaces;surfaceindex++)
index 98d1367..eb605a1 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -1094,7 +1094,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, unsigned char *data, int len
                int sequence, sequence_ack;
                int reliable_ack, reliable_message;
                int count;
-               int qport;
+               //int qport;
 
                sequence = LittleLong(*((int *)(data + 0)));
                sequence_ack = LittleLong(*((int *)(data + 4)));
@@ -1107,7 +1107,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, unsigned char *data, int len
                        if (length < 2)
                                return 0;
                        // TODO: use qport to identify that this client really is who they say they are?  (and elsewhere in the code to identify the connection without a port match?)
-                       qport = LittleShort(*((int *)(data + 8)));
+                       //qport = LittleShort(*((int *)(data + 8)));
                        data += 2;
                        length -= 2;
                }
@@ -1601,9 +1601,10 @@ static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
 
                if (length > 10 && !memcmp(string, "challenge ", 10) && cls.rcon_trying)
                {
-                       int i, j;
+                       int i = 0, j;
                        for (j = 0;j < MAX_RCONS;j++)
                        {
+                               // note: this value from i is used outside the loop too...
                                i = (cls.rcon_ringpos + j) % MAX_RCONS;
                                if(cls.rcon_commands[i][0])
                                        if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
@@ -1623,24 +1624,26 @@ static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *dat
 
                                if(HMAC_MDFOUR_16BYTES((unsigned char *) (buf + 29), (unsigned char *) argbuf, strlen(argbuf), (unsigned char *) rcon_password.string, n))
                                {
+                                       int k;
                                        buf[45] = ' ';
                                        strlcpy(buf + 46, argbuf, sizeof(buf) - 46);
                                        NetConn_Write(mysocket, buf, 46 + strlen(buf + 46), peeraddress);
                                        cls.rcon_commands[i][0] = 0;
                                        --cls.rcon_trying;
 
-                                       for (i = 0;i < MAX_RCONS;i++)
-                                               if(cls.rcon_commands[i][0])
-                                                       if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
+                                       for (k = 0;k < MAX_RCONS;k++)
+                                               if(cls.rcon_commands[k][0])
+                                                       if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[k]))
                                                                break;
-                                       if(i < MAX_RCONS)
+                                       if(k < MAX_RCONS)
                                        {
+                                               int l;
                                                NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", peeraddress);
                                                // extend the timeout on other requests as we asked for a challenge
-                                               for (i = 0;i < MAX_RCONS;i++)
-                                                       if(cls.rcon_commands[i][0])
-                                                               if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i]))
-                                                                       cls.rcon_timeout[i] = realtime + rcon_secure_challengetimeout.value;
+                                               for (l = 0;l < MAX_RCONS;l++)
+                                                       if(cls.rcon_commands[l][0])
+                                                               if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[l]))
+                                                                       cls.rcon_timeout[l] = realtime + rcon_secure_challengetimeout.value;
                                        }
 
                                        return true; // we used up the challenge, so we can't use this oen for connecting now anyway
index b4c5ecb..5f1d5e4 100644 (file)
@@ -305,14 +305,12 @@ static void EntityFrameCSQC_LostAllFrames(client_t *client)
 void EntityFrameCSQC_LostFrame(client_t *client, int framenum)
 {
        // marks a frame as lost
-       int i, j, n;
+       int i, j;
        qboolean valid;
        int ringfirst, ringlast;
        static int recoversendflags[MAX_EDICTS];
        csqcentityframedb_t *d;
 
-       n = client->csqcnumedicts;
-
        // is our frame out of history?
        ringfirst = client->csqcentityframehistory_next; // oldest entry
        ringlast = (ringfirst + NUM_CSQCENTITYDB_FRAMES - 1) % NUM_CSQCENTITYDB_FRAMES; // most recently added entry
@@ -2036,7 +2034,7 @@ static void EntityFrame5_ExpandEdicts(entityframe5_database_t *d, int newmax)
 static int EntityState5_Priority(entityframe5_database_t *d, int stateindex)
 {
        int limit, priority;
-       entity_state_t *s;
+       entity_state_t *s = NULL; // hush compiler warning by initializing this
        // if it is the player, update urgently
        if (stateindex == d->viewentnum)
                return ENTITYFRAME5_PRIORITYLEVELS - 1;
index f91d44f..48184e5 100644 (file)
@@ -3346,7 +3346,7 @@ void VM_drawcolorcodedstring(void)
 {
        float *pos,*scale;
        const char  *string;
-       int flag,color;
+       int flag;
        float sx, sy;
        VM_SAFEPARMCOUNT(5,VM_drawstring);
 
@@ -3372,7 +3372,6 @@ void VM_drawcolorcodedstring(void)
        if(pos[2] || scale[2])
                Con_Printf("VM_drawcolorcodedstring: z value%s from %s discarded\n",(pos[2] && scale[2]) ? "s" : " ",((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
 
-       color = -1;
        getdrawfontscale(&sx, &sy);
        DrawQ_String_Scale(pos[0], pos[1], string, 0, scale[0], scale[1], sx, sy, 1, 1, 1, PRVM_G_FLOAT(OFS_PARM3), flag, NULL, false, getdrawfont());
        PRVM_G_FLOAT(OFS_RETURN) = 1;
@@ -4346,18 +4345,16 @@ string  altstr_ins(string altstr, float num, string set)
 void VM_altstr_ins(void)
 {
        int num;
-       const char *setstr;
        const char *set;
-       const char *instr;
        const char *in;
        char *out;
        char outstr[VM_STRINGTEMP_LENGTH];
 
        VM_SAFEPARMCOUNT(3, VM_altstr_ins);
 
-       in = instr = PRVM_G_STRING( OFS_PARM0 );
+       in = PRVM_G_STRING( OFS_PARM0 );
        num = (int)PRVM_G_FLOAT( OFS_PARM1 );
-       set = setstr = PRVM_G_STRING( OFS_PARM2 );
+       set = PRVM_G_STRING( OFS_PARM2 );
 
        out = outstr;
        for( num = num * 2 + 2 ; *in && num > 0 ; *out++ = *in++ )
@@ -5732,7 +5729,6 @@ void VM_sprintf(void)
                {
                        case 0:
                                goto finished;
-                               break;
                        case '%':
                                ++s;