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

Function cJSON_CreateDoubleArray

cJSON.c:1077–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075 return a;
1076}
1077cJSON *cJSON_CreateDoubleArray(double *numbers, int count)
1078{
1079 int i;
1080 cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
1081 for (i = 0; a && i < count; i++)
1082 {
1083 n = cJSON_CreateDouble((long double)numbers[i], -1);
1084 if (!i)
1085 a->child = n;
1086 else
1087 suffix_object(p, n);
1088 p = n;
1089 }
1090 return a;
1091}
1092cJSON *cJSON_CreateStringArray(const char **strings, int count)
1093{
1094 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