diff --git a/code/cgame/cg_players.cpp b/code/cgame/cg_players.cpp index 3c50681..55c3330 100644 --- a/code/cgame/cg_players.cpp +++ b/code/cgame/cg_players.cpp @@ -164,10 +164,10 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt if (iVariantCap || bForceVariant1) { - char *p = strchr(ppsTable[iEntryNum],'.'); - if (p && p-2 > ppsTable[iEntryNum] && isdigit(p[-1]) && !isdigit(p[-2])) + const char *pt = strchr(ppsTable[iEntryNum],'.'); + if (pt && pt-2 > ppsTable[iEntryNum] && isdigit(pt[-1]) && !isdigit(pt[-2])) { - int iThisVariant = p[-1]-'0'; + int iThisVariant = pt[-1]-'0'; if (iThisVariant > iVariantCap || bForceVariant1) { @@ -178,7 +178,7 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt char sName[MAX_QPATH]; Q_strncpyz(sName, ppsTable[iEntryNum], sizeof(sName)); - p = strchr(sName,'.'); + char *p = strchr(sName,'.'); if (p) { *p = '\0'; diff --git a/code/client/cl_keys.cpp b/code/client/cl_keys.cpp index eb3fac4..7213d13 100644 --- a/code/client/cl_keys.cpp +++ b/code/client/cl_keys.cpp @@ -899,7 +899,7 @@ the K_* names are matched up. to be configured even if they don't have defined names. =================== */ -int Key_StringToKeynum( char *str ) { +int Key_StringToKeynum( const char *str ) { int i; if ( !str || !str[0] ) diff --git a/code/client/client.h b/code/client/client.h index d86a676..b5f4e90 100644 --- a/code/client/client.h +++ b/code/client/client.h @@ -332,7 +332,7 @@ void CL_WritePacket( void ); void IN_CenterView (void); float CL_KeyState (kbutton_t *key); -int Key_StringToKeynum( char *str ); +int Key_StringToKeynum( const char *str ); const char *Key_KeynumToString( int keynum/*, qboolean bTranslate*/ ); //note: translate is only called for menu display not configs // diff --git a/code/game/q_shared.h b/code/game/q_shared.h index a64ab43..cbdd557 100644 --- a/code/game/q_shared.h +++ b/code/game/q_shared.h @@ -994,7 +994,7 @@ inline char *Q_strupr( char *s1 ) return s1; } #endif -inline char *Q_strrchr( const char* str, int c ) { return strrchr(str, c); } +inline char *Q_strrchr( char* str, int c ) { return strrchr(str, c); } // buffer size safe library replacements void Q_strncpyz( char *dest, const char *src, int destsize, qboolean bBarfIfTooLong=qfalse ); diff --git a/code/renderer/tr_image.cpp b/code/renderer/tr_image.cpp index 03bc10b..f17a826 100644 --- a/code/renderer/tr_image.cpp +++ b/code/renderer/tr_image.cpp @@ -979,7 +979,7 @@ image_t *R_CreateImage( const char *name, const byte *pic, int width, int height if (name[0] == '*') { - char *psLightMapNameSearchPos = strrchr(name,'/'); + const char *psLightMapNameSearchPos = strrchr(name,'/'); if ( psLightMapNameSearchPos && !strncmp( psLightMapNameSearchPos+1, "lightmap", 8 ) ) { isLightmap = qtrue; } diff --git a/code/sdl/sdl_input.cpp b/code/sdl/sdl_input.cpp index 6231dd0..8e28925 100644 --- a/code/sdl/sdl_input.cpp +++ b/code/sdl/sdl_input.cpp @@ -144,7 +144,7 @@ static qboolean IN_IsConsoleKey( int key, const unsigned char character ) // Only parse the variable when it changes if( cl_consoleKeys->modified ) { - char *text_p, *token; + const char *text_p, *token; cl_consoleKeys->modified = qfalse; text_p = cl_consoleKeys->string;