src/stdlib/SDL_string.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
child 1693 504cb581ae1c
     1.1 --- a/src/stdlib/SDL_string.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/stdlib/SDL_string.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -31,7 +31,7 @@
     1.4  
     1.5  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
     1.6  static size_t
     1.7 -SDL_ScanLong (const char *text, int radix, long *valuep)
     1.8 +SDL_ScanLong(const char *text, int radix, long *valuep)
     1.9  {
    1.10      const char *textstart = text;
    1.11      long value = 0;
    1.12 @@ -41,16 +41,16 @@
    1.13          negative = SDL_TRUE;
    1.14          ++text;
    1.15      }
    1.16 -    if (radix == 16 && SDL_strncmp (text, "0x", 2) == 0) {
    1.17 +    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
    1.18          text += 2;
    1.19      }
    1.20      for (;;) {
    1.21          int v;
    1.22 -        if (SDL_isdigit (*text)) {
    1.23 +        if (SDL_isdigit(*text)) {
    1.24              v = *text - '0';
    1.25 -        } else if (radix == 16 && SDL_isupperhex (*text)) {
    1.26 +        } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.27              v = 10 + (*text - 'A');
    1.28 -        } else if (radix == 16 && SDL_islowerhex (*text)) {
    1.29 +        } else if (radix == 16 && SDL_islowerhex(*text)) {
    1.30              v = 10 + (*text - 'a');
    1.31          } else {
    1.32              break;
    1.33 @@ -72,21 +72,21 @@
    1.34  
    1.35  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOUL) || !defined(HAVE_STRTOD)
    1.36  static size_t
    1.37 -SDL_ScanUnsignedLong (const char *text, int radix, unsigned long *valuep)
    1.38 +SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *valuep)
    1.39  {
    1.40      const char *textstart = text;
    1.41      unsigned long value = 0;
    1.42  
    1.43 -    if (radix == 16 && SDL_strncmp (text, "0x", 2) == 0) {
    1.44 +    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
    1.45          text += 2;
    1.46      }
    1.47      for (;;) {
    1.48          int v;
    1.49 -        if (SDL_isdigit (*text)) {
    1.50 +        if (SDL_isdigit(*text)) {
    1.51              v = *text - '0';
    1.52 -        } else if (radix == 16 && SDL_isupperhex (*text)) {
    1.53 +        } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.54              v = 10 + (*text - 'A');
    1.55 -        } else if (radix == 16 && SDL_islowerhex (*text)) {
    1.56 +        } else if (radix == 16 && SDL_islowerhex(*text)) {
    1.57              v = 10 + (*text - 'a');
    1.58          } else {
    1.59              break;
    1.60 @@ -104,21 +104,21 @@
    1.61  
    1.62  #ifndef HAVE_SSCANF
    1.63  static size_t
    1.64 -SDL_ScanUintPtrT (const char *text, int radix, uintptr_t * valuep)
    1.65 +SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep)
    1.66  {
    1.67      const char *textstart = text;
    1.68      uintptr_t value = 0;
    1.69  
    1.70 -    if (radix == 16 && SDL_strncmp (text, "0x", 2) == 0) {
    1.71 +    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
    1.72          text += 2;
    1.73      }
    1.74      for (;;) {
    1.75          int v;
    1.76 -        if (SDL_isdigit (*text)) {
    1.77 +        if (SDL_isdigit(*text)) {
    1.78              v = *text - '0';
    1.79 -        } else if (radix == 16 && SDL_isupperhex (*text)) {
    1.80 +        } else if (radix == 16 && SDL_isupperhex(*text)) {
    1.81              v = 10 + (*text - 'A');
    1.82 -        } else if (radix == 16 && SDL_islowerhex (*text)) {
    1.83 +        } else if (radix == 16 && SDL_islowerhex(*text)) {
    1.84              v = 10 + (*text - 'a');
    1.85          } else {
    1.86              break;
    1.87 @@ -137,7 +137,7 @@
    1.88  #ifdef SDL_HAS_64BIT_TYPE
    1.89  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL)
    1.90  static size_t
    1.91 -SDL_ScanLongLong (const char *text, int radix, Sint64 * valuep)
    1.92 +SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep)
    1.93  {
    1.94      const char *textstart = text;
    1.95      Sint64 value = 0;
    1.96 @@ -147,16 +147,16 @@
    1.97          negative = SDL_TRUE;
    1.98          ++text;
    1.99      }
   1.100 -    if (radix == 16 && SDL_strncmp (text, "0x", 2) == 0) {
   1.101 +    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
   1.102          text += 2;
   1.103      }
   1.104      for (;;) {
   1.105          int v;
   1.106 -        if (SDL_isdigit (*text)) {
   1.107 +        if (SDL_isdigit(*text)) {
   1.108              v = *text - '0';
   1.109 -        } else if (radix == 16 && SDL_isupperhex (*text)) {
   1.110 +        } else if (radix == 16 && SDL_isupperhex(*text)) {
   1.111              v = 10 + (*text - 'A');
   1.112 -        } else if (radix == 16 && SDL_islowerhex (*text)) {
   1.113 +        } else if (radix == 16 && SDL_islowerhex(*text)) {
   1.114              v = 10 + (*text - 'a');
   1.115          } else {
   1.116              break;
   1.117 @@ -178,21 +178,21 @@
   1.118  
   1.119  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOULL)
   1.120  static size_t
   1.121 -SDL_ScanUnsignedLongLong (const char *text, int radix, Uint64 * valuep)
   1.122 +SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep)
   1.123  {
   1.124      const char *textstart = text;
   1.125      Uint64 value = 0;
   1.126  
   1.127 -    if (radix == 16 && SDL_strncmp (text, "0x", 2) == 0) {
   1.128 +    if (radix == 16 && SDL_strncmp(text, "0x", 2) == 0) {
   1.129          text += 2;
   1.130      }
   1.131      for (;;) {
   1.132          int v;
   1.133 -        if (SDL_isdigit (*text)) {
   1.134 +        if (SDL_isdigit(*text)) {
   1.135              v = *text - '0';
   1.136 -        } else if (radix == 16 && SDL_isupperhex (*text)) {
   1.137 +        } else if (radix == 16 && SDL_isupperhex(*text)) {
   1.138              v = 10 + (*text - 'A');
   1.139 -        } else if (radix == 16 && SDL_islowerhex (*text)) {
   1.140 +        } else if (radix == 16 && SDL_islowerhex(*text)) {
   1.141              v = 10 + (*text - 'a');
   1.142          } else {
   1.143              break;
   1.144 @@ -211,7 +211,7 @@
   1.145  
   1.146  #if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
   1.147  static size_t
   1.148 -SDL_ScanFloat (const char *text, double *valuep)
   1.149 +SDL_ScanFloat(const char *text, double *valuep)
   1.150  {
   1.151      const char *textstart = text;
   1.152      unsigned long lvalue = 0;
   1.153 @@ -222,12 +222,12 @@
   1.154          negative = SDL_TRUE;
   1.155          ++text;
   1.156      }
   1.157 -    text += SDL_ScanUnsignedLong (text, 10, &lvalue);
   1.158 +    text += SDL_ScanUnsignedLong(text, 10, &lvalue);
   1.159      value += lvalue;
   1.160      if (*text == '.') {
   1.161          int mult = 10;
   1.162          ++text;
   1.163 -        while (SDL_isdigit (*text)) {
   1.164 +        while (SDL_isdigit(*text)) {
   1.165              lvalue = *text - '0';
   1.166              value += (double) lvalue / mult;
   1.167              mult *= 10;
   1.168 @@ -247,7 +247,7 @@
   1.169  
   1.170  #ifndef SDL_memset
   1.171  void *
   1.172 -SDL_memset (void *dst, int c, size_t len)
   1.173 +SDL_memset(void *dst, int c, size_t len)
   1.174  {
   1.175      size_t left = (len % 4);
   1.176      if (len >= 4) {
   1.177 @@ -281,7 +281,7 @@
   1.178  
   1.179  #ifndef SDL_memcpy
   1.180  void *
   1.181 -SDL_memcpy (void *dst, const void *src, size_t len)
   1.182 +SDL_memcpy(void *dst, const void *src, size_t len)
   1.183  {
   1.184      char *srcp = (char *) src;
   1.185      char *dstp = (char *) dst;
   1.186 @@ -294,7 +294,7 @@
   1.187  
   1.188  #ifndef SDL_revcpy
   1.189  void *
   1.190 -SDL_revcpy (void *dst, const void *src, size_t len)
   1.191 +SDL_revcpy(void *dst, const void *src, size_t len)
   1.192  {
   1.193      char *srcp = (char *) src;
   1.194      char *dstp = (char *) dst;
   1.195 @@ -309,7 +309,7 @@
   1.196  
   1.197  #ifndef SDL_memcmp
   1.198  int
   1.199 -SDL_memcmp (const void *s1, const void *s2, size_t len)
   1.200 +SDL_memcmp(const void *s1, const void *s2, size_t len)
   1.201  {
   1.202      char *s1p = (char *) s1;
   1.203      char *s2p = (char *) s2;
   1.204 @@ -326,7 +326,7 @@
   1.205  
   1.206  #ifndef HAVE_STRLEN
   1.207  size_t
   1.208 -SDL_strlen (const char *string)
   1.209 +SDL_strlen(const char *string)
   1.210  {
   1.211      size_t len = 0;
   1.212      while (*string++) {
   1.213 @@ -338,12 +338,12 @@
   1.214  
   1.215  #ifndef HAVE_STRLCPY
   1.216  size_t
   1.217 -SDL_strlcpy (char *dst, const char *src, size_t maxlen)
   1.218 +SDL_strlcpy(char *dst, const char *src, size_t maxlen)
   1.219  {
   1.220 -    size_t srclen = SDL_strlen (src);
   1.221 +    size_t srclen = SDL_strlen(src);
   1.222      if (maxlen > 0) {
   1.223 -        size_t len = SDL_min (srclen, maxlen - 1);
   1.224 -        SDL_memcpy (dst, src, len);
   1.225 +        size_t len = SDL_min(srclen, maxlen - 1);
   1.226 +        SDL_memcpy(dst, src, len);
   1.227          dst[len] = '\0';
   1.228      }
   1.229      return srclen;
   1.230 @@ -352,12 +352,12 @@
   1.231  
   1.232  #ifndef HAVE_STRLCAT
   1.233  size_t
   1.234 -SDL_strlcat (char *dst, const char *src, size_t maxlen)
   1.235 +SDL_strlcat(char *dst, const char *src, size_t maxlen)
   1.236  {
   1.237 -    size_t dstlen = SDL_strlen (dst);
   1.238 -    size_t srclen = SDL_strlen (src);
   1.239 +    size_t dstlen = SDL_strlen(dst);
   1.240 +    size_t srclen = SDL_strlen(src);
   1.241      if (dstlen < maxlen) {
   1.242 -        SDL_strlcpy (dst + dstlen, src, maxlen - dstlen);
   1.243 +        SDL_strlcpy(dst + dstlen, src, maxlen - dstlen);
   1.244      }
   1.245      return dstlen + srclen;
   1.246  }
   1.247 @@ -365,12 +365,12 @@
   1.248  
   1.249  #ifndef HAVE_STRDUP
   1.250  char *
   1.251 -SDL_strdup (const char *string)
   1.252 +SDL_strdup(const char *string)
   1.253  {
   1.254 -    size_t len = SDL_strlen (string) + 1;
   1.255 -    char *newstr = SDL_malloc (len);
   1.256 +    size_t len = SDL_strlen(string) + 1;
   1.257 +    char *newstr = SDL_malloc(len);
   1.258      if (newstr) {
   1.259 -        SDL_strlcpy (newstr, string, len);
   1.260 +        SDL_strlcpy(newstr, string, len);
   1.261      }
   1.262      return newstr;
   1.263  }
   1.264 @@ -378,9 +378,9 @@
   1.265  
   1.266  #ifndef HAVE__STRREV
   1.267  char *
   1.268 -SDL_strrev (char *string)
   1.269 +SDL_strrev(char *string)
   1.270  {
   1.271 -    size_t len = SDL_strlen (string);
   1.272 +    size_t len = SDL_strlen(string);
   1.273      char *a = &string[0];
   1.274      char *b = &string[len - 1];
   1.275      len /= 2;
   1.276 @@ -395,11 +395,11 @@
   1.277  
   1.278  #ifndef HAVE__STRUPR
   1.279  char *
   1.280 -SDL_strupr (char *string)
   1.281 +SDL_strupr(char *string)
   1.282  {
   1.283      char *bufp = string;
   1.284      while (*bufp) {
   1.285 -        *bufp = SDL_toupper (*bufp);
   1.286 +        *bufp = SDL_toupper(*bufp);
   1.287          ++bufp;
   1.288      }
   1.289      return string;
   1.290 @@ -408,11 +408,11 @@
   1.291  
   1.292  #ifndef HAVE__STRLWR
   1.293  char *
   1.294 -SDL_strlwr (char *string)
   1.295 +SDL_strlwr(char *string)
   1.296  {
   1.297      char *bufp = string;
   1.298      while (*bufp) {
   1.299 -        *bufp = SDL_tolower (*bufp);
   1.300 +        *bufp = SDL_tolower(*bufp);
   1.301          ++bufp;
   1.302      }
   1.303      return string;
   1.304 @@ -421,7 +421,7 @@
   1.305  
   1.306  #ifndef HAVE_STRCHR
   1.307  char *
   1.308 -SDL_strchr (const char *string, int c)
   1.309 +SDL_strchr(const char *string, int c)
   1.310  {
   1.311      while (*string) {
   1.312          if (*string == c) {
   1.313 @@ -435,9 +435,9 @@
   1.314  
   1.315  #ifndef HAVE_STRRCHR
   1.316  char *
   1.317 -SDL_strrchr (const char *string, int c)
   1.318 +SDL_strrchr(const char *string, int c)
   1.319  {
   1.320 -    const char *bufp = string + SDL_strlen (string) - 1;
   1.321 +    const char *bufp = string + SDL_strlen(string) - 1;
   1.322      while (bufp >= string) {
   1.323          if (*bufp == c) {
   1.324              return (char *) bufp;
   1.325 @@ -450,11 +450,11 @@
   1.326  
   1.327  #ifndef HAVE_STRSTR
   1.328  char *
   1.329 -SDL_strstr (const char *haystack, const char *needle)
   1.330 +SDL_strstr(const char *haystack, const char *needle)
   1.331  {
   1.332 -    size_t length = SDL_strlen (needle);
   1.333 +    size_t length = SDL_strlen(needle);
   1.334      while (*haystack) {
   1.335 -        if (SDL_strncmp (haystack, needle, length) == 0) {
   1.336 +        if (SDL_strncmp(haystack, needle, length) == 0) {
   1.337              return (char *) haystack;
   1.338          }
   1.339          ++haystack;
   1.340 @@ -475,7 +475,7 @@
   1.341  
   1.342  #ifndef HAVE__LTOA
   1.343  char *
   1.344 -SDL_ltoa (long value, char *string, int radix)
   1.345 +SDL_ltoa(long value, char *string, int radix)
   1.346  {
   1.347      char *bufp = string;
   1.348  
   1.349 @@ -495,9 +495,9 @@
   1.350  
   1.351      /* The numbers went into the string backwards. :) */
   1.352      if (*string == '-') {
   1.353 -        SDL_strrev (string + 1);
   1.354 +        SDL_strrev(string + 1);
   1.355      } else {
   1.356 -        SDL_strrev (string);
   1.357 +        SDL_strrev(string);
   1.358      }
   1.359  
   1.360      return string;
   1.361 @@ -506,7 +506,7 @@
   1.362  
   1.363  #ifndef HAVE__ULTOA
   1.364  char *
   1.365 -SDL_ultoa (unsigned long value, char *string, int radix)
   1.366 +SDL_ultoa(unsigned long value, char *string, int radix)
   1.367  {
   1.368      char *bufp = string;
   1.369  
   1.370 @@ -521,7 +521,7 @@
   1.371      *bufp = '\0';
   1.372  
   1.373      /* The numbers went into the string backwards. :) */
   1.374 -    SDL_strrev (string);
   1.375 +    SDL_strrev(string);
   1.376  
   1.377      return string;
   1.378  }
   1.379 @@ -529,12 +529,12 @@
   1.380  
   1.381  #ifndef HAVE_STRTOL
   1.382  long
   1.383 -SDL_strtol (const char *string, char **endp, int base)
   1.384 +SDL_strtol(const char *string, char **endp, int base)
   1.385  {
   1.386      size_t len;
   1.387      long value;
   1.388  
   1.389 -    len = SDL_ScanLong (string, base ? base : 10, &value);
   1.390 +    len = SDL_ScanLong(string, base ? base : 10, &value);
   1.391      if (endp) {
   1.392          *endp = (char *) string + len;
   1.393      }
   1.394 @@ -544,12 +544,12 @@
   1.395  
   1.396  #ifndef HAVE_STRTOUL
   1.397  unsigned long
   1.398 -SDL_strtoul (const char *string, char **endp, int base)
   1.399 +SDL_strtoul(const char *string, char **endp, int base)
   1.400  {
   1.401      size_t len;
   1.402      unsigned long value;
   1.403  
   1.404 -    len = SDL_ScanUnsignedLong (string, base ? base : 10, &value);
   1.405 +    len = SDL_ScanUnsignedLong(string, base ? base : 10, &value);
   1.406      if (endp) {
   1.407          *endp = (char *) string + len;
   1.408      }
   1.409 @@ -561,7 +561,7 @@
   1.410  
   1.411  #ifndef HAVE__I64TOA
   1.412  char *
   1.413 -SDL_lltoa (Sint64 value, char *string, int radix)
   1.414 +SDL_lltoa(Sint64 value, char *string, int radix)
   1.415  {
   1.416      char *bufp = string;
   1.417  
   1.418 @@ -581,9 +581,9 @@
   1.419  
   1.420      /* The numbers went into the string backwards. :) */
   1.421      if (*string == '-') {
   1.422 -        SDL_strrev (string + 1);
   1.423 +        SDL_strrev(string + 1);
   1.424      } else {
   1.425 -        SDL_strrev (string);
   1.426 +        SDL_strrev(string);
   1.427      }
   1.428  
   1.429      return string;
   1.430 @@ -592,7 +592,7 @@
   1.431  
   1.432  #ifndef HAVE__UI64TOA
   1.433  char *
   1.434 -SDL_ulltoa (Uint64 value, char *string, int radix)
   1.435 +SDL_ulltoa(Uint64 value, char *string, int radix)
   1.436  {
   1.437      char *bufp = string;
   1.438  
   1.439 @@ -607,7 +607,7 @@
   1.440      *bufp = '\0';
   1.441  
   1.442      /* The numbers went into the string backwards. :) */
   1.443 -    SDL_strrev (string);
   1.444 +    SDL_strrev(string);
   1.445  
   1.446      return string;
   1.447  }
   1.448 @@ -615,12 +615,12 @@
   1.449  
   1.450  #ifndef HAVE_STRTOLL
   1.451  Sint64
   1.452 -SDL_strtoll (const char *string, char **endp, int base)
   1.453 +SDL_strtoll(const char *string, char **endp, int base)
   1.454  {
   1.455      size_t len;
   1.456      Sint64 value;
   1.457  
   1.458 -    len = SDL_ScanLongLong (string, base ? base : 10, &value);
   1.459 +    len = SDL_ScanLongLong(string, base ? base : 10, &value);
   1.460      if (endp) {
   1.461          *endp = (char *) string + len;
   1.462      }
   1.463 @@ -630,12 +630,12 @@
   1.464  
   1.465  #ifndef HAVE_STRTOULL
   1.466  Uint64
   1.467 -SDL_strtoull (const char *string, char **endp, int base)
   1.468 +SDL_strtoull(const char *string, char **endp, int base)
   1.469  {
   1.470      size_t len;
   1.471      Uint64 value;
   1.472  
   1.473 -    len = SDL_ScanUnsignedLongLong (string, base ? base : 10, &value);
   1.474 +    len = SDL_ScanUnsignedLongLong(string, base ? base : 10, &value);
   1.475      if (endp) {
   1.476          *endp = (char *) string + len;
   1.477      }
   1.478 @@ -647,12 +647,12 @@
   1.479  
   1.480  #ifndef HAVE_STRTOD
   1.481  double
   1.482 -SDL_strtod (const char *string, char **endp)
   1.483 +SDL_strtod(const char *string, char **endp)
   1.484  {
   1.485      size_t len;
   1.486      double value;
   1.487  
   1.488 -    len = SDL_ScanFloat (string, &value);
   1.489 +    len = SDL_ScanFloat(string, &value);
   1.490      if (endp) {
   1.491          *endp = (char *) string + len;
   1.492      }
   1.493 @@ -662,7 +662,7 @@
   1.494  
   1.495  #ifndef HAVE_STRCMP
   1.496  int
   1.497 -SDL_strcmp (const char *str1, const char *str2)
   1.498 +SDL_strcmp(const char *str1, const char *str2)
   1.499  {
   1.500      while (*str1 && *str2) {
   1.501          if (*str1 != *str2)
   1.502 @@ -676,7 +676,7 @@
   1.503  
   1.504  #ifndef HAVE_STRNCMP
   1.505  int
   1.506 -SDL_strncmp (const char *str1, const char *str2, size_t maxlen)
   1.507 +SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
   1.508  {
   1.509      while (*str1 && *str2 && maxlen) {
   1.510          if (*str1 != *str2)
   1.511 @@ -694,13 +694,13 @@
   1.512  
   1.513  #if !defined(HAVE_STRCASECMP) && !defined(HAVE__STRICMP)
   1.514  int
   1.515 -SDL_strcasecmp (const char *str1, const char *str2)
   1.516 +SDL_strcasecmp(const char *str1, const char *str2)
   1.517  {
   1.518      char a = 0;
   1.519      char b = 0;
   1.520      while (*str1 && *str2) {
   1.521 -        a = SDL_tolower (*str1);
   1.522 -        b = SDL_tolower (*str2);
   1.523 +        a = SDL_tolower(*str1);
   1.524 +        b = SDL_tolower(*str2);
   1.525          if (a != b)
   1.526              break;
   1.527          ++str1;
   1.528 @@ -712,13 +712,13 @@
   1.529  
   1.530  #if !defined(HAVE_STRNCASECMP) && !defined(HAVE__STRNICMP)
   1.531  int
   1.532 -SDL_strncasecmp (const char *str1, const char *str2, size_t maxlen)
   1.533 +SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen)
   1.534  {
   1.535      char a = 0;
   1.536      char b = 0;
   1.537      while (*str1 && *str2 && maxlen) {
   1.538 -        a = SDL_tolower (*str1);
   1.539 -        b = SDL_tolower (*str2);
   1.540 +        a = SDL_tolower(*str1);
   1.541 +        b = SDL_tolower(*str2);
   1.542          if (a != b)
   1.543              break;
   1.544          ++str1;
   1.545 @@ -731,15 +731,15 @@
   1.546  
   1.547  #ifndef HAVE_SSCANF
   1.548  int
   1.549 -SDL_sscanf (const char *text, const char *fmt, ...)
   1.550 +SDL_sscanf(const char *text, const char *fmt, ...)
   1.551  {
   1.552      va_list ap;
   1.553      int retval = 0;
   1.554  
   1.555 -    va_start (ap, fmt);
   1.556 +    va_start(ap, fmt);
   1.557      while (*fmt) {
   1.558          if (*fmt == ' ') {
   1.559 -            while (SDL_isspace (*text)) {
   1.560 +            while (SDL_isspace(*text)) {
   1.561                  ++text;
   1.562              }
   1.563              ++fmt;
   1.564 @@ -771,7 +771,7 @@
   1.565                  suppress = SDL_TRUE;
   1.566                  ++fmt;
   1.567              }
   1.568 -            fmt += SDL_ScanLong (fmt, 10, &count);
   1.569 +            fmt += SDL_ScanLong(fmt, 10, &count);
   1.570  
   1.571              if (*fmt == 'c') {
   1.572                  if (!count) {
   1.573 @@ -782,7 +782,7 @@
   1.574                          ++text;
   1.575                      }
   1.576                  } else {
   1.577 -                    char *valuep = va_arg (ap, char *);
   1.578 +                    char *valuep = va_arg(ap, char *);
   1.579                      while (count--) {
   1.580                          *valuep++ = *text++;
   1.581                      }
   1.582 @@ -791,7 +791,7 @@
   1.583                  continue;
   1.584              }
   1.585  
   1.586 -            while (SDL_isspace (*text)) {
   1.587 +            while (SDL_isspace(*text)) {
   1.588                  ++text;
   1.589              }
   1.590  
   1.591 @@ -812,7 +812,7 @@
   1.592                      }
   1.593                      break;
   1.594                  case 'I':
   1.595 -                    if (SDL_strncmp (fmt, "I64", 3) == 0) {
   1.596 +                    if (SDL_strncmp(fmt, "I64", 3) == 0) {
   1.597                          fmt += 2;
   1.598                          inttype = DO_LONGLONG;
   1.599                      }
   1.600 @@ -824,7 +824,7 @@
   1.601                              ++index;
   1.602                          }
   1.603                          if (text[index] == '0') {
   1.604 -                            if (SDL_tolower (text[index + 1]) == 'x') {
   1.605 +                            if (SDL_tolower(text[index + 1]) == 'x') {
   1.606                                  radix = 16;
   1.607                              } else {
   1.608                                  radix = 8;
   1.609 @@ -836,9 +836,9 @@
   1.610  #ifdef SDL_HAS_64BIT_TYPE
   1.611                      if (inttype == DO_LONGLONG) {
   1.612                          Sint64 value;
   1.613 -                        text += SDL_ScanLongLong (text, radix, &value);
   1.614 +                        text += SDL_ScanLongLong(text, radix, &value);
   1.615                          if (!suppress) {
   1.616 -                            Sint64 *valuep = va_arg (ap, Sint64 *);
   1.617 +                            Sint64 *valuep = va_arg(ap, Sint64 *);
   1.618                              *valuep = value;
   1.619                              ++retval;
   1.620                          }
   1.621 @@ -846,24 +846,24 @@
   1.622  #endif /* SDL_HAS_64BIT_TYPE */
   1.623                      {
   1.624                          long value;
   1.625 -                        text += SDL_ScanLong (text, radix, &value);
   1.626 +                        text += SDL_ScanLong(text, radix, &value);
   1.627                          if (!suppress) {
   1.628                              switch (inttype) {
   1.629                              case DO_SHORT:
   1.630                                  {
   1.631 -                                    short *valuep = va_arg (ap, short *);
   1.632 +                                    short *valuep = va_arg(ap, short *);
   1.633                                      *valuep = (short) value;
   1.634                                  }
   1.635                                  break;
   1.636                              case DO_INT:
   1.637                                  {
   1.638 -                                    int *valuep = va_arg (ap, int *);
   1.639 +                                    int *valuep = va_arg(ap, int *);
   1.640                                      *valuep = (int) value;
   1.641                                  }
   1.642                                  break;
   1.643                              case DO_LONG:
   1.644                                  {
   1.645 -                                    long *valuep = va_arg (ap, long *);
   1.646 +                                    long *valuep = va_arg(ap, long *);
   1.647                                      *valuep = value;
   1.648                                  }
   1.649                                  break;
   1.650 @@ -891,10 +891,9 @@
   1.651  #ifdef SDL_HAS_64BIT_TYPE
   1.652                      if (inttype == DO_LONGLONG) {
   1.653                          Uint64 value;
   1.654 -                        text +=
   1.655 -                            SDL_ScanUnsignedLongLong (text, radix, &value);
   1.656 +                        text += SDL_ScanUnsignedLongLong(text, radix, &value);
   1.657                          if (!suppress) {
   1.658 -                            Uint64 *valuep = va_arg (ap, Uint64 *);
   1.659 +                            Uint64 *valuep = va_arg(ap, Uint64 *);
   1.660                              *valuep = value;
   1.661                              ++retval;
   1.662                          }
   1.663 @@ -902,24 +901,24 @@
   1.664  #endif /* SDL_HAS_64BIT_TYPE */
   1.665                      {
   1.666                          unsigned long value;
   1.667 -                        text += SDL_ScanUnsignedLong (text, radix, &value);
   1.668 +                        text += SDL_ScanUnsignedLong(text, radix, &value);
   1.669                          if (!suppress) {
   1.670                              switch (inttype) {
   1.671                              case DO_SHORT:
   1.672                                  {
   1.673 -                                    short *valuep = va_arg (ap, short *);
   1.674 +                                    short *valuep = va_arg(ap, short *);
   1.675                                      *valuep = (short) value;
   1.676                                  }
   1.677                                  break;
   1.678                              case DO_INT:
   1.679                                  {
   1.680 -                                    int *valuep = va_arg (ap, int *);
   1.681 +                                    int *valuep = va_arg(ap, int *);
   1.682                                      *valuep = (int) value;
   1.683                                  }
   1.684                                  break;
   1.685                              case DO_LONG:
   1.686                                  {
   1.687 -                                    long *valuep = va_arg (ap, long *);
   1.688 +                                    long *valuep = va_arg(ap, long *);
   1.689                                      *valuep = value;
   1.690                                  }
   1.691                                  break;
   1.692 @@ -935,9 +934,9 @@
   1.693                  case 'p':
   1.694                      {
   1.695                          uintptr_t value;
   1.696 -                        text += SDL_ScanUintPtrT (text, 16, &value);
   1.697 +                        text += SDL_ScanUintPtrT(text, 16, &value);
   1.698                          if (!suppress) {
   1.699 -                            void **valuep = va_arg (ap, void **);
   1.700 +                            void **valuep = va_arg(ap, void **);
   1.701                              *valuep = (void *) value;
   1.702                              ++retval;
   1.703                          }
   1.704 @@ -947,9 +946,9 @@
   1.705                  case 'f':
   1.706                      {
   1.707                          double value;
   1.708 -                        text += SDL_ScanFloat (text, &value);
   1.709 +                        text += SDL_ScanFloat(text, &value);
   1.710                          if (!suppress) {
   1.711 -                            float *valuep = va_arg (ap, float *);
   1.712 +                            float *valuep = va_arg(ap, float *);
   1.713                              *valuep = (float) value;
   1.714                              ++retval;
   1.715                          }
   1.716 @@ -958,7 +957,7 @@
   1.717                      break;
   1.718                  case 's':
   1.719                      if (suppress) {
   1.720 -                        while (!SDL_isspace (*text)) {
   1.721 +                        while (!SDL_isspace(*text)) {
   1.722                              ++text;
   1.723                              if (count) {
   1.724                                  if (--count == 0) {
   1.725 @@ -967,8 +966,8 @@
   1.726                              }
   1.727                          }
   1.728                      } else {
   1.729 -                        char *valuep = va_arg (ap, char *);
   1.730 -                        while (!SDL_isspace (*text)) {
   1.731 +                        char *valuep = va_arg(ap, char *);
   1.732 +                        while (!SDL_isspace(*text)) {
   1.733                              *valuep++ = *text++;
   1.734                              if (count) {
   1.735                                  if (--count == 0) {
   1.736 @@ -997,7 +996,7 @@
   1.737          /* Text didn't match format specifier */
   1.738          break;
   1.739      }
   1.740 -    va_end (ap);
   1.741 +    va_end(ap);
   1.742  
   1.743      return retval;
   1.744  }
   1.745 @@ -1005,14 +1004,14 @@
   1.746  
   1.747  #ifndef HAVE_SNPRINTF
   1.748  int
   1.749 -SDL_snprintf (char *text, size_t maxlen, const char *fmt, ...)
   1.750 +SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...)
   1.751  {
   1.752      va_list ap;
   1.753      int retval;
   1.754  
   1.755 -    va_start (ap, fmt);
   1.756 -    retval = SDL_vsnprintf (text, maxlen, fmt, ap);
   1.757 -    va_end (ap);
   1.758 +    va_start(ap, fmt);
   1.759 +    retval = SDL_vsnprintf(text, maxlen, fmt, ap);
   1.760 +    va_end(ap);
   1.761  
   1.762      return retval;
   1.763  }
   1.764 @@ -1020,73 +1019,73 @@
   1.765  
   1.766  #ifndef HAVE_VSNPRINTF
   1.767  static size_t
   1.768 -SDL_PrintLong (char *text, long value, int radix, size_t maxlen)
   1.769 +SDL_PrintLong(char *text, long value, int radix, size_t maxlen)
   1.770  {
   1.771      char num[130];
   1.772      size_t size;
   1.773  
   1.774 -    SDL_ltoa (value, num, radix);
   1.775 -    size = SDL_strlen (num);
   1.776 +    SDL_ltoa(value, num, radix);
   1.777 +    size = SDL_strlen(num);
   1.778      if (size >= maxlen) {
   1.779          size = maxlen - 1;
   1.780      }
   1.781 -    SDL_strlcpy (text, num, size + 1);
   1.782 +    SDL_strlcpy(text, num, size + 1);
   1.783  
   1.784      return size;
   1.785  }
   1.786  
   1.787  static size_t
   1.788 -SDL_PrintUnsignedLong (char *text, unsigned long value, int radix,
   1.789 -                       size_t maxlen)
   1.790 +SDL_PrintUnsignedLong(char *text, unsigned long value, int radix,
   1.791 +                      size_t maxlen)
   1.792  {
   1.793      char num[130];
   1.794      size_t size;
   1.795  
   1.796 -    SDL_ultoa (value, num, radix);
   1.797 -    size = SDL_strlen (num);
   1.798 +    SDL_ultoa(value, num, radix);
   1.799 +    size = SDL_strlen(num);
   1.800      if (size >= maxlen) {
   1.801          size = maxlen - 1;
   1.802      }
   1.803 -    SDL_strlcpy (text, num, size + 1);
   1.804 +    SDL_strlcpy(text, num, size + 1);
   1.805  
   1.806      return size;
   1.807  }
   1.808  
   1.809  #ifdef SDL_HAS_64BIT_TYPE
   1.810  static size_t
   1.811 -SDL_PrintLongLong (char *text, Sint64 value, int radix, size_t maxlen)
   1.812 +SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen)
   1.813  {
   1.814      char num[130];
   1.815      size_t size;
   1.816  
   1.817 -    SDL_lltoa (value, num, radix);
   1.818 -    size = SDL_strlen (num);
   1.819 +    SDL_lltoa(value, num, radix);
   1.820 +    size = SDL_strlen(num);
   1.821      if (size >= maxlen) {
   1.822          size = maxlen - 1;
   1.823      }
   1.824 -    SDL_strlcpy (text, num, size + 1);
   1.825 +    SDL_strlcpy(text, num, size + 1);
   1.826  
   1.827      return size;
   1.828  }
   1.829  
   1.830  static size_t
   1.831 -SDL_PrintUnsignedLongLong (char *text, Uint64 value, int radix, size_t maxlen)
   1.832 +SDL_PrintUnsignedLongLong(char *text, Uint64 value, int radix, size_t maxlen)
   1.833  {
   1.834      char num[130];
   1.835      size_t size;
   1.836  
   1.837 -    SDL_ulltoa (value, num, radix);
   1.838 -    size = SDL_strlen (num);
   1.839 +    SDL_ulltoa(value, num, radix);
   1.840 +    size = SDL_strlen(num);
   1.841      if (size >= maxlen) {
   1.842          size = maxlen - 1;
   1.843      }
   1.844 -    SDL_strlcpy (text, num, size + 1);
   1.845 +    SDL_strlcpy(text, num, size + 1);
   1.846  
   1.847      return size;
   1.848  }
   1.849  #endif /* SDL_HAS_64BIT_TYPE */
   1.850  static size_t
   1.851 -SDL_PrintFloat (char *text, double arg, size_t maxlen)
   1.852 +SDL_PrintFloat(char *text, double arg, size_t maxlen)
   1.853  {
   1.854      char *textstart = text;
   1.855      if (arg) {
   1.856 @@ -1101,7 +1100,7 @@
   1.857              arg = -arg;
   1.858          }
   1.859          value = (unsigned long) arg;
   1.860 -        len = SDL_PrintUnsignedLong (text, value, 10, maxlen);
   1.861 +        len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
   1.862          text += len;
   1.863          maxlen -= len;
   1.864          arg -= value;
   1.865 @@ -1110,7 +1109,7 @@
   1.866              *text++ = '.';
   1.867              while ((arg > precision) && maxlen) {
   1.868                  value = (unsigned long) (arg * mult);
   1.869 -                len = SDL_PrintUnsignedLong (text, value, 10, maxlen);
   1.870 +                len = SDL_PrintUnsignedLong(text, value, 10, maxlen);
   1.871                  text += len;
   1.872                  maxlen -= len;
   1.873                  arg -= (double) value / mult;
   1.874 @@ -1124,7 +1123,7 @@
   1.875  }
   1.876  
   1.877  static size_t
   1.878 -SDL_PrintString (char *text, const char *string, size_t maxlen)
   1.879 +SDL_PrintString(char *text, const char *string, size_t maxlen)
   1.880  {
   1.881      char *textstart = text;
   1.882      while (*string && maxlen--) {
   1.883 @@ -1134,7 +1133,7 @@
   1.884  }
   1.885  
   1.886  int
   1.887 -SDL_vsnprintf (char *text, size_t maxlen, const char *fmt, va_list ap)
   1.888 +SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
   1.889  {
   1.890      char *textstart = text;
   1.891      if (maxlen <= 0) {
   1.892 @@ -1168,7 +1167,7 @@
   1.893                      break;
   1.894                  case 'c':
   1.895                      /* char is promoted to int when passed through (...) */
   1.896 -                    *text = (char) va_arg (ap, int);
   1.897 +                    *text = (char) va_arg(ap, int);
   1.898                      len = 1;
   1.899                      done = SDL_TRUE;
   1.900                      break;
   1.901 @@ -1181,7 +1180,7 @@
   1.902                      }
   1.903                      break;
   1.904                  case 'I':
   1.905 -                    if (SDL_strncmp (fmt, "I64", 3) == 0) {
   1.906 +                    if (SDL_strncmp(fmt, "I64", 3) == 0) {
   1.907                          fmt += 2;
   1.908                          inttype = DO_LONGLONG;
   1.909                      }
   1.910 @@ -1191,25 +1190,25 @@
   1.911                      switch (inttype) {
   1.912                      case DO_INT:
   1.913                          len =
   1.914 -                            SDL_PrintLong (text,
   1.915 -                                           (long) va_arg (ap, int),
   1.916 -                                           radix, maxlen);
   1.917 +                            SDL_PrintLong(text,
   1.918 +                                          (long) va_arg(ap, int),
   1.919 +                                          radix, maxlen);
   1.920                          break;
   1.921                      case DO_LONG:
   1.922                          len =
   1.923 -                            SDL_PrintLong (text, va_arg (ap, long),
   1.924 -                                           radix, maxlen);
   1.925 +                            SDL_PrintLong(text, va_arg(ap, long),
   1.926 +                                          radix, maxlen);
   1.927                          break;
   1.928                      case DO_LONGLONG:
   1.929  #ifdef SDL_HAS_64BIT_TYPE
   1.930                          len =
   1.931 -                            SDL_PrintLongLong (text,
   1.932 -                                               va_arg (ap, Sint64),
   1.933 -                                               radix, maxlen);
   1.934 +                            SDL_PrintLongLong(text,
   1.935 +                                              va_arg(ap, Sint64),
   1.936 +                                              radix, maxlen);
   1.937  #else
   1.938                          len =
   1.939 -                            SDL_PrintLong (text, va_arg (ap, long),
   1.940 -                                           radix, maxlen);
   1.941 +                            SDL_PrintLong(text, va_arg(ap, long),
   1.942 +                                          radix, maxlen);
   1.943  #endif
   1.944                          break;
   1.945                      }
   1.946 @@ -1235,48 +1234,48 @@
   1.947                  case 'u':
   1.948                      switch (inttype) {
   1.949                      case DO_INT:
   1.950 -                        len = SDL_PrintUnsignedLong (text, (unsigned long)
   1.951 -                                                     va_arg (ap,
   1.952 -                                                             unsigned
   1.953 -                                                             int),
   1.954 -                                                     radix, maxlen);
   1.955 +                        len = SDL_PrintUnsignedLong(text, (unsigned long)
   1.956 +                                                    va_arg(ap,
   1.957 +                                                           unsigned
   1.958 +                                                           int),
   1.959 +                                                    radix, maxlen);
   1.960                          break;
   1.961                      case DO_LONG:
   1.962                          len =
   1.963 -                            SDL_PrintUnsignedLong (text,
   1.964 -                                                   va_arg (ap,
   1.965 -                                                           unsigned
   1.966 -                                                           long),
   1.967 -                                                   radix, maxlen);
   1.968 +                            SDL_PrintUnsignedLong(text,
   1.969 +                                                  va_arg(ap,
   1.970 +                                                         unsigned
   1.971 +                                                         long),
   1.972 +                                                  radix, maxlen);
   1.973                          break;
   1.974                      case DO_LONGLONG:
   1.975  #ifdef SDL_HAS_64BIT_TYPE
   1.976                          len =
   1.977 -                            SDL_PrintUnsignedLongLong (text,
   1.978 -                                                       va_arg (ap,
   1.979 -                                                               Uint64),
   1.980 -                                                       radix, maxlen);
   1.981 +                            SDL_PrintUnsignedLongLong(text,
   1.982 +                                                      va_arg(ap,
   1.983 +                                                             Uint64),
   1.984 +                                                      radix, maxlen);
   1.985  #else
   1.986                          len =
   1.987 -                            SDL_PrintUnsignedLong (text,
   1.988 -                                                   va_arg (ap,
   1.989 -                                                           unsigned
   1.990 -                                                           long),
   1.991 -                                                   radix, maxlen);
   1.992 +                            SDL_PrintUnsignedLong(text,
   1.993 +                                                  va_arg(ap,
   1.994 +                                                         unsigned
   1.995 +                                                         long),
   1.996 +                                                  radix, maxlen);
   1.997  #endif
   1.998                          break;
   1.999                      }
  1.1000                      if (do_lowercase) {
  1.1001 -                        SDL_strlwr (text);
  1.1002 +                        SDL_strlwr(text);
  1.1003                      }
  1.1004                      done = SDL_TRUE;
  1.1005                      break;
  1.1006                  case 'f':
  1.1007 -                    len = SDL_PrintFloat (text, va_arg (ap, double), maxlen);
  1.1008 +                    len = SDL_PrintFloat(text, va_arg(ap, double), maxlen);
  1.1009                      done = SDL_TRUE;
  1.1010                      break;
  1.1011                  case 's':
  1.1012 -                    len = SDL_PrintString (text, va_arg (ap, char *), maxlen);
  1.1013 +                    len = SDL_PrintString(text, va_arg(ap, char *), maxlen);
  1.1014                      done = SDL_TRUE;
  1.1015                      break;
  1.1016                  default: