]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix most compiler warnings.
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 May 2020 16:41:59 +0000 (16:41 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 26 May 2020 16:41:59 +0000 (16:41 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12592 d7cf8633-e32d-0410-b094-e92efae38249

client.h
gl_rmain.c
host_cmd.c
image.c
model_shared.c
r_shadow.c
svvm_cmds.c
taskqueue.c
vid_sdl.c

index b1dbac0e0c6d64b4b99f9bec616c8d6189a40f22..435299c4d64f32353cee87cc35a43c79e3cc6c59 100644 (file)
--- a/client.h
+++ b/client.h
@@ -2042,6 +2042,9 @@ void V_FadeViewFlashs(void);
 void V_CalcViewBlend(void);
 void V_CalcRefdefUsing (const matrix4x4_t *entrendermatrix, const vec3_t clviewangles, qboolean teleported, qboolean clonground, qboolean clcmdjump, float clstatsviewheight, qboolean cldead, qboolean clintermission, const vec3_t clvelocity);
 void V_CalcRefdef(void);
+void V_MakeViewIsometric(void);
+void V_MakeViewIsometric(void);
+void V_StartPitchDrift(void);
 void CL_Locs_Reload_f(cmd_state_t *cmd);
 
 #endif
index 7929d2f74cdb82afc56dc511d7bb484b2f77dc7d..157d6eb8e03cd028894eb85557ae759005395904 100644 (file)
@@ -3989,12 +3989,14 @@ void R_AnimCache_CacheVisibleEntities(void)
 
 qboolean R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t entboxexpand, vec_t pad, vec3_t eye, vec3_t entboxmins, vec3_t entboxmaxs)
 {
-       int i;
+       long unsigned int i;
+       int j;
        vec3_t eyemins, eyemaxs;
        vec3_t boxmins, boxmaxs;
        vec3_t padmins, padmaxs;
        vec3_t start;
        vec3_t end;
+       trace_t trace;
        dp_model_t *model = r_refdef.scene.worldmodel;
        static vec3_t positions[] = {
                { 0.5f, 0.5f, 0.5f },
@@ -4055,7 +4057,7 @@ qboolean R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t
                        end[1] = boxmins[1] + (boxmaxs[1] - boxmins[1]) * positions[i][1];
                        end[2] = boxmins[2] + (boxmaxs[2] - boxmins[2]) * positions[i][2];
                        //trace_t trace = CL_TraceLine(start, end, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID, SUPERCONTENTS_SKY, MATERIALFLAGMASK_TRANSLUCENT, 0.0f, true, false, NULL, true, true);
-                       trace_t trace = CL_Cache_TraceLineSurfaces(start, end, MOVE_NORMAL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT);
+                       trace = CL_Cache_TraceLineSurfaces(start, end, MOVE_NORMAL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT);
                        // not picky - if the trace ended anywhere in the box we're good
                        if (BoxesOverlap(trace.endpos, trace.endpos, padmins, padmaxs))
                                return true;
@@ -4065,7 +4067,7 @@ qboolean R_CanSeeBox(int numsamples, vec_t eyejitter, vec_t entboxenlarge, vec_t
                return true;
 
        // try various random positions
-       for (i = 0; i < numsamples; i++)
+       for (j = 0; j < numsamples; j++)
        {
                VectorSet(start, lhrandom(eyemins[0], eyemaxs[0]), lhrandom(eyemins[1], eyemaxs[1]), lhrandom(eyemins[2], eyemaxs[2]));
                VectorSet(end, lhrandom(boxmins[0], boxmaxs[0]), lhrandom(boxmins[1], boxmaxs[1]), lhrandom(boxmins[2], boxmaxs[2]));
index ab42967319f237f8c740b8f2fc51c70c50a83266..b095d181f087f551358a6d8ce3ba3895b8f351cb 100644 (file)
@@ -2923,7 +2923,7 @@ Host_Pings_f
 Send back ping and packet loss update for all current players to this player
 ====================
 */
-void Host_Pings_f(cmd_state_t *cmd)
+static void Host_Pings_f(cmd_state_t *cmd)
 {
        int             i, j, ping, packetloss, movementloss;
        char temp[128];
diff --git a/image.c b/image.c
index 93d7d89b463815cca1be8966a6c6f170da827c1a..37da0efa4b237ee16511cb39f608b7d697470370 100644 (file)
--- a/image.c
+++ b/image.c
@@ -878,7 +878,7 @@ static unsigned char* LoadLMP_BGRA(const unsigned char *f, int filesize, int *mi
 }
 
 // gfx/conchars is a raw 128x128 image with 0 as transparent color rather than 255
-unsigned char *LoadConChars_BGRA(const unsigned char *f, int filesize, int *miplevel)
+static unsigned char *LoadConChars_BGRA(const unsigned char *f, int filesize, int *miplevel)
 {
        unsigned char *image_buffer;
        int i;
@@ -1044,6 +1044,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
 {
        fs_offset_t filesize;
        imageformat_t *firstformat, *format;
+       int mymiplevel;
        unsigned char *f, *data = NULL, *data2 = NULL;
        char basename[MAX_QPATH], name[MAX_QPATH], name2[MAX_QPATH], path[MAX_QPATH], afterpath[MAX_QPATH], *c;
        char vabuf[1024];
@@ -1086,7 +1087,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
                f = FS_LoadFile(name, tempmempool, true, &filesize);
                if (f)
                {
-                       int mymiplevel = miplevel ? *miplevel : 0;
+                       mymiplevel = miplevel ? *miplevel : 0;
                        image_width = 0;
                        image_height = 0;
                        data = format->loadfunc(f, (int)filesize, &mymiplevel);
@@ -1152,7 +1153,7 @@ unsigned char *loadimagepixelsbgra (const char *filename, qboolean complain, qbo
                        if (developer_loading.integer)
                                Con_Printf("loading gfx.wad lump \"%s\"\n", afterpath);
 
-                       int mymiplevel = miplevel ? *miplevel : 0;
+                       mymiplevel = miplevel ? *miplevel : 0;
                        if (!strcmp(afterpath, "conchars"))
                        {
                                // conchars is a raw image and with color 0 as transparent instead of 255
index b650c44813258709aa0a47adfc0e64b4d9400290..19bbbc0a3735e5c04d75a01b459fd1a47ab0a1e2 100644 (file)
@@ -2652,7 +2652,7 @@ void Mod_LoadCustomMaterial(mempool_t *mempool, texture_t *texture, const char *
 
 void Mod_UnloadCustomMaterial(texture_t *texture, qboolean purgeskins)
 {
-       int i, j;
+       long unsigned int i, j;
        for (i = 0; i < sizeof(texture->shaderpasses) / sizeof(texture->shaderpasses[0]); i++)
        {
                if (texture->shaderpasses[i])
@@ -4603,7 +4603,7 @@ static void Mod_Mesh_MakeSortedSurfaces(dp_model_t *mod)
        }
 }
 
-void Mod_Mesh_ComputeBounds(dp_model_t *mod)
+static void Mod_Mesh_ComputeBounds(dp_model_t *mod)
 {
        int i;
        vec_t x2a, x2b, y2a, y2b, z2a, z2b, x2, y2, z2, yawradius, rotatedradius;
@@ -4683,7 +4683,7 @@ void Mod_Mesh_Validate(dp_model_t *mod)
        }
 }
 
-void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod)
+static void Mod_Mesh_UploadDynamicBuffers(dp_model_t *mod)
 {
        mod->surfmesh.data_element3s_indexbuffer = mod->surfmesh.data_element3s ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(short[3]), mod->surfmesh.data_element3s, R_BUFFERDATA_INDEX16, &mod->surfmesh.data_element3s_bufferoffset) : NULL;
        mod->surfmesh.data_element3i_indexbuffer = mod->surfmesh.data_element3i ? R_BufferData_Store(mod->surfmesh.num_triangles * sizeof(int[3]), mod->surfmesh.data_element3i, R_BUFFERDATA_INDEX32, &mod->surfmesh.data_element3i_bufferoffset) : NULL;
index e3999f24d60e905d9733be87185d2effba2cff6f..75a856198f663a806a122510fd400c7b5fd42daf 100644 (file)
@@ -1550,7 +1550,7 @@ static void R_Shadow_SetShadowmapParametersForLight(qboolean noselfshadowpass)
 
 static void R_Shadow_RenderMode_ShadowMap(int side, int size, int x, int y)
 {
-       float nearclip, farclip, bias;
+       float nearclip, farclip;
        r_viewport_t viewport;
        int flipped;
 
@@ -1572,7 +1572,6 @@ static void R_Shadow_RenderMode_ShadowMap(int side, int size, int x, int y)
 
        nearclip = r_shadow_shadowmapping_nearclip.value / rsurface.rtlight->radius;
        farclip = 1.0f;
-       bias = r_shadow_shadowmapping_bias.value * nearclip * (1024.0f / size);// * rsurface.rtlight->radius;
 
        R_Viewport_InitRectSideView(&viewport, &rsurface.rtlight->matrix_lighttoworld, side, size, r_shadow_shadowmapborder, nearclip, farclip, NULL, x, y);
        R_SetViewport(&viewport);
@@ -2600,7 +2599,7 @@ static void R_Shadow_BounceGrid_ConvertPixelsAndUpload(void)
        r_shadow_bouncegrid_state.lastupdatetime = realtime;
 }
 
-void R_Shadow_BounceGrid_ClearTex_Task(taskqueue_task_t *t)
+static void R_Shadow_BounceGrid_ClearTex_Task(taskqueue_task_t *t)
 {
        memset(r_shadow_bouncegrid_state.highpixels, 0, r_shadow_bouncegrid_state.numpixels * sizeof(float[4]));
        t->done = 1;
@@ -3875,8 +3874,6 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
        int numlightentities_noselfshadow;
        entity_render_t **lightentities;
        entity_render_t **lightentities_noselfshadow;
-       entity_render_t **shadowentities;
-       entity_render_t **shadowentities_noselfshadow;
        int *surfacelist;
        qboolean castshadows;
 
@@ -3897,8 +3894,6 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
        numsurfaces = rtlight->cached_numsurfaces;
        lightentities = rtlight->cached_lightentities;
        lightentities_noselfshadow = rtlight->cached_lightentities_noselfshadow;
-       shadowentities = rtlight->cached_shadowentities;
-       shadowentities_noselfshadow = rtlight->cached_shadowentities_noselfshadow;
        lighttrispvs = rtlight->cached_lighttrispvs;
        surfacelist = rtlight->cached_surfacelist;
        castshadows = rtlight->castshadows;
@@ -3921,14 +3916,9 @@ static void R_Shadow_DrawLight(rtlight_t *rtlight)
 
        if (castshadows && r_shadow_shadowmode == R_SHADOW_SHADOWMODE_SHADOWMAP2D)
        {
-               float borderbias;
-               int size;
                matrix4x4_t radiustolight = rtlight->matrix_worldtolight;
                Matrix4x4_Abs(&radiustolight);
 
-               size = rtlight->shadowmapatlassidesize;
-               borderbias = r_shadow_shadowmapborder / (float)(size - r_shadow_shadowmapborder);
-
                //Con_Printf("distance %f lodlinear %i size %i\n", distance, lodlinear, size);
 
                // render lighting using the depth texture as shadowmap
@@ -4057,7 +4047,7 @@ void R_Shadow_DrawPrepass(void)
 }
 
 #define MAX_SCENELIGHTS 65536
-qboolean R_Shadow_PrepareLights_AddSceneLight(rtlight_t *rtlight)
+static qboolean R_Shadow_PrepareLights_AddSceneLight(rtlight_t *rtlight)
 {
        if (r_shadow_scenemaxlights <= r_shadow_scenenumlights)
        {
index 5b99fc904d4bc992335128f46b9895dcb42f092f..015c6b9da48e3037361106dca32cccdf23712da9 100644 (file)
@@ -1717,13 +1717,13 @@ static void VM_SV_AddStat(prvm_prog_t *prog)
 
        if (i >= MAX_CL_STATS)
        {
-               VM_Warning(prog, "PF_SV_AddStat: index (%i) >= MAX_CL_STATS (%i), not supported by protocol, and AddStat beyond MAX_VM_STAT conflicts with engine MOVEVARS\n", i, MAX_CL_STATS, MAX_VM_STAT);
+               VM_Warning(prog, "PF_SV_AddStat: index (%i) >= MAX_CL_STATS (%i), not supported by protocol, and AddStat beyond MAX_VM_STAT (%i) conflicts with engine MOVEVARS\n", i, MAX_CL_STATS, MAX_VM_STAT);
                return;
        }
 
        if (i > (MAX_CL_STATS - 4) && type == 1)
        {
-               VM_Warning(prog, "PF_SV_AddStat: index (%i) > (MAX_CL_STATS-4) with string type won't fit in the protocol, and AddStat beyond MAX_VM_STAT conflicts with engine MOVEVARS\n", i, MAX_CL_STATS);
+               VM_Warning(prog, "PF_SV_AddStat: index (%i) > (MAX_CL_STATS (%i) - 4) with string type won't fit in the protocol, and AddStat beyond MAX_VM_STAT conflicts with engine MOVEVARS\n", i, MAX_CL_STATS);
                return;
        }
 
index b43f8d46cce25a89ed97ddd8db8a408b0e171807..0004e49eb7ede11ca524b0708039ec902a7cf572 100644 (file)
@@ -141,7 +141,7 @@ qboolean TaskQueue_IsDone(taskqueue_task_t *t)
        return !t->done != 0;
 }
 
-void TaskQueue_DistributeTasks(void)
+static void TaskQueue_DistributeTasks(void)
 {
        Thread_AtomicLock(&taskqueue_state.command_lock);
        if (taskqueue_state.numthreads > 0)
index 3db8b2b97582cc3eaefd35bb2011216b06d81ceb..0b37e274a28fdfdfd60bfb9cd6c01052f96c1e26 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -1459,6 +1459,12 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect)
 }
 #endif
 
+extern cvar_t gl_info_vendor;
+extern cvar_t gl_info_renderer;
+extern cvar_t gl_info_version;
+extern cvar_t gl_info_platform;
+extern cvar_t gl_info_driver;
+
 static qboolean VID_InitModeGL(viddef_mode_t *mode)
 {
        int windowflags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL;
@@ -1577,11 +1583,6 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        GL_Setup();
 
        // VorteX: set other info
-       extern cvar_t gl_info_vendor;
-       extern cvar_t gl_info_renderer;
-       extern cvar_t gl_info_version;
-       extern cvar_t gl_info_platform;
-       extern cvar_t gl_info_driver;
        Cvar_SetQuick(&gl_info_vendor, gl_vendor);
        Cvar_SetQuick(&gl_info_renderer, gl_renderer);
        Cvar_SetQuick(&gl_info_version, gl_version);