diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 54dcede0..22555caa 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -94,8 +94,12 @@ inline void DrawSetTextColor( float r, float g, float b ) inline int SPR_Height( HSPRITE x, int f ) { return gEngfuncs.pfnSPR_Height(x, f); } inline int SPR_Width( HSPRITE x, int f ) { return gEngfuncs.pfnSPR_Width(x, f); } -inline client_textmessage_t *TextMessageGet( const char *pName ) { return gEngfuncs.pfnTextMessageGet( pName ); } -inline int TextMessageDrawChar( int x, int y, int number, int r, int g, int b ) +inline client_textmessage_t *TextMessageGet( const char *pName ) +{ + return gEngfuncs.pfnTextMessageGet( pName ); +} + +inline int TextMessageDrawChar( int x, int y, int number, int r, int g, int b ) { return gEngfuncs.pfnDrawCharacter( x, y, number, r, g, b ); } @@ -115,7 +119,7 @@ inline void GetConsoleStringSize( const char *string, int *width, int *height ) gEngfuncs.pfnDrawConsoleStringLen( (char*)string, width, height ); } -int DrawUtfString( int xpos, int ypos, int iMaxX, char *szIt, int r, int g, int b ); +int DrawUtfString( int xpos, int ypos, int iMaxX, const char *szIt, int r, int g, int b ); inline int ConsoleStringLen( const char *string ) { diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index e50de419..774df091 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -46,7 +46,7 @@ void COM_Log( const char *pszFile, const char *fmt, ... ) va_list argptr; char string[1024]; FILE *fp; - char *pfilename; + const char *pfilename; if( !pszFile ) { diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 5182b484..829fd4b2 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -281,7 +281,7 @@ int CHud::DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r int CHud::DrawHudStringReverse( int xpos, int ypos, int iMinX, const char *szString, int r, int g, int b ) { // find the end of the string - for( char *szIt = szString; *szIt != 0; szIt++ ) + for( const char *szIt = szString; *szIt != 0; szIt++ ) xpos -= gHUD.m_scrinfo.charWidths[(unsigned char)*szIt]; if( xpos < iMinX ) xpos = iMinX; diff --git a/cl_dll/text_message.cpp b/cl_dll/text_message.cpp index 13b62577..58dae6f7 100644 --- a/cl_dll/text_message.cpp +++ b/cl_dll/text_message.cpp @@ -45,7 +45,7 @@ int CHudTextMessage::Init( void ) char *CHudTextMessage::LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size ) { char *dst = dst_buffer; - for( char *src = msg; *src != 0 && buffer_size > 0; buffer_size-- ) + for( char *src = (char*)msg; *src != 0 && buffer_size > 0; buffer_size-- ) { if( *src == '#' ) { @@ -163,22 +163,22 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf int msg_dest = READ_BYTE(); static char szBuf[6][128]; - char *msg_text = LookupString( READ_STRING(), &msg_dest ); + const char *msg_text = LookupString( READ_STRING(), &msg_dest ); msg_text = strcpy( szBuf[0], msg_text ); // keep reading strings and using C format strings for subsituting the strings into the localised text string const char *sstr1 = LookupString( READ_STRING() ); sstr1 = strcpy( szBuf[1], sstr1 ); - StripEndNewlineFromString( sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines + StripEndNewlineFromString( (char*)sstr1 ); // these strings are meant for subsitution into the main strings, so cull the automatic end newlines const char *sstr2 = LookupString( READ_STRING() ); sstr2 = strcpy( szBuf[2], sstr2 ); - StripEndNewlineFromString( sstr2 ); + StripEndNewlineFromString( (char*)sstr2 ); const char *sstr3 = LookupString( READ_STRING() ); sstr3 = strcpy( szBuf[3], sstr3 ); - StripEndNewlineFromString( sstr3 ); + StripEndNewlineFromString( (char*)sstr3 ); const char *sstr4 = LookupString( READ_STRING() ); sstr4 = strcpy( szBuf[4], sstr4 ); - StripEndNewlineFromString( sstr4 ); + StripEndNewlineFromString( (char*)sstr4 ); char *psz = szBuf[5]; switch( msg_dest ) diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 76f4ad91..df7c51f3 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -525,7 +525,7 @@ void CBaseButton::Spawn() // Button sound table. // Also used by CBaseDoor to get 'touched' door lock/unlock sounds -char *ButtonSound( int sound ) +const char *ButtonSound( int sound ) { const char *pszSound; diff --git a/dlls/combat.cpp b/dlls/combat.cpp index d8830c20..35e4ffcf 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -1463,7 +1463,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin } } // make bullet trails - UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ); + UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) ); } ApplyMultiDamage( pev, pevAttacker ); } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 0b6f7de6..989c32a8 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -935,7 +935,7 @@ BOOL CBasePlayerWeapon::CanDeploy( void ) return TRUE; } -BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal /* = 0 */, int body ) +BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal /* = 0 */, int body ) { if( !CanDeploy() ) return FALSE; diff --git a/dlls/weapons.h b/dlls/weapons.h index 8d60bad8..7bb1b486 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -310,7 +310,7 @@ public: virtual BOOL CanDeploy( void ); virtual BOOL IsUseable( void ); - BOOL DefaultDeploy( const char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0 ); + BOOL DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal = 0, int body = 0 ); int DefaultReload( int iClipSize, int iAnim, float fDelay, int body = 0 ); virtual void ItemPostFrame( void ); // called each frame by the player PostThink diff --git a/engine/cdll_int.h b/engine/cdll_int.h index a0dc59c2..056146b4 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -205,7 +205,7 @@ typedef struct cl_enginefuncs_s int (*CL_CreateVisibleEntity)( int type, struct cl_entity_s *ent ); const struct model_s* (*GetSpritePointer)( HSPRITE hSprite ); - void (*pfnPlaySoundByNameAtLocation)( char *szSound, float volume, float *origin ); + void (*pfnPlaySoundByNameAtLocation)( const char *szSound, float volume, float *origin ); unsigned short (*pfnPrecacheEvent)( int type, const char* psz ); void (*pfnPlaybackEvent)( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );