From b22ea2889f5ddc92d037a3ae545db4d57880b5dd Mon Sep 17 00:00:00 2001 From: Night Owl Date: Fri, 6 Apr 2018 22:58:16 +0500 Subject: [PATCH] Fix warnings. --- cl_dll/dmc/DMC_Teleporters.cpp | 2 +- cl_dll/ev_hldm.cpp | 6 ++---- cl_dll/quake/quake_weapons.cpp | 2 +- cl_dll/view.cpp | 1 - dlls/aghl/agglobal.cpp | 2 +- dlls/aghl/agspectator.cpp | 2 +- dlls/cbase.h | 2 +- dlls/dmc/observer.cpp | 6 +++--- dlls/dmc/quake_weapons_all.cpp | 7 ++++--- dlls/multiplay_gamerules.cpp | 2 +- dlls/player.cpp | 2 +- dlls/player.h | 2 +- 12 files changed, 17 insertions(+), 19 deletions(-) diff --git a/cl_dll/dmc/DMC_Teleporters.cpp b/cl_dll/dmc/DMC_Teleporters.cpp index e6794c97..4f2bb472 100644 --- a/cl_dll/dmc/DMC_Teleporters.cpp +++ b/cl_dll/dmc/DMC_Teleporters.cpp @@ -463,7 +463,7 @@ void Dmc_TouchTeleporters ( struct local_state_s *player, dmc_tele_t *pTeles, i //This comes via an event when the player connects. if ( !g_bLoadedTeles ) { - for ( int j = 0; j < 3; j++ ) + for( j = 0; j < 3; j++ ) { pTele->absmin[ j ] = g_vecTeleMins[ iTeleNum ][ j ] - 1.0; pTele->absmax[ j ] = g_vecTeleMaxs[ iTeleNum ][ j ] + 1.0; diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index 9935135c..39d62bb7 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -716,13 +716,11 @@ void EV_FireLightning( event_args_t *args ) int idx; vec3_t origin, endorigin; vec3_t angles; - vec3_t vecEnd; vec3_t up, right, forward; int iShutDown; cl_entity_t *player; - pmtrace_t tr; int modelIndex; bool bSound = false; @@ -750,7 +748,7 @@ void EV_FireLightning( event_args_t *args ) V_PunchAxis( 0, Q_SMALL_PUNCHANGLE_KICK ); - cl_entity_t *player = gEngfuncs.GetViewModel(); + player = gEngfuncs.GetViewModel(); origin = player->attachment[0]; } else @@ -767,7 +765,7 @@ void EV_FireLightning( event_args_t *args ) if ( iShutDown == 0 && EV_IsLocal( idx ) && pBeam == NULL ) { - vec3_t vecSrc, vecEnd, origin, angles, forward, right, up; + vec3_t vecSrc, vecEnd; pmtrace_t tr; cl_entity_t *pl = gEngfuncs.GetEntityByIndex( idx ); diff --git a/cl_dll/quake/quake_weapons.cpp b/cl_dll/quake/quake_weapons.cpp index 1d028409..d3a227a1 100644 --- a/cl_dll/quake/quake_weapons.cpp +++ b/cl_dll/quake/quake_weapons.cpp @@ -448,7 +448,7 @@ BOOL CQuakeGun::Deploy( ) return TRUE; } -int HUD_GetModelIndex( char *modelname ) +int HUD_GetModelIndex( const char *modelname ) { int retval = 0; gEngfuncs.CL_LoadModel( modelname, &retval ); diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index 908bdad2..9f8fce60 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -1373,7 +1373,6 @@ void V_CalcSpectatorRefdef( struct ref_params_s *pparams ) if( i < ORIGIN_MASK && ViewInterp.OriginTime[foundidx & ORIGIN_MASK] != 0.0 ) { // Interpolate - vec3_t delta; double frac; double dt; vec3_t neworg; diff --git a/dlls/aghl/agglobal.cpp b/dlls/aghl/agglobal.cpp index 8b37696d..758a57fb 100644 --- a/dlls/aghl/agglobal.cpp +++ b/dlls/aghl/agglobal.cpp @@ -103,7 +103,7 @@ CBasePlayer* AgPlayerByIndex(int iPlayerIndex ) CBaseEntity* pEnt = (CBaseEntity *)CBaseEntity::Instance( pPlayerEdict ); if (pEnt && pEnt->pev && CLASS_PLAYER == pEnt->Classify()) { - if (pEnt->pev->netname && 0 != STRING(pEnt->pev->netname)[0]) + if (pEnt->pev->netname && 0 != ( STRING( pEnt->pev->netname ) )[0]) { pPlayer = (CBasePlayer*)pEnt; } diff --git a/dlls/aghl/agspectator.cpp b/dlls/aghl/agspectator.cpp index 1491bce1..4f435ec9 100644 --- a/dlls/aghl/agspectator.cpp +++ b/dlls/aghl/agspectator.cpp @@ -94,7 +94,7 @@ void CBasePlayer::Spectate_Start() EnableControl(TRUE); - if ( m_pTank != NULL ) + if ( m_pTank != 0 ) { m_pTank->Use( this, this, USE_OFF, 0 ); m_pTank = NULL; diff --git a/dlls/cbase.h b/dlls/cbase.h index 8ca6aef2..b7353aea 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -783,7 +783,7 @@ public: }; // QUAKECLASSIC -extern char *g_szDeathType; +extern const char *g_szDeathType; //++ BulliT #endif //_CBASE_H_ diff --git a/dlls/dmc/observer.cpp b/dlls/dmc/observer.cpp index f50f215d..b14f7f56 100644 --- a/dlls/dmc/observer.cpp +++ b/dlls/dmc/observer.cpp @@ -113,12 +113,12 @@ void CBasePlayer::Observer_SetMode( int iMode ) iMode = OBS_IN_EYE; // now it is // if we are not roaming, we need a valid target to track - if ( (iMode != OBS_ROAMING) && (m_hObserverTarget == NULL) ) + if ( (iMode != OBS_ROAMING) && (m_hObserverTarget == 0) ) { Observer_FindNextPlayer(); // if we didn't find a valid target switch to roaming - if (m_hObserverTarget == NULL) + if (m_hObserverTarget == 0) { ClientPrint( pev, HUD_PRINTCENTER, "#Spec_NoTarget" ); iMode = OBS_ROAMING; @@ -139,4 +139,4 @@ void CBasePlayer::Observer_SetMode( int iMode ) char modemsg[16]; sprintf(modemsg,"#Spec_Mode%i", iMode); ClientPrint( pev, HUD_PRINTCENTER, modemsg ); -} \ No newline at end of file +} diff --git a/dlls/dmc/quake_weapons_all.cpp b/dlls/dmc/quake_weapons_all.cpp index cf1526a5..d6d203e9 100644 --- a/dlls/dmc/quake_weapons_all.cpp +++ b/dlls/dmc/quake_weapons_all.cpp @@ -132,9 +132,9 @@ void CBasePlayer::W_SetCurrentAmmo( int sendanim /* = 1 */ ) { m_iQuakeItems &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS); int iszViewModel = 0; - char *viewmodel = ""; + const char *viewmodel = ""; int iszWeaponModel = 0; - char *szAnimExt; + const char *szAnimExt; // Find out what weapon the player's using if (m_iQuakeWeapon == IT_AXE) @@ -223,7 +223,8 @@ void CBasePlayer::W_SetCurrentAmmo( int sendanim /* = 1 */ ) #else { - int HUD_GetModelIndex( char *modelname ); +extern int HUD_GetModelIndex( const char *modelname ); + pev->viewmodel = HUD_GetModelIndex( viewmodel ); cl_entity_t *view; diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 6887692b..7e6ea6a5 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -47,7 +47,7 @@ bool g_bHaveMOTD; #define WEAPON_RESPAWN_TIME 20 #define AMMO_RESPAWN_TIME 20 -char *g_szDeathType; +const char *g_szDeathType; float g_flIntermissionStartTime = 0; #ifndef NO_VOICEGAMEMGR diff --git a/dlls/player.cpp b/dlls/player.cpp index 86001a39..5c654d4a 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -4716,7 +4716,7 @@ bool CBasePlayer::RespawnMatch() //Remove all weapons/items RemoveAllItemsNoClientMessage(); - if( m_pTank != NULL ) + if( m_pTank != 0 ) { m_pTank->Use( this, this, USE_OFF, 0 ); m_pTank = NULL; diff --git a/dlls/player.h b/dlls/player.h index bc35565f..91cebf41 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -446,7 +446,7 @@ public: //++ BulliT inline const char *CBasePlayer::GetName() { - return pev->netname ? STRING( pev->netname )[0] ? STRING( pev->netname ) : "" : ""; + return pev->netname ? ( ( STRING( pev->netname ) )[0] ? STRING( pev->netname ) : "" ) : ""; }; inline bool CBasePlayer::IsIngame()