Changeset 406


Ignore:
Timestamp:
Jul 18, 2003, 1:52:08 PM (22 years ago)
Author:
bird
Message:

#567: Make sure the _ctype index is unsigned char (else we might get a negative index).

File:
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r405 r406  
    2222
    2323extern inline int isalnum (int _c)
    24   { return (_ctype+1)[_c] & (_UPPER|_LOWER|_DIGIT); }
     24  { return (_ctype+1)[(unsigned char)_c] & (_UPPER|_LOWER|_DIGIT); }
    2525extern inline int isalpha (int _c)
    26   { return (_ctype+1)[_c] & (_UPPER|_LOWER); }
     26  { return (_ctype+1)[(unsigned char)_c] & (_UPPER|_LOWER); }
    2727extern inline int iscntrl (int _c)
    28   { return (_ctype+1)[_c] & (_CNTRL); }
     28  { return (_ctype+1)[(unsigned char)_c] & (_CNTRL); }
    2929extern inline int isdigit (int _c)
    30   { return (_ctype+1)[_c] & (_DIGIT); }
     30  { return (_ctype+1)[(unsigned char)_c] & (_DIGIT); }
    3131extern inline int isgraph (int _c)
    32   { return (_ctype+1)[_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT); }
     32  { return (_ctype+1)[(unsigned char)_c] & (_PUNCT|_UPPER|_LOWER|_DIGIT); }
    3333extern inline int islower (int _c)
    34   { return (_ctype+1)[_c] & (_LOWER); }
     34  { return (_ctype+1)[(unsigned char)_c] & (_LOWER); }
    3535extern inline int isprint (int _c)
    36   { return (_ctype+1)[_c] & (_PRINT); }
     36  { return (_ctype+1)[(unsigned char)_c] & (_PRINT); }
    3737extern inline int ispunct (int _c)
    38   { return (_ctype+1)[_c] & (_PUNCT); }
     38  { return (_ctype+1)[(unsigned char)_c] & (_PUNCT); }
    3939extern inline int isspace (int _c)
    40   { return (_ctype+1)[_c] & (_SPACE); }
     40  { return (_ctype+1)[(unsigned char)_c] & (_SPACE); }
    4141extern inline int isupper (int _c)
    42   { return (_ctype+1)[_c] & (_UPPER); }
     42  { return (_ctype+1)[(unsigned char)_c] & (_UPPER); }
    4343extern inline int isxdigit (int _c)
    44   { return (_ctype+1)[_c] & (_XDIGIT); }
     44  { return (_ctype+1)[(unsigned char)_c] & (_XDIGIT); }
    4545
    4646#else
Note: See TracChangeset for help on using the changeset viewer.