MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / cJSON_CreateIntArray

Function cJSON_CreateIntArray

common/map_sdk/transmission/src/cJSON.cpp:833–846  ·  view source on GitHub ↗

Create Arrays: */

Source from the content-addressed store, hash-verified

831
832/* Create Arrays: */
833cJSON *cJSON_CreateIntArray(int *numbers, int sign, int count) {
834 int i;
835 cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();
836 for (i = 0; a && i < count; i++) {
837 n = cJSON_CreateDouble((long double)((unsigned int)numbers[i]), sign);
838 if (!i) {
839 a->child = n;
840 } else {
841 suffix_object(p, n);
842 }
843 p = n;
844 }
845 return a;
846}
847cJSON *cJSON_CreateFloatArray(float *numbers, int count) {
848 int i;
849 cJSON *n = 0, *p = 0, *a = cJSON_CreateArray();

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