~ubuntu-branches/ubuntu/natty/libsdl1.2/natty

« back to all changes in this revision

Viewing changes to src/stdlib/SDL_string.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 20:29:43 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205202943-ryogi07hodn5cdif
Tags: 1.2.12-1ubuntu1
* Merge with Debian; remaining changes:
  - Remove svgalib support.
  - Prefer libgl1-mesa-dev build-dependency over xlibmesa-gl-dev.
  - Build for lpia as for i386.
* Link using -Wl,-Bsymbolic-functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    }
46
46
    for ( ; ; ) {
47
47
        int v;
48
 
        if ( SDL_isdigit(*text) ) {
 
48
        if ( SDL_isdigit((unsigned char) *text) ) {
49
49
            v = *text - '0';
50
50
        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
51
51
            v = 10 + (*text - 'A');
80
80
    }
81
81
    for ( ; ; ) {
82
82
        int v;
83
 
        if ( SDL_isdigit(*text) ) {
 
83
        if ( SDL_isdigit((unsigned char) *text) ) {
84
84
            v = *text - '0';
85
85
        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
86
86
            v = 10 + (*text - 'A');
111
111
    }
112
112
    for ( ; ; ) {
113
113
        int v;
114
 
        if ( SDL_isdigit(*text) ) {
 
114
        if ( SDL_isdigit((unsigned char) *text) ) {
115
115
            v = *text - '0';
116
116
        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
117
117
            v = 10 + (*text - 'A');
148
148
    }
149
149
    for ( ; ; ) {
150
150
        int v;
151
 
        if ( SDL_isdigit(*text) ) {
 
151
        if ( SDL_isdigit((unsigned char) *text) ) {
152
152
            v = *text - '0';
153
153
        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
154
154
            v = 10 + (*text - 'A');
183
183
    }
184
184
    for ( ; ; ) {
185
185
        int v;
186
 
        if ( SDL_isdigit(*text) ) {
 
186
        if ( SDL_isdigit((unsigned char) *text) ) {
187
187
            v = *text - '0';
188
188
        } else if ( radix == 16 && SDL_isupperhex(*text) ) {
189
189
            v = 10 + (*text - 'A');
221
221
    if ( *text == '.' ) {
222
222
        int mult = 10;
223
223
        ++text;
224
 
        while ( SDL_isdigit(*text) ) {
 
224
        while ( SDL_isdigit((unsigned char) *text) ) {
225
225
            lvalue = *text - '0';
226
226
            value += (double)lvalue / mult;
227
227
            mult *= 10;
289
289
{
290
290
    char *srcp = (char *)src;
291
291
    char *dstp = (char *)dst;
292
 
    srcp += len;
293
 
    dstp += len;
 
292
    srcp += len-1;
 
293
    dstp += len-1;
294
294
    while ( len-- ) {
295
295
        *dstp-- = *srcp--;
296
296
    }
383
383
{
384
384
    char *bufp = string;
385
385
    while ( *bufp ) {
386
 
        *bufp = SDL_toupper(*bufp);
 
386
        *bufp = SDL_toupper((unsigned char) *bufp);
387
387
        ++bufp;
388
388
    }
389
389
    return string;
395
395
{
396
396
    char *bufp = string;
397
397
    while ( *bufp ) {
398
 
        *bufp = SDL_tolower(*bufp);
 
398
        *bufp = SDL_tolower((unsigned char) *bufp);
399
399
        ++bufp;
400
400
    }
401
401
    return string;
699
699
    char a = 0;
700
700
    char b = 0;
701
701
    while ( *str1 && *str2 ) {
702
 
        a = SDL_tolower(*str1);
703
 
        b = SDL_tolower(*str2);
 
702
        a = SDL_tolower((unsigned char) *str1);
 
703
        b = SDL_tolower((unsigned char) *str2);
704
704
        if ( a != b )
705
705
            break;
706
706
        ++str1;
716
716
    char a = 0;
717
717
    char b = 0;
718
718
    while ( *str1 && *str2 && maxlen ) {
719
 
        a = SDL_tolower(*str1);
720
 
        b = SDL_tolower(*str2);
 
719
        a = SDL_tolower((unsigned char) *str1);
 
720
        b = SDL_tolower((unsigned char) *str2);
721
721
        if ( a != b )
722
722
            break;
723
723
        ++str1;
737
737
    va_start(ap, fmt);
738
738
    while ( *fmt ) {
739
739
        if ( *fmt == ' ' ) {
740
 
            while ( SDL_isspace(*text) ) {
 
740
            while ( SDL_isspace((unsigned char) *text) ) {
741
741
                ++text;
742
742
            }
743
743
            ++fmt;
788
788
                continue;
789
789
            }
790
790
 
791
 
            while ( SDL_isspace(*text) ) {
 
791
            while ( SDL_isspace((unsigned char) *text) ) {
792
792
                ++text;
793
793
            }
794
794
 
821
821
                                ++index;
822
822
                            }
823
823
                            if ( text[index] == '0' ) {
824
 
                                if ( SDL_tolower(text[index+1]) == 'x' ) {
 
824
                                if ( SDL_tolower((unsigned char) text[index+1]) == 'x' ) {
825
825
                                    radix = 16;
826
826
                                } else {
827
827
                                    radix = 8;
950
950
                        break;
951
951
                    case 's':
952
952
                        if ( suppress ) {
953
 
                            while ( !SDL_isspace(*text) ) {
 
953
                            while ( !SDL_isspace((unsigned char) *text) ) {
954
954
                                ++text;
955
955
                                if ( count ) {
956
956
                                    if ( --count == 0 ) {
960
960
                            }
961
961
                        } else {
962
962
                            char *valuep = va_arg(ap, char*);
963
 
                            while ( !SDL_isspace(*text) ) {
 
963
                            while ( !SDL_isspace((unsigned char) *text) ) {
964
964
                                *valuep++ = *text++;
965
965
                                if ( count ) {
966
966
                                    if ( --count == 0 ) {