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
+6 -4
View File
@@ -488,7 +488,8 @@ Optimized version of pointfile - use beams instead of particles
*/
void CL_ReadLineFile_f( void )
{
char *afile, *pfile;
byte *afile;
char *pfile;
vec3_t p1, p2;
int count, modelIndex;
char filename[MAX_QPATH];
@@ -507,7 +508,7 @@ void CL_ReadLineFile_f( void )
Con_Printf( "Reading %s...\n", filename );
count = 0;
pfile = afile;
pfile = (char *)afile;
model = CL_LoadModel( DEFAULT_LASERBEAM_PATH, &modelIndex );
while( 1 )
@@ -1995,7 +1996,8 @@ CL_ReadPointFile_f
*/
void CL_ReadPointFile_f( void )
{
char *afile, *pfile;
byte *afile;
char *pfile;
vec3_t org;
int count;
particle_t *p;
@@ -2014,7 +2016,7 @@ void CL_ReadPointFile_f( void )
Con_Printf( "Reading %s...\n", filename );
count = 0;
pfile = afile;
pfile = (char *)afile;
while( 1 )
{
+6 -4
View File
@@ -217,7 +217,8 @@ Initialize CD playlist
*/
void CL_InitCDAudio( const char *filename )
{
char *afile, *pfile;
byte *afile;
char *pfile;
string token;
int c = 0;
@@ -230,7 +231,7 @@ void CL_InitCDAudio( const char *filename )
afile = FS_LoadFile( filename, NULL, false );
if( !afile ) return;
pfile = afile;
pfile = (char *)afile;
// format: trackname\n [num]
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
@@ -1516,7 +1517,8 @@ static client_sprite_t *pfnSPR_GetList( char *psz, int *piCount )
{
cached_spritelist_t *pEntry = &clgame.sprlist[0];
int slot, index, numSprites = 0;
char *afile, *pfile;
byte *afile;
char *pfile;
string token;
if( piCount ) *piCount = 0;
@@ -1547,7 +1549,7 @@ static client_sprite_t *pfnSPR_GetList( char *psz, int *piCount )
afile = FS_LoadFile( psz, NULL, false );
if( !afile ) return NULL;
pfile = afile;
pfile = (char *)afile;
pfile = COM_ParseFile( pfile, token );
numSprites = Q_atoi( token );
+1 -1
View File
@@ -2164,7 +2164,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
else if( clgame.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 );
}
+8 -2
View File
@@ -528,6 +528,9 @@ void CL_BatchResourceRequest( qboolean initialize )
break;
CL_MoveToOnHandList( p );
break;
case t_world:
ASSERT( 0 );
break;
}
}
@@ -586,7 +589,10 @@ int CL_EstimateNeededResources( void )
nTotalSize += p->nDownloadSize;
}
break;
}
case t_world:
ASSERT( 0 );
break;
}
}
return nTotalSize;
@@ -1511,7 +1517,7 @@ void CL_RegisterResources( sizebuf_t *msg )
model_t *mod;
int i;
if( cls.dl.custom || cls.signon == SIGNONS && cls.state == ca_active )
if( cls.dl.custom || ( cls.signon == SIGNONS && cls.state == ca_active ) )
{
cls.dl.custom = false;
return;
+3 -2
View File
@@ -84,7 +84,8 @@ void SCR_CreateStartupVids( void )
void SCR_CheckStartupVids( void )
{
int c = 0;
char *afile, *pfile;
byte *afile;
char *pfile;
string token;
if( Sys_CheckParm( "-nointro" ) || host_developer.value || cls.demonum != -1 || GameState->nextstate != STATE_RUNFRAME )
@@ -101,7 +102,7 @@ void SCR_CheckStartupVids( void )
afile = FS_LoadFile( DEFAULT_VIDEOLIST_PATH, NULL, false );
if( !afile ) return; // something bad happens
pfile = afile;
pfile = (char *)afile;
while(( pfile = COM_ParseFile( pfile, token )) != NULL )
{
+3 -3
View File
@@ -407,7 +407,7 @@ Appends a given string as a new line to the console.
*/
void Con_AddLine( const char *line, int length, qboolean newline )
{
byte *putpos;
char *putpos;
con_lineinfo_t *p;
if( !con.initialized || !con.buffer )
@@ -1094,8 +1094,8 @@ int Con_DrawString( int x, int y, const char *string, rgba_t setColor )
void Con_LoadHistory( void )
{
const char *aFile = FS_LoadFile( "console_history.txt", NULL, true );
const char *pLine = aFile, *pFile = aFile;
const byte *aFile = FS_LoadFile( "console_history.txt", NULL, true );
const char *pLine = (char *)aFile, *pFile = (char *)aFile;
int i;
if( !aFile )
+3 -3
View File
@@ -42,7 +42,7 @@ int S_ZeroCrossingBefore( wavdata_t *pWaveData, int sample )
if( pWaveData->width == 1 )
{
char *pData = pWaveData->buffer + sample * sampleSize;
signed char *pData = (signed char *)(pWaveData->buffer + sample * sampleSize);
qboolean zero = false;
if( pWaveData->channels == 1 )
@@ -139,7 +139,7 @@ int S_ZeroCrossingAfter( wavdata_t *pWaveData, int sample )
if( pWaveData->width == 1 ) // 8-bit
{
char *pData = pWaveData->buffer + sample * sampleSize;
signed char *pData = (signed char *)(pWaveData->buffer + sample * sampleSize);
qboolean zero = false;
if( pWaveData->channels == 1 )
@@ -303,4 +303,4 @@ void S_SetSampleEnd( channel_t *pChan, wavdata_t *pSource, int newEndPosition )
newEndPosition = pChan->pMixer.sample;
pChan->pMixer.forcedEndSample = newEndPosition;
}
}