diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 1172ab41..37bc21ff 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -1304,7 +1304,6 @@ static void Cmd_UnprivilegedExec_f( void ) "scout.cfg", "sniper.cfg", "soldier.cfg", "spy.cfg", }; char mapcfg[MAX_VA_STRING]; - qboolean allow = false; Q_snprintf( mapcfg, sizeof( mapcfg ), "%s.cfg", clgame.mapname ); diff --git a/engine/common/imagelib/img_dds.c b/engine/common/imagelib/img_dds.c index 3d4ba7ae..1e6e714d 100644 --- a/engine/common/imagelib/img_dds.c +++ b/engine/common/imagelib/img_dds.c @@ -95,7 +95,7 @@ static qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin ) static qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin ) { - uint bits, bitmask; + uint bits; byte *alphamask; int x, y, i, j; @@ -108,8 +108,6 @@ static qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin ) alphamask = fin + 2; fin += 8; - - bitmask = ((uint *)fin)[1]; fin += 8; // last three bytes @@ -278,9 +276,6 @@ static size_t Image_DXTCalcMipmapSize( dds_t *hdr ) static uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize ) { size_t buffsize = 0; - int w = image.width; - int h = image.height; - int d = image.depth; if( hdr->dsCaps.dwCaps2 & DDS_CUBEMAP ) { diff --git a/engine/common/infostring.c b/engine/common/infostring.c index 4d03f357..4882a7e2 100644 --- a/engine/common/infostring.c +++ b/engine/common/infostring.c @@ -364,7 +364,7 @@ static char *Info_FindLargestKey( char *s ) char value[MAX_KV_SIZE]; static char largest_key[128]; int largest_size = 0; - int l, count; + int count; char *o; *largest_key = 0; @@ -384,7 +384,6 @@ static char *Info_FindLargestKey( char *s ) count++; } - l = o - key; *o = 0; size = Q_strlen( key ); diff --git a/engine/common/lib_common.c b/engine/common/lib_common.c index 073d0d4a..6e6fc4a0 100644 --- a/engine/common/lib_common.c +++ b/engine/common/lib_common.c @@ -40,18 +40,15 @@ void COM_PushLibraryError( const char *error ) void *COM_FunctionFromName_SR( void *hInstance, const char *pName ) { - char **funcs = NULL; - size_t numfuncs, i; - void *f = NULL; - const char *func = NULL; - #ifdef XASH_ALLOW_SAVERESTORE_OFFSETS if( !memcmp( pName, "ofs:", 4 )) return (byte*)svgame.dllFuncs.pfnGameInit + Q_atoi( pName + 4 ); #endif #if XASH_POSIX - funcs = COM_ConvertToLocalPlatform( MANGLE_ITANIUM, pName, &numfuncs ); + size_t numfuncs, i; + void *f = NULL; + char **funcs = COM_ConvertToLocalPlatform( MANGLE_ITANIUM, pName, &numfuncs ); if( funcs ) { @@ -69,7 +66,7 @@ void *COM_FunctionFromName_SR( void *hInstance, const char *pName ) // TODO: COM_ConvertToLocalPlatform doesn't support MSVC yet // also custom loader strips always MSVC mangling, so Win32 // platforms already use platform-neutral names - func = COM_GetPlatformNeutralName( pName ); + const char *func = COM_GetPlatformNeutralName( pName ); if( func ) return COM_FunctionFromName( hInstance, func ); diff --git a/engine/common/mod_studio.c b/engine/common/mod_studio.c index e848ee09..e3f4269d 100644 --- a/engine/common/mod_studio.c +++ b/engine/common/mod_studio.c @@ -862,7 +862,6 @@ static void Mod_StudioComputeBounds( void *buffer, vec3_t mins, vec3_t maxs, qbo studiohdr_t *pstudiohdr; mstudiobodyparts_t *pbodypart; mstudiomodel_t *m_pSubModel; - mstudioseqgroup_t *pseqgroup; mstudioseqdesc_t *pseqdesc; mstudiobone_t *pbones; mstudioanim_t *panim; @@ -902,7 +901,6 @@ static void Mod_StudioComputeBounds( void *buffer, vec3_t mins, vec3_t maxs, qbo for( i = 0; i < numseq; i++ ) { pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + i; - pseqgroup = (mstudioseqgroup_t *)((byte *)pstudiohdr + pstudiohdr->seqgroupindex) + pseqdesc->seqgroup; if( pseqdesc->seqgroup == 0 ) panim = (mstudioanim_t *)((byte *)pstudiohdr + pseqdesc->animindex); diff --git a/engine/common/net_chan.c b/engine/common/net_chan.c index fcff5bdb..248d8acd 100644 --- a/engine/common/net_chan.c +++ b/engine/common/net_chan.c @@ -1809,7 +1809,7 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg ) int frag_offset[MAX_STREAMS] = { 0, 0 }; int frag_length[MAX_STREAMS] = { 0, 0 }; qboolean message_contains_fragments; - int i, qport, statId; + int i, statId; // get sequence numbers MSG_Clear( msg ); @@ -1821,7 +1821,7 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg ) // read the qport if we are a server if( chan->sock == NS_SERVER ) - qport = MSG_ReadShort( msg ); + MSG_ReadShort( msg ); reliable_message = sequence >> 31; reliable_ack = sequence_ack >> 31; @@ -1925,7 +1925,7 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg ) { for( i = 0; i < MAX_STREAMS; i++ ) { - int j, inbufferid; + int j; int intotalbuffers; int oldpos, curbit; int numbitstoremove; @@ -1934,7 +1934,6 @@ qboolean Netchan_Process( netchan_t *chan, sizebuf_t *msg ) if( !frag_message[i] ) continue; - inbufferid = FRAG_GETID( fragid[i] ); intotalbuffers = FRAG_GETCOUNT( fragid[i] ); if( fragid[i] != 0 ) diff --git a/engine/common/sounds.c b/engine/common/sounds.c index 9f6a5925..a9532ce9 100644 --- a/engine/common/sounds.c +++ b/engine/common/sounds.c @@ -91,7 +91,14 @@ const char *SoundList_Get( enum soundlst_group_e group, int i ) switch( lst->type ) { case SoundList_Range: +#if __GNUC__ || __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" +#endif Q_snprintf( temp, sizeof( temp ), lst->snd, lst->min + i ); +#if __GNUC__ || __clang__ +#pragma GCC diagnostic pop +#endif return temp; case SoundList_List: return &lst->snd[i * lst->min];