Browse Source

public: moar int to size_t for string length

pull/2/head
Alibek Omarov 4 years ago
parent
commit
d25a661701
  1. 18
      public/crtlib.c
  2. 2
      public/crtlib.h

18
public/crtlib.c

@ -62,7 +62,7 @@ qboolean Q_isdigit( const char *str ) @@ -62,7 +62,7 @@ qboolean Q_isdigit( const char *str )
size_t Q_strlen( const char *string )
{
int len;
size_t len;
const char *p;
if( !string ) return 0;
@ -77,9 +77,9 @@ size_t Q_strlen( const char *string ) @@ -77,9 +77,9 @@ size_t Q_strlen( const char *string )
return len;
}
int Q_colorstr( const char *string )
size_t Q_colorstr( const char *string )
{
int len;
size_t len;
const char *p;
if( !string ) return 0;
@ -325,7 +325,7 @@ void Q_atov( float *vec, const char *str, size_t siz ) @@ -325,7 +325,7 @@ void Q_atov( float *vec, const char *str, size_t siz )
char *Q_strchr( const char *s, char c )
{
int len = Q_strlen( s );
size_t len = Q_strlen( s );
while( len-- )
{
@ -337,7 +337,7 @@ char *Q_strchr( const char *s, char c ) @@ -337,7 +337,7 @@ char *Q_strchr( const char *s, char c )
char *Q_strrchr( const char *s, char c )
{
int len = Q_strlen( s );
size_t len = Q_strlen( s );
s += len;
@ -504,7 +504,8 @@ const char* Q_timestamp( int format ) @@ -504,7 +504,8 @@ const char* Q_timestamp( int format )
char *Q_strstr( const char *string, const char *string2 )
{
int c, len;
int c;
size_t len;
if( !string || !string2 ) return NULL;
@ -528,7 +529,8 @@ char *Q_strstr( const char *string, const char *string2 ) @@ -528,7 +529,8 @@ char *Q_strstr( const char *string, const char *string2 )
char *Q_stristr( const char *string, const char *string2 )
{
int c, len;
int c;
size_t len;
if( !string || !string2 ) return NULL;
@ -744,7 +746,7 @@ Extracts the base name of a file (no path, no extension, assumes '/' as path sep @@ -744,7 +746,7 @@ Extracts the base name of a file (no path, no extension, assumes '/' as path sep
*/
void COM_FileBase( const char *in, char *out )
{
int len, start, end;
size_t len, start, end;
len = Q_strlen( in );
if( !len ) return;

2
public/crtlib.h

@ -46,7 +46,7 @@ void Q_strnupr( const char *in, char *out, size_t size_out ); @@ -46,7 +46,7 @@ void Q_strnupr( const char *in, char *out, size_t size_out );
#define Q_strlwr( in, out ) Q_strnlwr( in, out, 99999 )
void Q_strnlwr( const char *in, char *out, size_t size_out );
size_t Q_strlen( const char *string );
int Q_colorstr( const char *string );
size_t Q_colorstr( const char *string );
char Q_toupper( const char in );
char Q_tolower( const char in );
#define Q_strcat( dst, src ) Q_strncat( dst, src, 99999 )

Loading…
Cancel
Save