Browse Source

Fix some warnings yet.

halloween
Night Owl 7 years ago
parent
commit
d1fbb99574
  1. 2
      cl_dll/cl_util.h
  2. 10
      cl_dll/hud_spectator.cpp
  3. 4
      cl_dll/hud_spectator.h
  4. 4
      dlls/client.cpp
  5. 2
      dlls/doors.cpp
  6. 2
      dlls/multiplay_gamerules.cpp
  7. 20
      dlls/nihilanth.cpp
  8. 52
      engine/cdll_int.h

2
cl_dll/cl_util.h

@ -144,7 +144,7 @@ inline void CenterPrint( const char *string )
#define GetPlayerInfo ( *gEngfuncs.pfnGetPlayerInfo ) #define GetPlayerInfo ( *gEngfuncs.pfnGetPlayerInfo )
// sound functions // sound functions
inline void PlaySound( char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); } inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); }
inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); } inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); }
#define max(a, b) (((a) > (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b))

10
cl_dll/hud_spectator.cpp

@ -175,13 +175,13 @@ void UTIL_StringToVector( float * pVector, const char *pString )
} }
} }
int UTIL_FindEntityInMap( char * name, float * origin, float * angle ) int UTIL_FindEntityInMap( const char *name, float *origin, float *angle )
{ {
int n, found = 0; int n, found = 0;
char keyname[256]; char keyname[256];
char token[2048]; char token[2048];
cl_entity_t * pEnt = gEngfuncs.GetEntityByIndex( 0 ); // get world model cl_entity_t *pEnt = gEngfuncs.GetEntityByIndex( 0 ); // get world model
if( !pEnt ) if( !pEnt )
return 0; return 0;
@ -189,7 +189,7 @@ int UTIL_FindEntityInMap( char * name, float * origin, float * angle )
if( !pEnt->model ) if( !pEnt->model )
return 0; return 0;
char * data = pEnt->model->entities; char *data = pEnt->model->entities;
while( data ) while( data )
{ {
@ -1374,12 +1374,12 @@ void CHudSpectator::DeathMessage( int victim )
AddOverviewEntityToList(m_hsprPlayerDead, pl, gEngfuncs.GetClientTime() + 2.0f ); AddOverviewEntityToList(m_hsprPlayerDead, pl, gEngfuncs.GetClientTime() + 2.0f );
} }
bool CHudSpectator::AddOverviewEntityToList(HSPRITE sprite, cl_entity_t *ent, double killTime) bool CHudSpectator::AddOverviewEntityToList( HSPRITE sprite, cl_entity_t *ent, double killTime )
{ {
for( int i = 0; i < MAX_OVERVIEW_ENTITIES; i++ ) for( int i = 0; i < MAX_OVERVIEW_ENTITIES; i++ )
{ {
// find empty entity slot // find empty entity slot
if( m_OverviewEntities[i].entity == NULL) if( m_OverviewEntities[i].entity == NULL )
{ {
m_OverviewEntities[i].entity = ent; m_OverviewEntities[i].entity = ent;
m_OverviewEntities[i].hSprite = sprite; m_OverviewEntities[i].hSprite = sprite;

4
cl_dll/hud_spectator.h

@ -64,11 +64,11 @@ public:
void CheckOverviewEntities(); void CheckOverviewEntities();
void DrawOverview(); void DrawOverview();
void DrawOverviewEntities(); void DrawOverviewEntities();
void GetMapPosition( float * returnvec ); void GetMapPosition( float *returnvec );
void DrawOverviewLayer(); void DrawOverviewLayer();
void LoadMapSprites(); void LoadMapSprites();
bool ParseOverviewFile(); bool ParseOverviewFile();
bool IsActivePlayer( cl_entity_t * ent ); bool IsActivePlayer( cl_entity_t *ent );
void SetModes( int iMainMode, int iInsetMode ); void SetModes( int iMainMode, int iInsetMode );
void HandleButtonsDown( int ButtonPressed ); void HandleButtonsDown( int ButtonPressed );
void HandleButtonsUp( int ButtonPressed ); void HandleButtonsUp( int ButtonPressed );

4
dlls/client.cpp

@ -566,7 +566,7 @@ void ClientCommand( edict_t *pEntity )
// notify other clients of player switching to spectator mode // notify other clients of player switching to spectator mode
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s switched to spectator mode\n", UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s switched to spectator mode\n",
( pev->netname && STRING(pev->netname)[0] != 0 ) ? STRING(pev->netname) : "unconnected" ) ); ( pev->netname && ( STRING( pev->netname ) )[0] != 0 ) ? STRING( pev->netname ) : "unconnected" ) );
} }
else else
ClientPrint( pev, HUD_PRINTCONSOLE, "Spectator mode is disabled.\n" ); ClientPrint( pev, HUD_PRINTCONSOLE, "Spectator mode is disabled.\n" );
@ -629,7 +629,7 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
return; return;
// msg everyone if someone changes their name, and it isn't the first time (changing no name to current name) // msg everyone if someone changes their name, and it isn't the first time (changing no name to current name)
if( pEntity->v.netname && STRING( pEntity->v.netname )[0] != 0 && !FStrEq( STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ) ) if( pEntity->v.netname && ( STRING( pEntity->v.netname ) )[0] != 0 && !FStrEq( STRING( pEntity->v.netname ), g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ) ) )
{ {
char sName[256]; char sName[256];
char *pName = g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ); char *pName = g_engfuncs.pfnInfoKeyValue( infobuffer, "name" );

2
dlls/doors.cpp

@ -397,7 +397,7 @@ void CBaseDoor::Precache( void )
pszSound = "doors/doorstop5.wav"; pszSound = "doors/doorstop5.wav";
break; break;
case 6: case 6:
pszSound = "doors/doorstop6.wav" pszSound = "doors/doorstop6.wav";
break; break;
case 7: case 7:
pszSound = "doors/doorstop7.wav"; pszSound = "doors/doorstop7.wav";

2
dlls/multiplay_gamerules.cpp

@ -423,7 +423,7 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl )
{ {
// notify other clients of player joining the game // notify other clients of player joining the game
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has joined the game\n", UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has joined the game\n",
( pl->pev->netname && STRING( pl->pev->netname )[0] != 0 ) ? STRING( pl->pev->netname ) : "unconnected" ) ); ( pl->pev->netname && ( STRING( pl->pev->netname ) )[0] != 0 ) ? STRING( pl->pev->netname ) : "unconnected" ) );
// team match? // team match?
if( g_teamplay ) if( g_teamplay )

