public: remove custom str(r)chr functions

This commit is contained in:
Alibek Omarov 2022-06-14 03:23:46 +03:00
parent 402b38951d
commit ab6214142f
2 changed files with 2 additions and 28 deletions

View File

@ -317,32 +317,6 @@ void Q_atov( float *vec, const char *str, size_t siz )
} }
} }
char *Q_strchr( const char *s, char c )
{
size_t len = Q_strlen( s );
while( len-- )
{
if( *++s == c )
return (char *)s;
}
return 0;
}
char *Q_strrchr( const char *s, char c )
{
size_t len = Q_strlen( s );
s += len;
while( len-- )
{
if( *--s == c )
return (char *)s;
}
return 0;
}
int Q_strnicmp( const char *s1, const char *s2, int n ) int Q_strnicmp( const char *s1, const char *s2, int n )
{ {
int c1, c2; int c1, c2;

View File

@ -58,8 +58,8 @@ qboolean Q_isspace( const char *str );
int Q_atoi( const char *str ); int Q_atoi( const char *str );
float Q_atof( const char *str ); float Q_atof( const char *str );
void Q_atov( float *vec, const char *str, size_t siz ); void Q_atov( float *vec, const char *str, size_t siz );
char *Q_strchr( const char *s, char c ); #define Q_strchr strchr
char *Q_strrchr( const char *s, char c ); #define Q_strrchr strrchr
#define Q_stricmp( s1, s2 ) Q_strnicmp( s1, s2, 99999 ) #define Q_stricmp( s1, s2 ) Q_strnicmp( s1, s2, 99999 )
int Q_strnicmp( const char *s1, const char *s2, int n ); int Q_strnicmp( const char *s1, const char *s2, int n );
#define Q_strcmp( s1, s2 ) Q_strncmp( s1, s2, 99999 ) #define Q_strcmp( s1, s2 ) Q_strncmp( s1, s2, 99999 )