Sync with ctype.h (EOF, sign extention fixes)
This commit is contained in:
parent
262fb20771
commit
4c02aebe2f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3434
@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <rune.h>
|
||||
|
||||
@ -10,6 +11,10 @@ __istype(c, f)
|
||||
_BSD_RUNE_T_ c;
|
||||
unsigned long f;
|
||||
{
|
||||
if (c == EOF)
|
||||
return 0;
|
||||
if (c < 0)
|
||||
c = (unsigned char) c;
|
||||
return ((((c & _CRMASK) ? ___runetype(c)
|
||||
: _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0);
|
||||
}
|
||||
@ -19,6 +24,10 @@ __isctype(_BSD_RUNE_T_ c, unsigned long f)
|
||||
_BSD_RUNE_T_ c;
|
||||
unsigned long f;
|
||||
{
|
||||
if (c == EOF)
|
||||
return 0;
|
||||
if (c < 0)
|
||||
c = (unsigned char) c;
|
||||
return ((((c & _CRMASK) ? 0
|
||||
: _DefaultRuneLocale.runetype[c]) & f) ? 1 : 0);
|
||||
}
|
||||
@ -27,6 +36,10 @@ _BSD_RUNE_T_
|
||||
toupper(c)
|
||||
_BSD_RUNE_T_ c;
|
||||
{
|
||||
if (c == EOF)
|
||||
return EOF;
|
||||
if (c < 0)
|
||||
c = (unsigned char) c;
|
||||
return ((c & _CRMASK) ?
|
||||
___toupper(c) : _CurrentRuneLocale->mapupper[c]);
|
||||
}
|
||||
@ -35,6 +48,10 @@ _BSD_RUNE_T_
|
||||
tolower(c)
|
||||
_BSD_RUNE_T_ c;
|
||||
{
|
||||
if (c == EOF)
|
||||
return EOF;
|
||||
if (c < 0)
|
||||
c = (unsigned char) c;
|
||||
return ((c & _CRMASK) ?
|
||||
___tolower(c) : _CurrentRuneLocale->maplower[c]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user