@@ -357,8 +357,8 @@ static void to_surrogate_pair(uint32_t unicode, uint16_t *uc, uint16_t *lc)
357357 *lc = (n & 0x3FF ) | 0xDC00 ;
358358}
359359
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);
362362static bool parse_value (const char **sp, JsonNode **out);
363363static bool parse_string (const char **sp, char **out);
364364static bool parse_number (const char **sp, double *out);
@@ -936,12 +936,12 @@ bool parse_string(const char **sp, char **out)
936936 return false ;
937937}
938938
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) == ' ' );
941941}
942942
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' );
945945}
946946
947947/*
@@ -966,33 +966,33 @@ bool parse_number(const char **sp, double *out)
966966 if (*s == ' 0' ) {
967967 s++;
968968 } else {
969- if (!is_digit (* s))
969+ if (!is_digit (s))
970970 return false ;
971971 do {
972972 s++;
973- } while (is_digit (* s));
973+ } while (is_digit (s));
974974 }
975975
976976 /* ('.' [0-9]+)? */
977977 if (*s == ' .' ) {
978978 s++;
979- if (!is_digit (* s))
979+ if (!is_digit (s))
980980 return false ;
981981 do {
982982 s++;
983- } while (is_digit (* s));
983+ } while (is_digit (s));
984984 }
985985
986986 /* ([Ee] [+-]? [0-9]+)? */
987987 if (*s == ' E' || *s == ' e' ) {
988988 s++;
989989 if (*s == ' +' || *s == ' -' )
990990 s++;
991- if (!is_digit (* s))
991+ if (!is_digit (s))
992992 return false ;
993993 do {
994994 s++;
995- } while (is_digit (* s));
995+ } while (is_digit (s));
996996 }
997997
998998 if (out)
@@ -1005,7 +1005,7 @@ bool parse_number(const char **sp, double *out)
10051005static void skip_space (const char **sp)
10061006{
10071007 const char *s = *sp;
1008- while (is_space (* s))
1008+ while (is_space (s))
10091009 s++;
10101010 *sp = s;
10111011}
0 commit comments