Skip to content

Commit

Permalink
wcharacter: reimplement isblank, islower and ispunct
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed May 15, 2023
1 parent ddca5c6 commit 5b9faf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/WCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ inline bool isAscii(int c)
// Checks for a blank character, that is, a space or a tab.
inline bool isWhitespace(int c)
{
return ( isblank (c) == 0 ? false : true);
return ( c == '\t' || c == ' ');
}


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


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


Expand Down

0 comments on commit 5b9faf6

Please sign in to comment.