From 06a1f39d438e5bed9d3ddf46828990dbd9f06fb7 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Tue, 25 Jul 2023 15:08:00 +0100 Subject: [PATCH] Fix misc gcc warnings. --- Quake/cl_parse.c | 1 - Quake/gl_draw.c | 4 ++-- Quake/gl_mesh.c | 2 +- Quake/gl_model.c | 2 -- Quake/gl_texmgr.c | 4 ++++ Quake/pr_ext.c | 4 ++-- Quake/r_brush.c | 2 +- Quake/r_world.c | 5 ----- 8 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index ee0f9ae9..ca5d003b 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -557,7 +557,6 @@ static void CL_EntitiesDeltaed(void) qmodel_t *model; qboolean forcelink; entity_t *ent; - int skin; for (newnum = 1; newnum < cl.num_entities; newnum++) { diff --git a/Quake/gl_draw.c b/Quake/gl_draw.c index 812b2431..392d9f50 100644 --- a/Quake/gl_draw.c +++ b/Quake/gl_draw.c @@ -707,8 +707,8 @@ Only used for the player color selection menu */ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, plcolour_t top, plcolour_t bottom) { - static plcolour_t oldtop = {-2}; - static plcolour_t oldbottom = {-2}; + static plcolour_t oldtop = {{-2}}; + static plcolour_t oldbottom = {{-2}}; if (!CL_PLColours_Equals(top, oldtop) || !CL_PLColours_Equals(bottom, oldbottom)) { diff --git a/Quake/gl_mesh.c b/Quake/gl_mesh.c index fe247d12..5d485091 100644 --- a/Quake/gl_mesh.c +++ b/Quake/gl_mesh.c @@ -628,7 +628,7 @@ void Mod_LoadMD3Model (qmodel_t *mod, void *buffer) for (numskinfiles = 0; numskinfiles < countof(skinfile); numskinfiles++) { //q3 doesn't really support multiple skins any other way. plus this lets us fix up some texture paths... - skinfile[numskinfiles] = COM_LoadMallocFile(va("%s_%i.skin", diskname, numskinfiles), NULL); + skinfile[numskinfiles] = (char*)COM_LoadMallocFile(va("%s_%i.skin", diskname, numskinfiles), NULL); if (!skinfile[numskinfiles]) break; } diff --git a/Quake/gl_model.c b/Quake/gl_model.c index 6838b64f..cc053018 100644 --- a/Quake/gl_model.c +++ b/Quake/gl_model.c @@ -343,7 +343,6 @@ static qmodel_t *Mod_LoadModel (qmodel_t *mod, qboolean crash) byte *buf; byte stackbuf[1024]; // avoid dirtying the cache heap int mod_type; - int i; if (!mod->needload) { @@ -759,7 +758,6 @@ static void Mod_LoadTextures (lump_t *l) int mark, fwidth, fheight; char filename[MAX_OSPATH], mapname[MAX_OSPATH]; byte *data; - extern byte *hunk_base; //johnfitz qboolean malloced; //spike enum srcformat fmt; //spike diff --git a/Quake/gl_texmgr.c b/Quake/gl_texmgr.c index cf1b86b7..2208c6ea 100644 --- a/Quake/gl_texmgr.c +++ b/Quake/gl_texmgr.c @@ -76,6 +76,10 @@ static struct {"RGBA4444", "4444", GL_RGBA4,GL_RGBA,GL_UNSIGNED_SHORT_4_4_4_4, 2, 1, 1, NULL}, {"RGBA5551", "5551", GL_RGB5_A1,GL_RGBA,GL_UNSIGNED_SHORT_5_5_5_1, 2, 1, 1, NULL}, {"L8", "LUM8", GL_LUMINANCE8,GL_LUMINANCE,GL_UNSIGNED_BYTE, 1, 1, 1, NULL}, +#ifndef GL_VERSION_3_0 + #define GL_RGB9_E5 0x8C3D + #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#endif {"E5BGR9", "EXP5", GL_RGB9_E5,GL_RGB,GL_UNSIGNED_INT_5_9_9_9_REV, 4, 1, 1, &gl_texture_e5bgr9}, #if defined(GL_EXT_texture_compression_s3tc) || defined(GL_EXT_texture_compression_dxt1) {"BC1_RGBA", "BC1", GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,0,0, 8, 4, 4, &gl_texture_s3tc}, diff --git a/Quake/pr_ext.c b/Quake/pr_ext.c index 39fba44b..fa616abb 100644 --- a/Quake/pr_ext.c +++ b/Quake/pr_ext.c @@ -8485,7 +8485,7 @@ void PF_Fixme (void) PR_RunError ("PF_Fixme: not a builtin..."); } -static void PF_Fixme_noext (void) +/*static void PF_Fixme_noext (void) { //interrogate the vm to try to figure out exactly which builtin they just tried to execute. dstatement_t *st = &qcvm->statements[qcvm->xstatement]; @@ -8499,7 +8499,7 @@ static void PF_Fixme_noext (void) PR_RunError ("unimplemented builtin #%i - %s", binum, funcname); } PR_RunError ("PF_Fixme: not a builtin..."); -} +}*/ //called at map end diff --git a/Quake/r_brush.c b/Quake/r_brush.c index 95e82c83..45455c78 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -819,7 +819,7 @@ static void BuildSurfaceDisplayList (msurface_t *fa) int i, lindex, lnumverts; medge_t *pedges, *r_pedge; float *vec; - float s, t, s0, t0, sdiv, tdiv; + float s, t, s0, t0; glpoly_t *poly; int lmscale = (1<lmshift); diff --git a/Quake/r_world.c b/Quake/r_world.c index 0906ed6a..00266074 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -710,15 +710,10 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain glpoly_t *p; qboolean bound; float entalpha; - qboolean has_lit_water; - qboolean has_unlit_water; if (r_drawflat_cheatsafe || r_lightmap_cheatsafe) // ericw -- !r_drawworld_cheatsafe check moved to R_DrawWorld_Water () return; - has_lit_water = false; - has_unlit_water = false; - if (gl_glsl_water_able) { int lastlightmap = -2;