Skip to content

Commit 5b9faf6

Browse files
committed
wcharacter: reimplement isblank, islower and ispunct
1 parent ddca5c6 commit 5b9faf6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

api/WCharacter.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ inline bool isAscii(int c)
7070
// Checks for a blank character, that is, a space or a tab.
7171
inline bool isWhitespace(int c)
7272
{
73-
return ( isblank (c) == 0 ? false : true);
73+
return ( c == '\t' || c == ' ');
7474
}
7575

7676

@@ -98,7 +98,7 @@ inline bool isGraph(int c)
9898
// Checks for a lower-case character.
9999
inline bool isLowerCase(int c)
100100
{
101-
return (islower (c) == 0 ? false : true);
101+
return ( c >= 'a' && c <= 'z' );
102102
}
103103

104104

@@ -113,7 +113,7 @@ inline bool isPrintable(int c)
113113
// or an alphanumeric character.
114114
inline bool isPunct(int c)
115115
{
116-
return ( ispunct (c) == 0 ? false : true);
116+
return ( isPrintable(c) && !isSpace(c) && !isAlphaNumeric(c) );
117117
}
118118

119119

0 commit comments

Comments
 (0)