MCPcopy Create free account
hub / github.com/apache/qpid-proton / build_list

Function build_list

c/tests/object_test.cpp:36–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34static void *END = &mem;
35
36static pn_list_t *build_list(size_t capacity, ...) {
37 va_list ap;
38 va_start(ap, capacity);
39
40 pn_list_t *result;
41 void *arg = va_arg(ap, void *);
42 bool last = arg == END;
43 // No information about list types assume everything is PN_OBJECT
44 if (last) {
45 result = pn_list(PN_OBJECT, capacity);
46 return result;
47 }
48 result = pn_list(pn_class(arg), capacity);
49 while (true) {
50 if (arg == END) {
51 break;
52 }
53
54 pn_list_add(result, arg);
55 pn_decref(arg);
56 arg = va_arg(ap, void *);
57 }
58 va_end(ap);
59
60 return result;
61}
62
63static pn_map_t *build_map(float load_factor, size_t capacity, ...) {
64 va_list ap;

Callers 1

object_test.cppFile · 0.85

Calls 4

pn_listFunction · 0.85
pn_classFunction · 0.85
pn_list_addFunction · 0.85
pn_decrefFunction · 0.85

Tested by

no test coverage detected