public: make Q_atoi_hex public, check for 0x prefix
This commit is contained in:
parent
4a58be2aa0
commit
422addcbb6
2 changed files with 5 additions and 2 deletions
|
@ -53,11 +53,13 @@ size_t Q_colorstr( const char *string )
|
|||
return len;
|
||||
}
|
||||
|
||||
static int Q_atoi_hex( int sign, const char *str )
|
||||
int Q_atoi_hex( int sign, const char *str )
|
||||
{
|
||||
int c, val = 0;
|
||||
|
||||
str += 2;
|
||||
if( str[0] == '0' && ( str[1] == 'x' || str[1] == 'X' ))
|
||||
str += 2;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
c = *str++;
|
||||
|
|
|
@ -68,6 +68,7 @@ const char *Q_buildbranch( void );
|
|||
void Q_strnlwr( const char *in, char *out, size_t size_out );
|
||||
#define Q_strlen( str ) (( str ) ? strlen(( str )) : 0 )
|
||||
size_t Q_colorstr( const char *string );
|
||||
int Q_atoi_hex( int sign, const char *str );
|
||||
int Q_atoi( const char *str );
|
||||
float Q_atof( const char *str );
|
||||
void Q_atov( float *vec, const char *str, size_t siz );
|
||||
|
|
Loading…
Add table
Reference in a new issue