@@ -357,8 +357,8 @@ static void to_surrogate_pair(uint32_t unicode, uint16_t *uc, uint16_t *lc)
357
357
*lc = (n & 0x3FF ) | 0xDC00 ;
358
358
}
359
359
360
- bool is_space (const char *c);
361
- bool is_digit (const char *c);
360
+ static bool is_space (const char *c);
361
+ static bool is_digit (const char *c);
362
362
static bool parse_value (const char **sp, JsonNode **out);
363
363
static bool parse_string (const char **sp, char **out);
364
364
static bool parse_number (const char **sp, double *out);
@@ -936,12 +936,12 @@ bool parse_string(const char **sp, char **out)
936
936
return false ;
937
937
}
938
938
939
- bool is_space (const char & c) {
940
- return ((c) == ' \t ' || (c) == ' \n ' || (c) == ' \r ' || (c) == ' ' );
939
+ bool is_space (const char * c) {
940
+ return ((* c) == ' \t ' || (* c) == ' \n ' || (* c) == ' \r ' || (* c) == ' ' );
941
941
}
942
942
943
- bool is_digit (const char & c){
944
- return ((c) >= ' 0' && (c) <= ' 9' );
943
+ bool is_digit (const char * c){
944
+ return ((* c) >= ' 0' && (* c) <= ' 9' );
945
945
}
946
946
947
947
/*
@@ -966,33 +966,33 @@ bool parse_number(const char **sp, double *out)
966
966
if (*s == ' 0' ) {
967
967
s++;
968
968
} else {
969
- if (!is_digit (* s))
969
+ if (!is_digit (s))
970
970
return false ;
971
971
do {
972
972
s++;
973
- } while (is_digit (* s));
973
+ } while (is_digit (s));
974
974
}
975
975
976
976
/* ('.' [0-9]+)? */
977
977
if (*s == ' .' ) {
978
978
s++;
979
- if (!is_digit (* s))
979
+ if (!is_digit (s))
980
980
return false ;
981
981
do {
982
982
s++;
983
- } while (is_digit (* s));
983
+ } while (is_digit (s));
984
984
}
985
985
986
986
/* ([Ee] [+-]? [0-9]+)? */
987
987
if (*s == ' E' || *s == ' e' ) {
988
988
s++;
989
989
if (*s == ' +' || *s == ' -' )
990
990
s++;
991
- if (!is_digit (* s))
991
+ if (!is_digit (s))
992
992
return false ;
993
993
do {
994
994
s++;
995
- } while (is_digit (* s));
995
+ } while (is_digit (s));
996
996
}
997
997
998
998
if (out)
@@ -1005,7 +1005,7 @@ bool parse_number(const char **sp, double *out)
1005
1005
static void skip_space (const char **sp)
1006
1006
{
1007
1007
const char *s = *sp;
1008
- while (is_space (* s))
1008
+ while (is_space (s))
1009
1009
s++;
1010
1010
*sp = s;
1011
1011
}
0 commit comments