Merged r2979:2980 from branches/SDL-1.2: unsigned char in ctype funcs.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 15 Feb 2007 11:14:24 +0000
changeset 20928e761d6af583
parent 2091 b8bee470f737
child 2093 cdaeb26ed66a
Merged r2979:2980 from branches/SDL-1.2: unsigned char in ctype funcs.
src/stdlib/SDL_string.c
     1.1 --- a/src/stdlib/SDL_string.c	Wed Feb 14 10:41:55 2007 +0000
     1.2 +++ b/src/stdlib/SDL_string.c	Thu Feb 15 11:14:24 2007 +0000
     1.3 @@ -46,7 +46,7 @@
     1.4      }
     1.5      for (;;) {
     1.6          int v;
     1.7 -        if (SDL_isdigit(*text)) {
     1.8 +        if (SDL_isdigit((unsigned char) *text)) {
     1.9              v = *text - '0';
    1.10          } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.11              v = 10 + (*text - 'A');
    1.12 @@ -82,7 +82,7 @@
    1.13      }
    1.14      for (;;) {
    1.15          int v;
    1.16 -        if (SDL_isdigit(*text)) {
    1.17 +        if (SDL_isdigit((unsigned char) *text)) {
    1.18              v = *text - '0';
    1.19          } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.20              v = 10 + (*text - 'A');
    1.21 @@ -114,7 +114,7 @@
    1.22      }
    1.23      for (;;) {
    1.24          int v;
    1.25 -        if (SDL_isdigit(*text)) {
    1.26 +        if (SDL_isdigit((unsigned char) *text)) {
    1.27              v = *text - '0';
    1.28          } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.29              v = 10 + (*text - 'A');
    1.30 @@ -152,7 +152,7 @@
    1.31      }
    1.32      for (;;) {
    1.33          int v;
    1.34 -        if (SDL_isdigit(*text)) {
    1.35 +        if (SDL_isdigit((unsigned char) *text)) {
    1.36              v = *text - '0';
    1.37          } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.38              v = 10 + (*text - 'A');
    1.39 @@ -188,7 +188,7 @@
    1.40      }
    1.41      for (;;) {
    1.42          int v;
    1.43 -        if (SDL_isdigit(*text)) {
    1.44 +        if (SDL_isdigit((unsigned char) *text)) {
    1.45              v = *text - '0';
    1.46          } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.47              v = 10 + (*text - 'A');
    1.48 @@ -227,7 +227,7 @@
    1.49      if (*text == '.') {
    1.50          int mult = 10;
    1.51          ++text;
    1.52 -        while (SDL_isdigit(*text)) {
    1.53 +        while (SDL_isdigit((unsigned char) *text)) {
    1.54              lvalue = *text - '0';
    1.55              value += (double) lvalue / mult;
    1.56              mult *= 10;
    1.57 @@ -411,7 +411,7 @@
    1.58  {
    1.59      char *bufp = string;
    1.60      while (*bufp) {
    1.61 -        *bufp = SDL_toupper(*bufp);
    1.62 +        *bufp = SDL_toupper((unsigned char) *bufp);
    1.63          ++bufp;
    1.64      }
    1.65      return string;
    1.66 @@ -424,7 +424,7 @@
    1.67  {
    1.68      char *bufp = string;
    1.69      while (*bufp) {
    1.70 -        *bufp = SDL_tolower(*bufp);
    1.71 +        *bufp = SDL_tolower((unsigned char) *bufp);
    1.72          ++bufp;
    1.73      }
    1.74      return string;
    1.75 @@ -743,8 +743,8 @@
    1.76      char a = 0;
    1.77      char b = 0;
    1.78      while (*str1 && *str2) {
    1.79 -        a = SDL_tolower(*str1);
    1.80 -        b = SDL_tolower(*str2);
    1.81 +        a = SDL_tolower((unsigned char) *str1);
    1.82 +        b = SDL_tolower((unsigned char) *str2);
    1.83          if (a != b)
    1.84              break;
    1.85          ++str1;
    1.86 @@ -763,8 +763,8 @@
    1.87      char a = 0;
    1.88      char b = 0;
    1.89      while (*str1 && *str2 && maxlen) {
    1.90 -        a = SDL_tolower(*str1);
    1.91 -        b = SDL_tolower(*str2);
    1.92 +        a = SDL_tolower((unsigned char) *str1);
    1.93 +        b = SDL_tolower((unsigned char) *str2);
    1.94          if (a != b)
    1.95              break;
    1.96          ++str1;
    1.97 @@ -787,7 +787,7 @@
    1.98      va_start(ap, fmt);
    1.99      while (*fmt) {
   1.100          if (*fmt == ' ') {
   1.101 -            while (SDL_isspace(*text)) {
   1.102 +            while (SDL_isspace((unsigned char) *text)) {
   1.103                  ++text;
   1.104              }
   1.105              ++fmt;
   1.106 @@ -839,7 +839,7 @@
   1.107                  continue;
   1.108              }
   1.109  
   1.110 -            while (SDL_isspace(*text)) {
   1.111 +            while (SDL_isspace((unsigned char) *text)) {
   1.112                  ++text;
   1.113              }
   1.114  
   1.115 @@ -872,7 +872,7 @@
   1.116                              ++index;
   1.117                          }
   1.118                          if (text[index] == '0') {
   1.119 -                            if (SDL_tolower(text[index + 1]) == 'x') {
   1.120 +                            if (SDL_tolower((unsigned char) text[index + 1]) == 'x') {
   1.121                                  radix = 16;
   1.122                              } else {
   1.123                                  radix = 8;
   1.124 @@ -1005,7 +1005,7 @@
   1.125                      break;
   1.126                  case 's':
   1.127                      if (suppress) {
   1.128 -                        while (!SDL_isspace(*text)) {
   1.129 +                        while (!SDL_isspace((unsigned char) *text)) {
   1.130                              ++text;
   1.131                              if (count) {
   1.132                                  if (--count == 0) {
   1.133 @@ -1015,7 +1015,7 @@
   1.134                          }
   1.135                      } else {
   1.136                          char *valuep = va_arg(ap, char *);
   1.137 -                        while (!SDL_isspace(*text)) {
   1.138 +                        while (!SDL_isspace((unsigned char) *text)) {
   1.139                              *valuep++ = *text++;
   1.140                              if (count) {
   1.141                                  if (--count == 0) {