Skip to content

Commit 88b2be6

Browse files
committed
Use inline function instead of macro.
1 parent 3a79195 commit 88b2be6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

json_parser.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,18 @@ static const int __whitespace_map[256] = {
5454
1,
5555
};
5656

57-
#define isspace(c) __whitespace_map[(unsigned char)(c)]
58-
#define isdigit(c) ((c) >= '0' && (c) <= '9')
57+
static int __json_isspace(char c)
58+
{
59+
return __whitespace_map[(unsigned char)c];
60+
}
61+
62+
static int __json_isdigit(char c)
63+
{
64+
return c >= '0' && c <= '9';
65+
}
66+
67+
#define isspace(c) __json_isspace(c)
68+
#define isdigit(c) __json_isdigit(c)
5969

6070
static int __json_string_length(const char *cursor, size_t *len)
6171
{

0 commit comments

Comments
 (0)