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

Function cJSON_CreateFloatArray

cJSON.c:1062–1076  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060 return a;
1061}
1062cJSON *cJSON_CreateFloatArray(float *numbers, int count)
1063{
1064 int i;
1065 cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
1066 for (i = 0; a && i < count; i++)
1067 {
1068 n = cJSON_CreateDouble((long double)numbers[i], -1);
1069 if (!i)
1070 a->child = n;
1071 else
1072 suffix_object(p, n);
1073 p = n;
1074 }
1075 return a;
1076}
1077cJSON *cJSON_CreateDoubleArray(double *numbers, int count)
1078{
1079 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