const fixes

This commit is contained in:
Jonathan Gray 2013-05-02 15:13:41 +10:00
parent f248a82b31
commit ac4f685edb
6 changed files with 9 additions and 9 deletions

View File

@ -164,10 +164,10 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt
if (iVariantCap || bForceVariant1) if (iVariantCap || bForceVariant1)
{ {
char *p = strchr(ppsTable[iEntryNum],'.'); const char *pt = strchr(ppsTable[iEntryNum],'.');
if (p && p-2 > ppsTable[iEntryNum] && isdigit(p[-1]) && !isdigit(p[-2])) 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) if (iThisVariant > iVariantCap || bForceVariant1)
{ {
@ -178,7 +178,7 @@ static const char *GetCustomSound_VariantCapped(const char *ppsTable[], int iEnt
char sName[MAX_QPATH]; char sName[MAX_QPATH];
Q_strncpyz(sName, ppsTable[iEntryNum], sizeof(sName)); Q_strncpyz(sName, ppsTable[iEntryNum], sizeof(sName));
p = strchr(sName,'.'); char *p = strchr(sName,'.');
if (p) if (p)
{ {
*p = '\0'; *p = '\0';

View File

@ -899,7 +899,7 @@ the K_* names are matched up.
to be configured even if they don't have defined names. to be configured even if they don't have defined names.
=================== ===================
*/ */
int Key_StringToKeynum( char *str ) { int Key_StringToKeynum( const char *str ) {
int i; int i;
if ( !str || !str[0] ) if ( !str || !str[0] )

View File

@ -332,7 +332,7 @@ void CL_WritePacket( void );
void IN_CenterView (void); void IN_CenterView (void);
float CL_KeyState (kbutton_t *key); 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 const char *Key_KeynumToString( int keynum/*, qboolean bTranslate*/ ); //note: translate is only called for menu display not configs
// //

View File

@ -994,7 +994,7 @@ inline char *Q_strupr( char *s1 )
return s1; return s1;
} }
#endif #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 // buffer size safe library replacements
void Q_strncpyz( char *dest, const char *src, int destsize, qboolean bBarfIfTooLong=qfalse ); void Q_strncpyz( char *dest, const char *src, int destsize, qboolean bBarfIfTooLong=qfalse );

View File

@ -979,7 +979,7 @@ image_t *R_CreateImage( const char *name, const byte *pic, int width, int height
if (name[0] == '*') if (name[0] == '*')
{ {
char *psLightMapNameSearchPos = strrchr(name,'/'); const char *psLightMapNameSearchPos = strrchr(name,'/');
if ( psLightMapNameSearchPos && !strncmp( psLightMapNameSearchPos+1, "lightmap", 8 ) ) { if ( psLightMapNameSearchPos && !strncmp( psLightMapNameSearchPos+1, "lightmap", 8 ) ) {
isLightmap = qtrue; isLightmap = qtrue;
} }

View File

@ -144,7 +144,7 @@ static qboolean IN_IsConsoleKey( int key, const unsigned char character )
// Only parse the variable when it changes // Only parse the variable when it changes
if( cl_consoleKeys->modified ) if( cl_consoleKeys->modified )
{ {
char *text_p, *token; const char *text_p, *token;
cl_consoleKeys->modified = qfalse; cl_consoleKeys->modified = qfalse;
text_p = cl_consoleKeys->string; text_p = cl_consoleKeys->string;