From 226f318224e772edf3109da3af1d283e6dee3d57 Mon Sep 17 00:00:00 2001 From: "Serge A. Zaitsev" Date: Sat, 17 Oct 2015 10:50:22 +0200 Subject: [PATCH] json token type enum doesn't start with zero value anymore, fixes #24 --- jsmn.h | 5 +++-- jsmn_test.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jsmn.h b/jsmn.h index 95fb2ca..59cbaa2 100644 --- a/jsmn.h +++ b/jsmn.h @@ -15,10 +15,11 @@ extern "C" { * o Other primitive: number, boolean (true/false) or null */ typedef enum { - JSMN_PRIMITIVE = 0, + JSMN_UNDEFINED = 0, JSMN_OBJECT = 1, JSMN_ARRAY = 2, - JSMN_STRING = 3 + JSMN_STRING = 3, + JSMN_PRIMITIVE = 4 } jsmntype_t; typedef enum { diff --git a/jsmn_test.c b/jsmn_test.c index 3345790..15e5227 100644 --- a/jsmn_test.c +++ b/jsmn_test.c @@ -554,10 +554,11 @@ int test_keyvalue(void) { #define jsmntype_t jsmntype_nonstrict_t #define jsmnerr_t jsmnerr_nonstrict_t #define jsmntok_t jsmntok_nonstrict_t -#define JSMN_PRIMITIVE JSMN_PRIMITIVE_NONSTRICT #define JSMN_OBJECT JSMN_OBJECT_NONSTRICT #define JSMN_ARRAY JSMN_ARRAY_NONSTRICT #define JSMN_STRING JSMN_STRING_NONSTRICT +#define JSMN_PRIMITIVE JSMN_PRIMITIVE_NONSTRICT +#define JSMN_UNDEFINED JSMN_UNDEFINED_NONSTRICT #define JSMN_ERROR_NOMEM JSMN_ERROR_NOMEM_NONSTRICT #define JSMN_ERROR_INVAL JSMN_ERROR_INVAL_NONSTRICT #define JSMN_ERROR_PART JSMN_ERROR_PART_NONSTRICT