Skip to contentSkip to conversation

json: update internal type definition to match JSMN

PATCH In review James Prestwood 2 participants 3 messages Nov 2, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 json: update internal type definition to match JSMN

Fixes ceda955ba7 ("shared: Update JSMN to latest version")
---
 src/json.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
src/json.h +4 -4
index c6220667..8cf2ba03 100644
@@ -27,10 +27,10 @@ struct json_iter;
  */
 enum json_type {
 	JSON_UNDEFINED = 0,
-	JSON_OBJECT = 1,
-	JSON_ARRAY = 2,
-	JSON_STRING = 3,
-	JSON_PRIMITIVE = 4
+	JSON_OBJECT = 1 << 0,
+	JSON_ARRAY = 1 << 1,
+	JSON_STRING = 1 << 2,
+	JSON_PRIMITIVE = 1 << 4,
 };
 
 enum json_flag {
Signature · 1 line
2.34.3
#1 lore raw
Quoted 11 lines · James Prestwood
Fixes ceda955ba7 ("shared: Update JSMN to latest version")

---
 src/json.h | 8 ++++----

 1 file changed, 4 insertions(+), 4 deletions(-)
src/json.h +0 -0
index c6220667..8cf2ba03 100644
@@ -27,10 +27,10 @@ struct json_iter;
   */

src/json.h struct json_iter; · line 33

Quoted 10 lines
src/json.h +4 -4
  enum json_type {
         JSON_UNDEFINED = 0,
-       JSON_OBJECT = 1,
-       JSON_ARRAY = 2,
-       JSON_STRING = 3,
-       JSON_PRIMITIVE = 4
+       JSON_OBJECT = 1 << 0,
+       JSON_ARRAY = 1 << 1,
+       JSON_STRING = 1 << 2,
+       JSON_PRIMITIVE = 1 << 4,

Whoops, this should be 1 << 3. I can send v2 or just fix this up when applying?

Quoted 3 lines
src/json.h +0 -0
  };


 enum json_flag {

#2 lore raw

Hi James,

Quoted 10 lines · James Prestwood
Quoted 5 lines · James Prestwood
Fixes ceda955ba7 ("shared: Update JSMN to latest version")
---
  src/json.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)

Whoops, this should be 1 << 3. I can send v2 or just fix this up when applying?

I fixed this up and applied.

Regards,
-Denis