commit f393436c1d5676d131096e2cd410ef219a014d3e
parent c05b6ec8c3b521e2caaf855dd8fdfbab2ac9de48
Author: William Casarin <jb55@jb55.com>
Date: Fri, 18 Dec 2020 10:50:46 -0800
cleanups
Diffstat:
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/json.c b/src/json.c
@@ -560,13 +560,19 @@ static int parse_ubjson_string(struct ubjson *ubjson, struct json *val)
return 1;
}
+static inline int is_number_tag(unsigned char tag)
+{
+ return tag == 'U' || tag == 'l' || tag == 'I' || tag == 'L' || tag == 'i';
+}
+
static inline int valid_ubjson_tag(char c)
{
return c == 'S' ||
c == '{' ||
c == '[' ||
- c == 'U' ||
- c == 'Z';
+ c == 'T' ||
+ c == 'F' ||
+ c == 'Z' || is_number_tag(c);
}
static inline void copy_ubjson(struct ubjson *src, struct ubjson *dst) {
@@ -619,11 +625,6 @@ static int parse_ubjson_number(struct ubjson *ubjson, struct json *val)
return 1;
}
-static inline int is_number_tag(unsigned char tag)
-{
- return tag == 'U' || tag == 'l' || tag == 'I' || tag == 'L' || tag == 'i';
-}
-
static int parse_ubjson_bool(struct ubjson *ubjson, struct json *val)
{
unsigned char byte;