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