src/json.c

changeset 1592
c1e17411004f
parent 1591
ef2f47fc5f0c
child 1594
4b9537f93239
equal deleted inserted replaced
1591:ef2f47fc5f0c 1592:c1e17411004f
1442 CxJsonWriter writer = cxJsonWriterPretty(true); 1442 CxJsonWriter writer = cxJsonWriterPretty(true);
1443 return cx_json_to_string(value, allocator, &writer); 1443 return cx_json_to_string(value, allocator, &writer);
1444 } 1444 }
1445 1445
1446 int cxJsonCompare(const CxJsonValue *json, const CxJsonValue *other) { 1446 int cxJsonCompare(const CxJsonValue *json, const CxJsonValue *other) {
1447 if (json == NULL && other == NULL) return 0; 1447 if (json == other) return 0;
1448 if (json == NULL || other == NULL) return -1; 1448 if (json == NULL || other == NULL) return -1;
1449 if (json->type != other->type) { 1449 if (json->type != other->type) {
1450 if (!cxJsonIsNumber(json)) return -1; 1450 if (!cxJsonIsNumber(json)) return -1;
1451 if (!cxJsonIsNumber(other)) return -1; 1451 if (!cxJsonIsNumber(other)) return -1;
1452 } 1452 }

mercurial