MCPcopy Create free account
hub / github.com/SVF-tools/SVF / cJSON_SetNumberHelper

Function cJSON_SetNumberHelper

svf/lib/Util/cJSON.cpp:383–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381
382/* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */
383CJSON_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
401CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
402{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected