engine: fix various compiler warnings

This commit is contained in:
Alibek Omarov
2019-07-13 23:25:03 +03:00
parent a0cbac4fc7
commit 4beba75159
30 changed files with 130 additions and 134 deletions

View File

@@ -672,7 +672,7 @@ const char *SV_GetClientIDString( sv_client_t *cl )
}
else
{
Q_snprintf( result, sizeof( result ), "ID_%s", MD5_Print( cl->hashedcdkey ));
Q_snprintf( result, sizeof( result ), "ID_%s", MD5_Print( (byte *)cl->hashedcdkey ));
}
return result;
@@ -1138,7 +1138,7 @@ void SV_FullClientUpdate( sv_client_t *cl, sizebuf_t *msg )
MSG_WriteString( msg, info );
MD5Init( &ctx );
MD5Update( &ctx, cl->hashedcdkey, sizeof( cl->hashedcdkey ));
MD5Update( &ctx, (byte *)cl->hashedcdkey, sizeof( cl->hashedcdkey ));
MD5Final( digest, &ctx );
MSG_WriteBytes( msg, digest, sizeof( digest ));
@@ -2227,7 +2227,7 @@ void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
else if( svgame.dllFuncs.pfnConnectionlessPacket( &from, args, buf, &len ))
{
// user out of band message (must be handled in CL_ConnectionlessPacket)
if( len > 0 ) Netchan_OutOfBand( NS_SERVER, from, len, buf );
if( len > 0 ) Netchan_OutOfBand( NS_SERVER, from, len, (byte*)buf );
}
else Con_DPrintf( S_ERROR "bad connectionless packet from %s:\n%s\n", NET_AdrToString( from ), args );
}

View File

@@ -855,7 +855,7 @@ static char *SV_ReadEntityScript( const char *filename, int *flags )
if( ft2 != -1 && ft1 < ft2 )
{
// grab .ent files only from gamedir
ents = FS_LoadFile( entfilename, NULL, true );
ents = (char *)FS_LoadFile( entfilename, NULL, true );
}
// at least entities should contain "{ "classname" "worldspawn" }\0"
@@ -1271,7 +1271,7 @@ int pfnPrecacheModel( const char *s )
if( *s == '!' )
{
optional = true;
*s++;
s++;
}
if(( i = SV_ModelIndex( s )) == 0 )
@@ -1570,6 +1570,9 @@ edict_t *SV_FindEntityByString( edict_t *pStartEdict, const char *pszField, cons
return ed;
}
break;
default:
ASSERT( 0 );
break;
}
}

View File

@@ -276,12 +276,13 @@ model_t *SV_ModelHandle( int modelindex )
void SV_ReadResourceList( const char *filename )
{
string token;
char *afile, *pfile;
byte *afile;
char *pfile;
afile = FS_LoadFile( filename, NULL, false );
if( !afile ) return;
pfile = afile;
pfile = (char *)afile;
Con_DPrintf( "Precaching from %s\n", filename );
Con_DPrintf( "----------------------------------\n" );