Page MenuHomeFreeBSD

D19694.id55406.diff
No OneTemporary

D19694.id55406.diff

Index: sys/sys/ctype.h
===================================================================
--- sys/sys/ctype.h
+++ sys/sys/ctype.h
@@ -41,19 +41,67 @@
#ifdef _KERNEL
-#define isspace(c) ((c) == ' ' || ((c) >= '\t' && (c) <= '\r'))
-#define isascii(c) (((c) & ~0x7f) == 0)
-#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
-#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#define isalpha(c) (isupper(c) || islower(c))
-#define isdigit(c) ((c) >= '0' && (c) <= '9')
-#define isxdigit(c) (isdigit(c) \
- || ((c) >= 'A' && (c) <= 'F') \
- || ((c) >= 'a' && (c) <= 'f'))
-#define isprint(c) ((c) >= ' ' && (c) <= '~')
+static inline int
+isspace(int c)
+{
+ return (c == ' ' || (c >= '\t' && c <= '\r'));
+}
-#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z')))
-#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z')))
+static inline int
+isascii(int c)
+{
+ return ((c & ~0x7f) == 0);
+}
+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
+isalpha(int c)
+{
+ return (isupper(c) || islower(c));
+}
+
+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
+isprint(int c)
+{
+ return (c >= ' ' && c <= '~');
+}
+
+static inline int
+toupper(int c)
+{
+ return (c - 0x20 * ((c >= 'a') && (c <= 'z')));
+}
+
+static inline int
+tolower(int c)
+{
+ return (c + 0x20 * ((c >= 'A') && (c <= 'Z')));
+}
+
#endif
#endif /* !_SYS_CTYPE_H_ */

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 24, 10:11 AM (12 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24128329
Default Alt Text
D19694.id55406.diff (1 KB)

Event Timeline