Changeset 495


Ignore:
Timestamp:
Aug 1, 2003, 1:01:07 PM (22 years ago)
Author:
bird
Message:

#567: reapplied the fix for negative offsets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/ctype.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r494 r495  
    1818
    1919static inline int isalnum (int _c)
    20 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER|__DIGIT); }
     20{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__UPPER|__LOWER|__DIGIT); }
    2121
    2222static inline int isalpha (int _c)
    23 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER|__LOWER); }
     23{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__UPPER|__LOWER); }
    2424
    2525static inline int iscntrl (int _c)
    26 { return __locale_ctype.cflags [_c & 0xff] & (__CNTRL); }
     26{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__CNTRL); }
    2727
    2828static inline int isdigit (int _c)
    29 { return __locale_ctype.cflags [_c & 0xff] & (__DIGIT); }
     29{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__DIGIT); }
    3030
    3131static inline int isgraph (int _c)
    32 { return __locale_ctype.cflags [_c & 0xff] & (__PUNCT|__UPPER|__LOWER|__DIGIT); }
     32{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__PUNCT|__UPPER|__LOWER|__DIGIT); }
    3333
    3434static inline int islower (int _c)
    35 { return __locale_ctype.cflags [_c & 0xff] & (__LOWER); }
     35{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__LOWER); }
    3636
    3737static inline int isprint (int _c)
    38 { return __locale_ctype.cflags [_c & 0xff] & (__PRINT); }
     38{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__PRINT); }
    3939
    4040static inline int ispunct (int _c)
    41 { return __locale_ctype.cflags [_c & 0xff] & (__PUNCT); }
     41{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__PUNCT); }
    4242
    4343static inline int isspace (int _c)
    44 { return __locale_ctype.cflags [_c & 0xff] & (__SPACE); }
     44{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__SPACE); }
    4545
    4646static inline int isupper (int _c)
    47 { return __locale_ctype.cflags [_c & 0xff] & (__UPPER); }
     47{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__UPPER); }
    4848
    4949static inline int isxdigit (int _c)
    50 { return __locale_ctype.cflags [_c & 0xff] & (__XDIGIT); }
     50{ return __locale_ctype.cflags [(unsigned char)_c & 0xff] & (__XDIGIT); }
    5151
    5252static inline int toupper (int _c)
    53 { return __locale_ctype.upcase [_c & 0xff]; }
     53{ return __locale_ctype.upcase [(unsigned char)_c & 0xff]; }
    5454
    5555static inline int tolower (int _c)
    56 { return __locale_ctype.locase [_c & 0xff]; }
     56{ return __locale_ctype.locase [(unsigned char)_c & 0xff]; }
    5757
    5858#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE)
    5959
    6060static inline int isascii (int _c)
    61 { return (unsigned)_c <= 0x7f; }
     61{ return (unsigned char)_c <= 0x7f; }
    6262
    6363static inline int toascii (int _c)
    64 { return _c & 0x7f; }
     64{ return (unsigned char)_c & 0x7f; }
    6565
    6666#endif
Note: See TracChangeset for help on using the changeset viewer.