MCPcopy Create free account
hub / github.com/Bwar/CJsonObject / cJSON_CreateIntArray

Function cJSON_CreateIntArray

cJSON.c:1047–1061  ·  view source on GitHub ↗

Create Arrays: */

Source from the content-addressed store, hash-verified

1045
1046/* Create Arrays: */
1047cJSON *cJSON_CreateIntArray(int *numbers, int sign, int count)
1048{
1049 int i;
1050 cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
1051 for (i = 0; a && i < count; i++)
1052 {
1053 n = cJSON_CreateDouble((long double)((unsigned int)numbers[i]), sign);
1054 if (!i)
1055 a->child = n;
1056 else
1057 suffix_object(p, n);
1058 p = n;
1059 }
1060 return a;
1061}
1062cJSON *cJSON_CreateFloatArray(float *numbers, int count)
1063{
1064 int i;

Callers

nothing calls this directly

Calls 3

cJSON_CreateArrayFunction · 0.85
cJSON_CreateDoubleFunction · 0.85
suffix_objectFunction · 0.85

Tested by

no test coverage detected