don't ask me, but the original cJSON_SetNumberValue returns an integer or double */
| 380 | |
| 381 | /* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ |
| 382 | CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) |
| 383 | { |
| 384 | if (number >= INT_MAX) |
| 385 | { |
| 386 | object->valueint = INT_MAX; |
| 387 | } |
| 388 | else if (number <= (double)INT_MIN) |
| 389 | { |
| 390 | object->valueint = INT_MIN; |
| 391 | } |
| 392 | else |
| 393 | { |
| 394 | object->valueint = (int)number; |
| 395 | } |
| 396 | |
| 397 | return object->valuedouble = number; |
| 398 | } |
| 399 | |
| 400 | CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring) |
| 401 | { |
nothing calls this directly
no outgoing calls
no test coverage detected