From 51371c899e830e9a1391fa1a04186b6230053956 Mon Sep 17 00:00:00 2001 From: Eswar Yaganti Date: Tue, 9 Feb 2016 22:52:10 +0530 Subject: [PATCH 1/2] Changed the #define values of cJSON* data types We can use bitops to check if the parsed JSON is of a particular types using OR --- cJSON.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cJSON.h b/cJSON.h index a3221d1..39de385 100644 --- a/cJSON.h +++ b/cJSON.h @@ -29,13 +29,13 @@ extern "C" #endif /* cJSON Types: */ -#define cJSON_False 0 -#define cJSON_True 1 -#define cJSON_NULL 2 -#define cJSON_Number 3 -#define cJSON_String 4 -#define cJSON_Array 5 -#define cJSON_Object 6 +#define cJSON_False 1 << 0 +#define cJSON_True 1 << 1 +#define cJSON_NULL 1 << 2 +#define cJSON_Number 1 << 3 +#define cJSON_String 1 << 4 +#define cJSON_Array 1 << 5 +#define cJSON_Object 1 << 6 #define cJSON_IsReference 256 #define cJSON_StringIsConst 512 From ce546b54d8fe6afee69763ca78ded3195d8d21e7 Mon Sep 17 00:00:00 2001 From: Eswar Yaganti Date: Tue, 9 Feb 2016 22:52:10 +0530 Subject: [PATCH 2/2] Changed the #define values of cJSON* data types We can use bitops to check if the parsed JSON is of a particular types using OR --- cJSON.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cJSON.h b/cJSON.h index a3221d1..9a2abeb 100644 --- a/cJSON.h +++ b/cJSON.h @@ -29,14 +29,14 @@ extern "C" #endif /* cJSON Types: */ -#define cJSON_False 0 -#define cJSON_True 1 -#define cJSON_NULL 2 -#define cJSON_Number 3 -#define cJSON_String 4 -#define cJSON_Array 5 -#define cJSON_Object 6 - +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) +#define cJSON_Number (1 << 3) +#define cJSON_String (1 << 4) +#define cJSON_Array (1 << 5) +#define cJSON_Object (1 << 6) + #define cJSON_IsReference 256 #define cJSON_StringIsConst 512