From be58a0c4da3bbf4671a4825ea88cb94689e2a2c5 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Wed, 19 Sep 2018 04:03:31 +0500 Subject: [PATCH] Fix warnings. --- cl_dll/hs/timer.cpp | 11 +++++------ cl_dll/hud_redraw.cpp | 2 +- dlls/client.cpp | 2 +- dlls/effects.cpp | 4 ++-- dlls/ggrenade.cpp | 2 +- dlls/hs/bot.cpp | 16 ++++++++-------- dlls/hs/bot.h | 4 ++-- dlls/hs/bot_combat.cpp | 6 +++--- dlls/hs/grinman.cpp | 8 ++++---- dlls/hs/monhunt_gamerules.cpp | 20 ++++++++++---------- engine/eiface.h | 6 +++--- 11 files changed, 40 insertions(+), 41 deletions(-) diff --git a/cl_dll/hs/timer.cpp b/cl_dll/hs/timer.cpp index 636e8d66..2aa8d0a9 100644 --- a/cl_dll/hs/timer.cpp +++ b/cl_dll/hs/timer.cpp @@ -60,8 +60,7 @@ int CHudTimer::Draw( float flTime ) } if (smbSoundCounter == 5) //Note: the counter will still continue until 120 seconds turns into 119. { - char * songchoice = "media/hurryup.mp3"; - gEngfuncs.pfnPrimeMusicStream( songchoice, 0 ); + gEngfuncs.pfnPrimeMusicStream( "media/hurryup.mp3", 0 ); //gMP3.PlayMP3NL( songchoice ); } //Draw BG @@ -80,10 +79,10 @@ int CHudTimer::Draw( float flTime ) } - if (smbSoundCounter >= 0 && g_iRoundtime > 120) //If server manually changed the round time or new round, Reset the sound timer. - { - smbSoundCounter = 0; - } + if (smbSoundCounter >= 0 && g_iRoundtime > 120) //If server manually changed the round time or new round, Reset the sound timer. + { + smbSoundCounter = 0; + } return 1; } diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 0370b27e..df5c81bf 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -98,7 +98,7 @@ int CHud::Redraw( float flTime, int intermission ) int ranmus; ranmus = gEngfuncs.pfnRandomLong( 0, 9 ); - char *songchoice; + const char *songchoice; switch( ranmus ) { diff --git a/dlls/client.cpp b/dlls/client.cpp index 5842123a..ef6b464d 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -446,7 +446,7 @@ void Host_Say( edict_t *pEntity, int teamonly ) time_t tTime = time( 0 ); struct tm *stTimeNow = localtime( &tTime ); - char *dd = "AM"; + const char *dd = "AM"; if( stTimeNow->tm_hour > 11 ) { diff --git a/dlls/effects.cpp b/dlls/effects.cpp index be70fb0e..62efc908 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -2297,7 +2297,7 @@ void CEnvELight::SendData( void ) { edict_t *pTarget = NULL; - if( pev->target != NULL ) + if( pev->target != 0 ) { pTarget = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( pev->target ) ); m_fParentedElight = TRUE; @@ -2333,7 +2333,7 @@ void CEnvELight::SendData( void ) } MESSAGE_END(); - if( m_iParentEntindex == NULL && m_fParentedElight ) + if( m_iParentEntindex == 0 && m_fParentedElight ) m_iParentEntindex = ( ENTINDEX( pTarget ) + 0x1000 * pev->impulse ); m_fNotReloaded = TRUE; diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index 309877ac..0ded9bdf 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -639,7 +639,7 @@ CGrenade *CGrenade::ShootJihad( entvars_t *pevOwner, Vector vecStart, Vector vec pGrenade->pev->velocity = Vector( 0, 0, 0 ); } - pGrenade->pev->sequence = 0.01; + pGrenade->pev->sequence = 0; pGrenade->pev->framerate = 1.0; // Tumble through the air diff --git a/dlls/hs/bot.cpp b/dlls/hs/bot.cpp index c3dd2ff0..b8860460 100644 --- a/dlls/hs/bot.cpp +++ b/dlls/hs/bot.cpp @@ -68,12 +68,12 @@ BOOL skin_used[MAX_SKINS] = { FALSE, FALSE, FALSE, FALSE, FALSE}; // store the names of the models... -char *bot_skins[MAX_SKINS] = { +const char *bot_skins[MAX_SKINS] = { "barney", "jamison", "gman", "gordon", "eva01", "hgrunt", "haruhi", "robo", "scientist", "vader"}; // store the player names for each of the models... -char *bot_names[MAX_SKINS] = { +const char *bot_names[MAX_SKINS] = { "Barney", "Jamison_Trumpets", "G-Man", "Gordon", "Evangelion01", "H-Grunt", "Haruhi", "Robo", "Scientist", "DarthVader"}; @@ -87,9 +87,9 @@ float pause_time[5][2] = { extern ammo_check_t ammo_check[]; // sounds for TakeDamage speaking effects... -char hgrunt_sounds[][30] = { HG_SND1, HG_SND2, HG_SND3, HG_SND4, HG_SND5 }; -char barney_sounds[][30] = { BA_SND1, BA_SND2, BA_SND3, BA_SND4, BA_SND5 }; -char scientist_sounds[][30] = { SC_SND1, SC_SND2, SC_SND3, SC_SND4, SC_SND5 }; +const char *hgrunt_sounds[] = { HG_SND1, HG_SND2, HG_SND3, HG_SND4, HG_SND5 }; +const char *barney_sounds[] = { BA_SND1, BA_SND2, BA_SND3, BA_SND4, BA_SND5 }; +const char *scientist_sounds[] = { SC_SND1, SC_SND2, SC_SND3, SC_SND4, SC_SND5 }; LINK_ENTITY_TO_CLASS( bot, CBot ); @@ -105,13 +105,13 @@ inline char *GET_INFOBUFFER( edict_t *e ) return (*g_engfuncs.pfnGetInfoKeyBuffer)( e ); } -inline char *GET_INFO_KEY_VALUE( char *infobuffer, char *key ) +inline char *GET_INFO_KEY_VALUE( const char *infobuffer, const char *key ) { return (g_engfuncs.pfnInfoKeyValue( infobuffer, key )); } -inline void SET_CLIENT_KEY_VALUE( int clientIndex, char *infobuffer, - char *key, char *value ) +inline void SET_CLIENT_KEY_VALUE( int clientIndex, const char *infobuffer, + const char *key, const char *value ) { (*g_engfuncs.pfnSetClientKeyValue)( clientIndex, infobuffer, key, value ); } diff --git a/dlls/hs/bot.h b/dlls/hs/bot.h index ae05575a..d88e07bc 100644 --- a/dlls/hs/bot.h +++ b/dlls/hs/bot.h @@ -27,8 +27,8 @@ typedef struct // used in checking if bot can pick up ammo { - char *ammo_name; - char *weapon_name; + const char *ammo_name; + const char *weapon_name; int max_carry; } ammo_check_t; diff --git a/dlls/hs/bot_combat.cpp b/dlls/hs/bot_combat.cpp index bf7c8b9f..a3c6117f 100644 --- a/dlls/hs/bot_combat.cpp +++ b/dlls/hs/bot_combat.cpp @@ -113,9 +113,9 @@ ammo_check_t ammo_check[] = { {"", 0, 0}}; // sounds for Bot taunting after a kill... -char barney_taunt[][30] = { BA_TNT1, BA_TNT2, BA_TNT3, BA_TNT4, BA_TNT5 }; -char scientist_taunt[][30] = { SC_TNT1, SC_TNT2, SC_TNT3, SC_TNT4, SC_TNT5 }; -char vader_taunt[][30] = { DV_TNT1, DV_TNT2, DV_TNT3, DV_TNT4, DV_TNT5 }; +const char *barney_taunt[] = { BA_TNT1, BA_TNT2, BA_TNT3, BA_TNT4, BA_TNT5 }; +const char *scientist_taunt[] = { SC_TNT1, SC_TNT2, SC_TNT3, SC_TNT4, SC_TNT5 }; +const char *vader_taunt[] = { DV_TNT1, DV_TNT2, DV_TNT3, DV_TNT4, DV_TNT5 }; CBaseEntity * CBot::BotFindEnemy( void ) diff --git a/dlls/hs/grinman.cpp b/dlls/hs/grinman.cpp index 5758f954..f3444adc 100644 --- a/dlls/hs/grinman.cpp +++ b/dlls/hs/grinman.cpp @@ -153,7 +153,7 @@ void CGrinman :: StartTask( Task_t *pTask ) switch( pTask->iTask ) { case TASK_WAIT: - if (m_hPlayer == NULL) + if (m_hPlayer == 0) { m_hPlayer = UTIL_FindEntityByClassname( NULL, "player" ); } @@ -168,7 +168,7 @@ void CGrinman :: RunTask( Task_t *pTask ) { case TASK_WAIT: // look at who I'm talking to - if (m_flTalkTime > gpGlobals->time && m_hTalkTarget != NULL) + if (m_flTalkTime > gpGlobals->time && m_hTalkTarget != 0) { float yaw = VecToYaw(m_hTalkTarget->pev->origin - pev->origin) - pev->angles.y; @@ -179,7 +179,7 @@ void CGrinman :: RunTask( Task_t *pTask ) SetBoneController( 0, yaw ); } // look at player, but only if playing a "safe" idle animation - else if (m_hPlayer != NULL && pev->sequence == 0) + else if (m_hPlayer != 0 && pev->sequence == 0) { float yaw = VecToYaw(m_hPlayer->pev->origin - pev->origin) - pev->angles.y; @@ -242,4 +242,4 @@ void CGrinman::PlayScriptedSentence( const char *pszSentence, float duration, fl m_flTalkTime = gpGlobals->time + duration; m_hTalkTarget = pListener; -} \ No newline at end of file +} diff --git a/dlls/hs/monhunt_gamerules.cpp b/dlls/hs/monhunt_gamerules.cpp index 2b926d9b..659ede82 100644 --- a/dlls/hs/monhunt_gamerules.cpp +++ b/dlls/hs/monhunt_gamerules.cpp @@ -326,16 +326,16 @@ int CMonsterplay::iKillforMonster(const char *classname) const char *CMonsterplay::PrepareMonsterName( const char *monster_name ) { // Hack to fix name change - char *gayglenn = "Gay Glenn"; - char *barney = "Barney"; - char *scientist = "Scientist"; - char *xmast = "X-Mas Tree"; - char *sinistar = "Sinistar"; - char *cwc = "Chris-Chan"; - char *zombie = "Zombie"; - char *controller = "Alien Controller"; - char *bullsquid = "Bull Squid"; - char *grinman = "Grinman"; + const char *gayglenn = "Gay Glenn"; + const char *barney = "Barney"; + const char *scientist = "Scientist"; + const char *xmast = "X-Mas Tree"; + const char *sinistar = "Sinistar"; + const char *cwc = "Chris-Chan"; + const char *zombie = "Zombie"; + const char *controller = "Alien Controller"; + const char *bullsquid = "Bull Squid"; + const char *grinman = "Grinman"; monster_name += 8; diff --git a/engine/eiface.h b/engine/eiface.h index f6cf2f51..2fca80bd 100644 --- a/engine/eiface.h +++ b/engine/eiface.h @@ -201,9 +201,9 @@ typedef struct enginefuncs_s void (*pfnRunPlayerMove)( edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ); int (*pfnNumberOfEntities)( void ); char* (*pfnGetInfoKeyBuffer)( edict_t *e ); // passing in NULL gets the serverinfo - char* (*pfnInfoKeyValue)( char *infobuffer, const char *key ); - void (*pfnSetKeyValue)( char *infobuffer, const char *key, const char *value ); - void (*pfnSetClientKeyValue)( int clientIndex, char *infobuffer, const char *key, const char *value ); + char* (*pfnInfoKeyValue)( const char *infobuffer, const char *key ); + void (*pfnSetKeyValue)( const char *infobuffer, const char *key, const char *value ); + void (*pfnSetClientKeyValue)( int clientIndex, const char *infobuffer, const char *key, const char *value ); int (*pfnIsMapValid)( const char *filename ); void (*pfnStaticDecal)( const float *origin, int decalIndex, int entityIndex, int modelIndex ); int (*pfnPrecacheGeneric)( const char *s );