src/stdlib/SDL_string.c
changeset 1354 22f39393668a
parent 1343 d5c4f8f6855e
child 1358 c71e05b4dc2e
     1.1 --- a/src/stdlib/SDL_string.c	Thu Feb 09 09:07:13 2006 +0000
     1.2 +++ b/src/stdlib/SDL_string.c	Thu Feb 09 09:38:05 2006 +0000
     1.3 @@ -23,14 +23,11 @@
     1.4  
     1.5  /* This file contains portable string manipulation functions for SDL */
     1.6  
     1.7 -#include "SDL_types.h"
     1.8 -#include "SDL_ctype.h"
     1.9 -#include "SDL_stdlib.h"
    1.10 -#include "SDL_string.h"
    1.11 +#include "SDL_stdinc.h"
    1.12  
    1.13  
    1.14 -#define isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
    1.15 -#define islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
    1.16 +#define SDL_isupperhex(X)   (((X) >= 'A') && ((X) <= 'F'))
    1.17 +#define SDL_islowerhex(X)   (((X) >= 'a') && ((X) <= 'f'))
    1.18  
    1.19  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
    1.20  static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
    1.21 @@ -48,11 +45,11 @@
    1.22      }
    1.23      for ( ; ; ) {
    1.24          int v;
    1.25 -        if ( isdigit(*text) ) {
    1.26 +        if ( SDL_isdigit(*text) ) {
    1.27              v = *text - '0';
    1.28 -        } else if ( radix == 16 && isupperhex(*text) ) {
    1.29 +        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
    1.30              v = 10 + (*text - 'A');
    1.31 -        } else if ( radix == 16 && islowerhex(*text) ) {
    1.32 +        } else if ( radix == 16 && SDL_islowerhex(*text) ) {
    1.33              v = 10 + (*text - 'a');
    1.34          } else {
    1.35              break;
    1.36 @@ -83,11 +80,11 @@
    1.37      }
    1.38      for ( ; ; ) {
    1.39          int v;
    1.40 -        if ( isdigit(*text) ) {
    1.41 +        if ( SDL_isdigit(*text) ) {
    1.42              v = *text - '0';
    1.43 -        } else if ( radix == 16 && isupperhex(*text) ) {
    1.44 +        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
    1.45              v = 10 + (*text - 'A');
    1.46 -        } else if ( radix == 16 && islowerhex(*text) ) {
    1.47 +        } else if ( radix == 16 && SDL_islowerhex(*text) ) {
    1.48              v = 10 + (*text - 'a');
    1.49          } else {
    1.50              break;
    1.51 @@ -120,11 +117,11 @@
    1.52      }
    1.53      for ( ; ; ) {
    1.54          int v;
    1.55 -        if ( isdigit(*text) ) {
    1.56 +        if ( SDL_isdigit(*text) ) {
    1.57              v = *text - '0';
    1.58 -        } else if ( radix == 16 && isupperhex(*text) ) {
    1.59 +        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
    1.60              v = 10 + (*text - 'A');
    1.61 -        } else if ( radix == 16 && islowerhex(*text) ) {
    1.62 +        } else if ( radix == 16 && SDL_islowerhex(*text) ) {
    1.63              v = 10 + (*text - 'a');
    1.64          } else {
    1.65              break;
    1.66 @@ -155,11 +152,11 @@
    1.67      }
    1.68      for ( ; ; ) {
    1.69          int v;
    1.70 -        if ( isdigit(*text) ) {
    1.71 +        if ( SDL_isdigit(*text) ) {
    1.72              v = *text - '0';
    1.73 -        } else if ( radix == 16 && isupperhex(*text) ) {
    1.74 +        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
    1.75              v = 10 + (*text - 'A');
    1.76 -        } else if ( radix == 16 && islowerhex(*text) ) {
    1.77 +        } else if ( radix == 16 && SDL_islowerhex(*text) ) {
    1.78              v = 10 + (*text - 'a');
    1.79          } else {
    1.80              break;
    1.81 @@ -193,7 +190,7 @@
    1.82      if ( *text == '.' ) {
    1.83          int mult = 10;
    1.84          ++text;
    1.85 -        while ( isdigit(*text) ) {
    1.86 +        while ( SDL_isdigit(*text) ) {
    1.87              lvalue = *text - '0';
    1.88              value += (double)lvalue / mult;
    1.89              mult *= 10;
    1.90 @@ -632,7 +629,7 @@
    1.91      va_start(ap, fmt);
    1.92      while ( *fmt ) {
    1.93          if ( *fmt == ' ' ) {
    1.94 -            while ( isspace(*text) ) {
    1.95 +            while ( SDL_isspace(*text) ) {
    1.96                  ++text;
    1.97              }
    1.98              ++fmt;
    1.99 @@ -683,7 +680,7 @@
   1.100                  continue;
   1.101              }
   1.102  
   1.103 -            while ( isspace(*text) ) {
   1.104 +            while ( SDL_isspace(*text) ) {
   1.105                  ++text;
   1.106              }
   1.107  
   1.108 @@ -845,7 +842,7 @@
   1.109                          break;
   1.110                      case 's':
   1.111                          if ( suppress ) {
   1.112 -                            while ( !isspace(*text) ) {
   1.113 +                            while ( !SDL_isspace(*text) ) {
   1.114                                  ++text;
   1.115                                  if ( count ) {
   1.116                                      if ( --count == 0 ) {
   1.117 @@ -855,7 +852,7 @@
   1.118                              }
   1.119                          } else {
   1.120                              char *valuep = va_arg(ap, char*);
   1.121 -                            while ( !isspace(*text) ) {
   1.122 +                            while ( !SDL_isspace(*text) ) {
   1.123                                  *valuep++ = *text++;
   1.124                                  if ( count ) {
   1.125                                      if ( --count == 0 ) {