src/json.c

changeset 1585
8ccfbc00f690
parent 1584
7a14af59d356
child 1586
7f1cadc3ebc1
equal deleted inserted replaced
1584:7a14af59d356 1585:8ccfbc00f690
1463 } 1463 }
1464 return 0; 1464 return 0;
1465 case CX_JSON_STRING: 1465 case CX_JSON_STRING:
1466 return cx_strcmp(json->string, other->string); 1466 return cx_strcmp(json->string, other->string);
1467 case CX_JSON_INTEGER: 1467 case CX_JSON_INTEGER:
1468 return cx_vcmp_int64(json->integer, cxJsonAsInteger(other)); 1468 if (other->type == CX_JSON_INTEGER) {
1469 return cx_vcmp_int64(json->integer, other->integer);
1470 } else {
1471 return cx_vcmp_double(cxJsonAsDouble(json), other->number);
1472 }
1469 case CX_JSON_NUMBER: 1473 case CX_JSON_NUMBER:
1470 return cx_vcmp_double(json->number, cxJsonAsDouble(other)); 1474 return cx_vcmp_double(json->number, cxJsonAsDouble(other));
1471 case CX_JSON_LITERAL: 1475 case CX_JSON_LITERAL:
1472 return json->literal == other->literal ? 0 : -1; 1476 return json->literal == other->literal ? 0 : -1;
1473 default: 1477 default:

mercurial