#include <stdio.h> #include "cjson/cJSON.h" void main() { cJSON *test = cJSON_CreateObject(); cJSON_AddBoolToObject(test, "test_bool", cJSON_False); printf("%s", cJSON_Print(test)); return; } output: ❯ ./a.out
= 0, why not return (item->type & 0xff & (cJSON_True | cJSON_False)) != 0;func: cJSON_IsBool, use: return (item->type & (cJSON_True | cJSON_False)) != 0, why not use: return (item->type & 0xff & (cJSON_True | cJSON_False)) != 0;on Nov 30, 2021...