소스 검색

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
Eswar Yaganti 9 년 전
부모
커밋
ce546b54d8
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 8 8
      cJSON.h

+ 8 - 8
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