diff options
author | dcs <dcs@FreeBSD.org> | 2001-05-14 16:49:20 +0000 |
---|---|---|
committer | dcs <dcs@FreeBSD.org> | 2001-05-14 16:49:20 +0000 |
commit | bcc6e22c2f11fa2f58e4bf99df106d84736a5a8a (patch) | |
tree | 03969897052289a84babe68ed7fd88200eadb462 | |
parent | 0d0226733a11d3305bbac57cee81124fcbd80713 (diff) | |
download | FreeBSD-src-bcc6e22c2f11fa2f58e4bf99df106d84736a5a8a.zip FreeBSD-src-bcc6e22c2f11fa2f58e4bf99df106d84736a5a8a.tar.gz |
Replace functional bugs of ctypish functions in libstand with style
bugs.
reviewed by: bde
MFC after: 1 week
-rw-r--r-- | lib/libstand/stand.h | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 8d39e46..72b9a80 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -175,14 +175,42 @@ extern struct open_file files[]; #define F_RAW 0x0004 /* raw device open - no file system */ #define F_NODEV 0x0008 /* network open - no device */ -#define isupper(c) ((c) >= 'A' && (c) <= 'Z') -#define islower(c) ((c) >= 'a' && (c) <= 'z') -#define isspace(c) ((c) == ' ' || ((c) >= 0x9 && (c) <= 0xd)) -#define isdigit(c) ((c) >= '0' && (c) <= '9') -#define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) #define isascii(c) (((c) & ~0x7F) == 0) -#define isalpha(c) (isupper(c) || (islower(c))) -#define isalnum(c) (isalpha(c) || isdigit(c)) + +static __inline int isupper(int c) +{ + return c >= 'A' && c <= 'Z'; +} + +static __inline int islower(int c) +{ + return c >= 'a' && c <= 'z'; +} + +static __inline int isspace(int c) +{ + return c == ' ' || (c >= 0x9 && c <= 0xd); +} + +static __inline int isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +static __inline int isxdigit(int c) +{ + return isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); +} + +static __inline int isalpha(int c) +{ + return isupper(c) || islower(c); +} + +static __inline int isalnum(int c) +{ + return isalpha(c) || isdigit(c); +} static __inline int toupper(int c) { |