20
dlls/nihilanth.cpp

@ -642,14 +642,14 @@ void CNihilanth::MakeFriend( Vector vecStart )
for( i = 0; i < 3; i++ ) for( i = 0; i < 3; i++ )
{ {
if( m_hFriend[i] != NULL && !m_hFriend[i]->IsAlive() ) if( m_hFriend[i] != 0 && !m_hFriend[i]->IsAlive() )
{ {
if( pev->rendermode == kRenderNormal ) // don't do it if they are already fading if( pev->rendermode == kRenderNormal ) // don't do it if they are already fading
m_hFriend[i]->MyMonsterPointer()->FadeMonster(); m_hFriend[i]->MyMonsterPointer()->FadeMonster();
m_hFriend[i] = NULL; m_hFriend[i] = NULL;
} }
if( m_hFriend[i] == NULL ) if( m_hFriend[i] == 0 )
{ {
if( RANDOM_LONG( 0, 1 ) == 0 ) if( RANDOM_LONG( 0, 1 ) == 0 )
{ {
@ -675,7 +675,7 @@ void CNihilanth::MakeFriend( Vector vecStart )
m_hFriend[i] = Create( "monster_alien_slave", node.m_vecOrigin, pev->angles ); m_hFriend[i] = Create( "monster_alien_slave", node.m_vecOrigin, pev->angles );
} }
} }
if( m_hFriend[i] != NULL ) if( m_hFriend[i] != 0 )
{ {
EMIT_SOUND( m_hFriend[i]->edict(), CHAN_WEAPON, "debris/beamstart7.wav", 1.0, ATTN_NORM ); EMIT_SOUND( m_hFriend[i]->edict(), CHAN_WEAPON, "debris/beamstart7.wav", 1.0, ATTN_NORM );
} }
@ -722,7 +722,7 @@ void CNihilanth::NextActivity()
} }
} }
if( ( pev->health < gSkillData.nihilanthHealth / 2 || m_iActiveSpheres < N_SPHERES / 2 ) && m_hRecharger == NULL && m_iLevel <= 9 ) if( ( pev->health < gSkillData.nihilanthHealth / 2 || m_iActiveSpheres < N_SPHERES / 2 ) && m_hRecharger == 0 && m_iLevel <= 9 )
{ {
char szName[64]; char szName[64];
@ -881,7 +881,7 @@ void CNihilanth::HuntThink( void )
} }
// look for current enemy // look for current enemy
if( m_hEnemy != 0 && m_hRecharger == NULL ) if( m_hEnemy != 0 && m_hRecharger == 0 )
{ {
if( FVisible( m_hEnemy ) ) if( FVisible( m_hEnemy ) )
{ {
@ -1057,7 +1057,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent )
break; break;
case 2: case 2:
// zen // zen
if( m_hEnemy != NULL ) if( m_hEnemy != 0 )
{ {
if( RANDOM_LONG( 0, 4 ) == 0 ) if( RANDOM_LONG( 0, 4 ) == 0 )
EMIT_SOUND( edict(), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, 0.2 ); EMIT_SOUND( edict(), CHAN_VOICE, RANDOM_SOUND_ARRAY( pAttackSounds ), 1.0, 0.2 );
@ -1098,7 +1098,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent )
break; break;
case 3: case 3:
// prayer // prayer
if (m_hEnemy != NULL) if( m_hEnemy != 0 )
{ {
char szText[32]; char szText[32];
@ -1178,7 +1178,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent )
} }
break; break;
case 6: case 6:
if( m_hEnemy != NULL ) if( m_hEnemy != 0 )
{ {
Vector vecSrc, vecAngles; Vector vecSrc, vecAngles;
GetAttachment( 2, vecSrc, vecAngles ); GetAttachment( 2, vecSrc, vecAngles );
@ -1208,7 +1208,7 @@ void CNihilanth::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_
CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, m_szDeadTouch ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, m_szDeadTouch );
if( pTouch ) if( pTouch )
{ {
if( m_hEnemy != NULL ) if( m_hEnemy != 0 )
{ {
pTouch->Touch( m_hEnemy ); pTouch->Touch( m_hEnemy );
} }
@ -1597,7 +1597,7 @@ void CNihilanthHVR::TeleportThink( void )
if( m_hTargetEnt != 0 ) if( m_hTargetEnt != 0 )
m_hTargetEnt->Use( m_hEnemy, m_hEnemy, USE_ON, 1.0 ); m_hTargetEnt->Use( m_hEnemy, m_hEnemy, USE_ON, 1.0 );
if( m_hTouch != 0 && m_hEnemy != NULL ) if( m_hTouch != 0 && m_hEnemy != 0 )
m_hTouch->Touch( m_hEnemy ); m_hTouch->Touch( m_hEnemy );
} }
else else

52
engine/cdll_int.h

@ -128,7 +128,7 @@ typedef struct cl_enginefuncs_s
void (*pfnSPR_DrawAdditive)( int frame, int x, int y, const wrect_t *prc ); void (*pfnSPR_DrawAdditive)( int frame, int x, int y, const wrect_t *prc );
void (*pfnSPR_EnableScissor)( int x, int y, int width, int height ); void (*pfnSPR_EnableScissor)( int x, int y, int width, int height );
void (*pfnSPR_DisableScissor)( void ); void (*pfnSPR_DisableScissor)( void );
client_sprite_t *(*pfnSPR_GetList)( char *psz, int *piCount ); client_sprite_t *(*pfnSPR_GetList)( const char *psz, int *piCount );
// screen handlers // screen handlers
void (*pfnFillRGBA)( int x, int y, int width, int height, int r, int g, int b, int a ); void (*pfnFillRGBA)( int x, int y, int width, int height, int r, int g, int b, int a );
@ -136,20 +136,20 @@ typedef struct cl_enginefuncs_s
void (*pfnSetCrosshair)( HSPRITE hspr, wrect_t rc, int r, int g, int b ); void (*pfnSetCrosshair)( HSPRITE hspr, wrect_t rc, int r, int g, int b );
// cvar handlers // cvar handlers
struct cvar_s *(*pfnRegisterVariable)( char *szName, char *szValue, int flags ); struct cvar_s *(*pfnRegisterVariable)( const char *szName, const char *szValue, int flags );
float (*pfnGetCvarFloat)( char *szName ); float (*pfnGetCvarFloat)( const char *szName );
char* (*pfnGetCvarString)( char *szName ); char* (*pfnGetCvarString)( const char *szName );
// command handlers // command handlers
int (*pfnAddCommand)( char *cmd_name, void (*function)(void) ); int (*pfnAddCommand)( const char *cmd_name, void (*function)(void) );
int (*pfnHookUserMsg)( char *szMsgName, pfnUserMsgHook pfn ); int (*pfnHookUserMsg)( const char *szMsgName, pfnUserMsgHook pfn );
int (*pfnServerCmd)( char *szCmdString ); int (*pfnServerCmd)( const char *szCmdString );
int (*pfnClientCmd)( char *szCmdString ); int (*pfnClientCmd)( const char *szCmdString );
void (*pfnGetPlayerInfo)( int ent_num, hud_player_info_t *pinfo ); void (*pfnGetPlayerInfo)( int ent_num, hud_player_info_t *pinfo );
// sound handlers // sound handlers
void (*pfnPlaySoundByName)( char *szSound, float volume ); void (*pfnPlaySoundByName)( const char *szSound, float volume );
void (*pfnPlaySoundByIndex)( int iSound, float volume ); void (*pfnPlaySoundByIndex)( int iSound, float volume );
// vector helpers // vector helpers
@ -158,7 +158,7 @@ typedef struct cl_enginefuncs_s
// text message system // text message system
client_textmessage_t *(*pfnTextMessageGet)( const char *pName ); client_textmessage_t *(*pfnTextMessageGet)( const char *pName );
int (*pfnDrawCharacter)( int x, int y, int number, int r, int g, int b ); int (*pfnDrawCharacter)( int x, int y, int number, int r, int g, int b );
int (*pfnDrawConsoleString)( int x, int y, char *string ); int (*pfnDrawConsoleString)( int x, int y, const char *string );
void (*pfnDrawSetTextColor)( float r, float g, float b ); void (*pfnDrawSetTextColor)( float r, float g, float b );
void (*pfnDrawConsoleStringLen)( const char *string, int *length, int *height ); void (*pfnDrawConsoleStringLen)( const char *string, int *length, int *height );
@ -171,19 +171,19 @@ typedef struct cl_enginefuncs_s
void (*GetViewAngles)( float * ); void (*GetViewAngles)( float * );
void (*SetViewAngles)( float * ); void (*SetViewAngles)( float * );
int (*GetMaxClients)( void ); int (*GetMaxClients)( void );
void (*Cvar_SetValue)( char *cvar, float value ); void (*Cvar_SetValue)( const char *cvar, float value );
int (*Cmd_Argc)( void ); int (*Cmd_Argc)( void );
char *(*Cmd_Argv)( int arg ); char *(*Cmd_Argv)( int arg );
void (*Con_Printf)( char *fmt, ... ); void (*Con_Printf)( const char *fmt, ... );
void (*Con_DPrintf)( char *fmt, ... ); void (*Con_DPrintf)( const char *fmt, ... );
void (*Con_NPrintf)( int pos, char *fmt, ... ); void (*Con_NPrintf)( int pos, const char *fmt, ... );
void (*Con_NXPrintf)( struct con_nprint_s *info, char *fmt, ... ); void (*Con_NXPrintf)( struct con_nprint_s *info, const char *fmt, ... );
const char* (*PhysInfo_ValueForKey)( const char *key ); const char* (*PhysInfo_ValueForKey)( const char *key );
const char* (*ServerInfo_ValueForKey)( const char *key ); const char* (*ServerInfo_ValueForKey)( const char *key );
float (*GetClientMaxspeed)( void ); float (*GetClientMaxspeed)( void );
int (*CheckParm)( char *parm, char **ppnext ); int (*CheckParm)( const char *parm, const char **ppnext );
void (*Key_Event)( int key, int down ); void (*Key_Event)( int key, int down );
void (*GetMousePosition)( int *mx, int *my ); void (*GetMousePosition)( int *mx, int *my );
@ -212,7 +212,7 @@ typedef struct cl_enginefuncs_s
void (*pfnWeaponAnim)( int iAnim, int body ); void (*pfnWeaponAnim)( int iAnim, int body );
float (*pfnRandomFloat)( float flLow, float flHigh ); float (*pfnRandomFloat)( float flLow, float flHigh );
int (*pfnRandomLong)( int lLow, int lHigh ); int (*pfnRandomLong)( int lLow, int lHigh );
void (*pfnHookEvent)( char *name, void ( *pfnEvent )( struct event_args_s *args )); void (*pfnHookEvent)( const char *name, void ( *pfnEvent )( struct event_args_s *args ));
int (*Con_IsVisible) (); int (*Con_IsVisible) ();
const char *(*pfnGetGameDirectory)( void ); const char *(*pfnGetGameDirectory)( void );
struct cvar_s *(*pfnGetCvarPointer)( const char *szName ); struct cvar_s *(*pfnGetCvarPointer)( const char *szName );
@ -223,8 +223,8 @@ typedef struct cl_enginefuncs_s
void* (*VGui_GetPanel)( ); void* (*VGui_GetPanel)( );
void (*VGui_ViewportPaintBackground)( int extents[4] ); void (*VGui_ViewportPaintBackground)( int extents[4] );
byte* (*COM_LoadFile)( char *path, int usehunk, int *pLength ); byte* (*COM_LoadFile)( const char *path, int usehunk, int *pLength );
char* (*COM_ParseFile)( char *data, char *token ); char* (*COM_ParseFile)( const char *data, const char *token );
void (*COM_FreeFile)( void *buffer ); void (*COM_FreeFile)( void *buffer );
struct triangleapi_s *pTriAPI; struct triangleapi_s *pTriAPI;
@ -252,7 +252,7 @@ typedef struct cl_enginefuncs_s
// Gets a unique ID for the specified player. This is the same even if you see the player on a different server. // Gets a unique ID for the specified player. This is the same even if you see the player on a different server.
// iPlayer is an entity index, so client 0 would use iPlayer=1. // iPlayer is an entity index, so client 0 would use iPlayer=1.
// Returns false if there is no player on the server in the specified slot. // Returns false if there is no player on the server in the specified slot.
qboolean (*GetPlayerUniqueID)(int iPlayer, char playerID[16]); qboolean (*GetPlayerUniqueID)(int iPlayer, const char playerID[16]);
// TrackerID access // TrackerID access
int (*GetTrackerIDForPlayer)(int playerSlot); int (*GetTrackerIDForPlayer)(int playerSlot);
@ -260,7 +260,7 @@ typedef struct cl_enginefuncs_s
// Same as pfnServerCmd, but the message goes in the unreliable stream so it can't clog the net stream // Same as pfnServerCmd, but the message goes in the unreliable stream so it can't clog the net stream
// (but it might not get there). // (but it might not get there).
int ( *pfnServerCmdUnreliable )( char *szCmdString ); int ( *pfnServerCmdUnreliable )( const char *szCmdString );
void (*pfnGetMousePos)( struct tagPOINT *ppt ); void (*pfnGetMousePos)( struct tagPOINT *ppt );
void (*pfnSetMousePos)( int x, int y ); void (*pfnSetMousePos)( int x, int y );
@ -285,12 +285,12 @@ typedef struct cl_enginefuncs_s
const char *(*LocalPlayerInfo_ValueForKey)( const char* key ); const char *(*LocalPlayerInfo_ValueForKey)( const char* key );
int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font ); int (*pfnVGUI2DrawCharacter)( int x, int y, int ch, unsigned int font );
int (*pfnVGUI2DrawCharacterAdditive)( int x, int y, int ch, int r, int g, int b, unsigned int font ); int (*pfnVGUI2DrawCharacterAdditive)( int x, int y, int ch, int r, int g, int b, unsigned int font );
unsigned int (*pfnGetApproxWavePlayLen)( char *filename ); unsigned int (*pfnGetApproxWavePlayLen)( const char *filename );
void* (*GetCareerGameUI)( void ); // g-cont. !!!! potential crash-point! void* (*GetCareerGameUI)( void ); // g-cont. !!!! potential crash-point!
void (*Cvar_Set)( char *name, char *value ); void (*Cvar_Set)( const char *name, const char *value );
int (*pfnIsPlayingCareerMatch)( void ); int (*pfnIsPlayingCareerMatch)( void );
void (*pfnPlaySoundVoiceByName)( char *szSound, float volume, int pitch ); void (*pfnPlaySoundVoiceByName)( const char *szSound, float volume, int pitch );
void (*pfnPrimeMusicStream)( char *filename, int looping ); void (*pfnPrimeMusicStream)( const char *filename, int looping );
double (*pfnSys_FloatTime)( void ); double (*pfnSys_FloatTime)( void );
// decay funcs // decay funcs
@ -298,7 +298,7 @@ typedef struct cl_enginefuncs_s
void (*pfnConstructTutorMessageDecayBuffer)( int *buffer, int buflen ); void (*pfnConstructTutorMessageDecayBuffer)( int *buffer, int buflen );
void (*pfnResetTutorMessageDecayData)( void ); void (*pfnResetTutorMessageDecayData)( void );
void (*pfnPlaySoundByNameAtPitch)( char *szSound, float volume, int pitch ); void (*pfnPlaySoundByNameAtPitch)( const char *szSound, float volume, int pitch );
void (*pfnFillRGBABlend)( int x, int y, int width, int height, int r, int g, int b, int a ); void (*pfnFillRGBABlend)( int x, int y, int width, int height, int r, int g, int b, int a );
int (*pfnGetAppID)( void ); int (*pfnGetAppID)( void );
cmdalias_t *(*pfnGetAliases)( void ); cmdalias_t *(*pfnGetAliases)( void );

Loading…
Cancel
Save