diff options
| author | Tyge Løvset <[email protected]> | 2021-02-20 17:36:17 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-02-20 17:36:17 +0100 |
| commit | 6f2807ac42a42d42aea9b34c89b0cbbd5755fe49 (patch) | |
| tree | 6fddb49da547004315cd8b72a4f26259da689e1c | |
| parent | 4d9378ef420b4787208a742057a60dcf408ef741 (diff) | |
| download | STC-modified-6f2807ac42a42d42aea9b34c89b0cbbd5755fe49.tar.gz STC-modified-6f2807ac42a42d42aea9b34c89b0cbbd5755fe49.zip | |
Renamed push_items to emplace_n
| -rw-r--r-- | docs/ccommon_api.md | 6 | ||||
| -rw-r--r-- | docs/cdeq_api.md | 4 | ||||
| -rw-r--r-- | docs/clist_api.md | 2 | ||||
| -rw-r--r-- | docs/cmap_api.md | 2 | ||||
| -rw-r--r-- | docs/cpque_api.md | 4 | ||||
| -rw-r--r-- | docs/cqueue_api.md | 2 | ||||
| -rw-r--r-- | docs/cset_api.md | 2 | ||||
| -rw-r--r-- | docs/csmap_api.md | 2 | ||||
| -rw-r--r-- | docs/csset_api.md | 2 | ||||
| -rw-r--r-- | docs/cstack_api.md | 2 | ||||
| -rw-r--r-- | docs/cvec_api.md | 4 | ||||
| -rw-r--r-- | examples/advanced.c | 2 | ||||
| -rw-r--r-- | examples/csmap_v1.h | 6 | ||||
| -rw-r--r-- | examples/inits.c | 10 | ||||
| -rw-r--r-- | examples/list.c | 2 | ||||
| -rw-r--r-- | examples/priority.c | 2 | ||||
| -rw-r--r-- | stc/ccommon.h | 10 | ||||
| -rw-r--r-- | stc/cdeq.h | 6 | ||||
| -rw-r--r-- | stc/clist.h | 6 | ||||
| -rw-r--r-- | stc/cmap.h | 2 | ||||
| -rw-r--r-- | stc/cpque.h | 6 | ||||
| -rw-r--r-- | stc/cqueue.h | 4 | ||||
| -rw-r--r-- | stc/csmap.h | 2 | ||||
| -rw-r--r-- | stc/cstack.h | 4 | ||||
| -rw-r--r-- | stc/cvec.h | 6 |
25 files changed, 50 insertions, 50 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index e9d6fe12..2302c884 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -2,11 +2,11 @@ The following handy macros are completely safe to use, i.e. they have no side-effects. -### c_init, c_push_items -**c_init** declares and initializes any container with an array of elements. **c_push_items** adds elements to any existing container: +### c_init, c_emplace_n +**c_init** declares and initializes any container with an array of elements. **c_emplace_n** adds elements to any existing container: ```c c_init (cvec_i, vec, {1, 2, 3}); -c_push_items(&vec, cvec_i, {4, 5, 6}); +c_emplace_n(&vec, cvec_i, {4, 5, 6}); ``` ### c_forrange diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md index ed4730c6..09fcb535 100644 --- a/docs/cdeq_api.md +++ b/docs/cdeq_api.md @@ -64,7 +64,7 @@ void cdeq_X_push_front(cdeq_X* self, Value value); void cdeq_X_push_back(cdeq_X* self, Value value); void cdeq_X_emplace_front(cdeq_X* self, RawValue raw); void cdeq_X_emplace_back(cdeq_X* self, RawValue raw); -void cdeq_X_push_n(cdeq_X *self, const cdeq_X_rawvalue_t arr[], size_t size); +void cdeq_X_emplace_n(cdeq_X *self, const cdeq_X_rawvalue_t arr[], size_t size); void cdeq_X_pop_front(cdeq_X* self); void cdeq_X_pop_back(cdeq_X* self); @@ -119,7 +119,7 @@ int main() { printf(" %d", *i.ref); puts(""); - c_push_items(&q, cdeq_i, {1, 4, 5, 22, 33, 2}); + c_emplace_n(&q, cdeq_i, {1, 4, 5, 22, 33, 2}); c_foreach (i, cdeq_i, q) printf(" %d", *i.ref); puts(""); diff --git a/docs/clist_api.md b/docs/clist_api.md index 3482cede..b1e009e7 100644 --- a/docs/clist_api.md +++ b/docs/clist_api.md @@ -60,7 +60,7 @@ void clist_X_emplace_front(clist_X* self, RawValue raw); // non-std: void clist_X_push_back(clist_X* self, Value value); void clist_X_emplace_back(clist_X* self, RawValue raw); -void clist_X_push_n(clist_X *self, const clist_X_rawvalue_t arr[], size_t size); +void clist_X_emplace_n(clist_X *self, const clist_X_rawvalue_t arr[], size_t size); void clist_X_pop_front(clist_X* self); diff --git a/docs/cmap_api.md b/docs/cmap_api.md index ccd4532f..77e4d523 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -67,7 +67,7 @@ cmap_X_result_t cmap_X_insert(cmap_X* self, Key key, Mapped mapped); cmap_X_result_t cmap_X_insert_or_assign(cmap_X* self, Key key, Mapped mapped); // always update mapped cmap_X_result_t cmap_X_emplace(cmap_X* self, RawKey rkey, RawMapped rmapped); // no change if rkey in map cmap_X_result_t cmap_X_emplace_put(cmap_X* self, RawKey rkey, RawMapped rmapped); // always update rmapped -void cmap_X_push_n(cmap_X* self, const cmap_X_rawvalue_t arr[], size_t size); +void cmap_X_emplace_n(cmap_X* self, const cmap_X_rawvalue_t arr[], size_t size); cmap_X_mapped_t* cmap_X_at(const cmap_X* self, RawKey rkey); // rkey must be in map. diff --git a/docs/cpque_api.md b/docs/cpque_api.md index badc6315..d2a5d8e0 100644 --- a/docs/cpque_api.md +++ b/docs/cpque_api.md @@ -41,7 +41,7 @@ cpque_X_value_t* cpque_X_top(const cpque_X* self); void cpque_X_push(cpque_X* self, cpque_X_value_t value); void cpque_X_emplace(cpque_X* self, cpque_X_rawvalue_t raw); -void cpque_X_push_n(cpque_X *self, const cpque_X_rawvalue_t arr[], size_t size); +void cpque_X_emplace_n(cpque_X *self, const cpque_X_rawvalue_t arr[], size_t size); void cpque_X_pop(cpque_X* self); void cpque_X_erase_at(cpque_X* self, size_t idx); @@ -76,7 +76,7 @@ int main() // Push ten million random numbers to priority queue, plus some negative ones. c_forrange (N) cpque_i_push(&heap, stc64_uniform(&rng, &dist)); - c_push_items(&heap, cpque_i, {-231, -32, -873, -4, -343}); + c_emplace_n(&heap, cpque_i, {-231, -32, -873, -4, -343}); // Extract and display the fifty smallest. c_forrange (50) { diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md index 653f9bfd..c5429ff6 100644 --- a/docs/cqueue_api.md +++ b/docs/cqueue_api.md @@ -36,7 +36,7 @@ cqueue_X_value_t* cqueue_X_back(cqueue_X* self); void cqueue_X_push(cqueue_X* self, cqueue_X_value_t value); void cqueue_X_emplace(cqueue_X* self, cqueue_X_rawvalue_t raw); -void cqueue_X_push_n(cqueue_X *self, const cqueue_X_rawvalue_t arr[], size_t size); +void cqueue_X_emplace_n(cqueue_X *self, const cqueue_X_rawvalue_t arr[], size_t size); void cqueue_X_pop(cqueue_X* self); diff --git a/docs/cset_api.md b/docs/cset_api.md index d2064cf2..33d48415 100644 --- a/docs/cset_api.md +++ b/docs/cset_api.md @@ -51,7 +51,7 @@ bool cset_X_contains(const cset_X* self, RawKey rkey); cset_X_result_t cset_X_insert(cset_X* self, Key key);
cset_X_result_t cset_X_emplace(cset_X* self, RawKey rkey);
-void cset_X_push_n(cset_X* self, const RawKey arr[], size_t size);
+void cset_X_emplace_n(cset_X* self, const RawKey arr[], size_t size);
size_t cset_X_erase(cset_X* self, RawKey rkey);
cset_X_iter_t cset_X_erase_at(cset_X* self, cset_X_iter_t pos);
diff --git a/docs/csmap_api.md b/docs/csmap_api.md index 7bc52406..f7f650fa 100644 --- a/docs/csmap_api.md +++ b/docs/csmap_api.md @@ -60,7 +60,7 @@ csmap_X_result_t csmap_X_insert(csmap_X* self, Key key, Mapped mapped); csmap_X_result_t csmap_X_insert_or_assign(csmap_X* self, Key key, Mapped mapped); // always update mapped csmap_X_result_t csmap_X_emplace(csmap_X* self, RawKey rkey, RawMapped rmapped); // no change if rkey in map csmap_X_result_t csmap_X_emplace_put(csmap_X* self, RawKey rkey, RawMapped rmapped); // always update rmapped -void csmap_X_push_n(csmap_X* self, const csmap_X_rawvalue_t arr[], size_t size); +void csmap_X_emplace_n(csmap_X* self, const csmap_X_rawvalue_t arr[], size_t size); csmap_X_mapped_t* csmap_X_at(const csmap_X* self, RawKey rkey); // rkey must be in map. diff --git a/docs/csset_api.md b/docs/csset_api.md index 79c01b72..8a8ba62e 100644 --- a/docs/csset_api.md +++ b/docs/csset_api.md @@ -46,7 +46,7 @@ bool csset_X_contains(const csset_X* self, RawKey rkey); csset_X_result_t csset_X_insert(csset_X* self, Key key);
csset_X_result_t csset_X_emplace(csset_X* self, RawKey rkey);
-void csset_X_push_n(csset_X* self, const RawKey arr[], size_t size);
+void csset_X_emplace_n(csset_X* self, const RawKey arr[], size_t size);
size_t csset_X_erase(csset_X* self, RawKey rkey);
csset_X_iter_t csset_X_erase_at(csset_X* self, csset_X_iter_t pos);
diff --git a/docs/cstack_api.md b/docs/cstack_api.md index 86b0e42a..37b21497 100644 --- a/docs/cstack_api.md +++ b/docs/cstack_api.md @@ -36,7 +36,7 @@ cstack_X_value_t* cstack_X_top(cstack_X* self); void cstack_X_push(cstack_X* self, cstack_X_value_t value); void cstack_X_emplace(cstack_X* self, cstack_X_rawvalue_t raw); -void cstack_X_push_n(cstack_X *self, const cstack_X_rawvalue_t arr[], size_t size); +void cstack_X_emplace_n(cstack_X *self, const cstack_X_rawvalue_t arr[], size_t size); void cstack_X_pop(cstack_X* self); diff --git a/docs/cvec_api.md b/docs/cvec_api.md index fdbd879f..3032c8e0 100644 --- a/docs/cvec_api.md +++ b/docs/cvec_api.md @@ -62,7 +62,7 @@ cvec_X_value_t* cvec_X_back(cvec_X* self); void cvec_X_push_back(cvec_X* self, Value value); void cvec_X_emplace_back(cvec_X* self, RawValue raw); -void cvec_X_push_n(cvec_X *self, const cvec_X_rawvalue_t arr[], size_t size); +void cvec_X_emplace_n(cvec_X *self, const cvec_X_rawvalue_t arr[], size_t size); void cvec_X_pop_back(cvec_X* self); @@ -116,7 +116,7 @@ int main() { // Create a vector containing integers cvec_i vec = cvec_i_init(); - c_push_items(&vec, cvec_i, {7, 5, 16, 8}); + c_emplace_n(&vec, cvec_i, {7, 5, 16, 8}); // Add two more integers to vector cvec_i_push_back(&vec, 25); diff --git a/examples/advanced.c b/examples/advanced.c index 8d045b3a..01efc10c 100644 --- a/examples/advanced.c +++ b/examples/advanced.c @@ -42,7 +42,7 @@ using_cmap_keyarg(vk, Viking, int, vikingraw_equals, vikingraw_hash, int main() { cmap_vk vikings = cmap_vk_init(); - c_push_items(&vikings, cmap_vk, { + c_emplace_n(&vikings, cmap_vk, { { {"Einar", "Norway"}, 20}, { {"Olaf", "Denmark"}, 24}, { {"Harald", "Iceland"}, 12}, diff --git a/examples/csmap_v1.h b/examples/csmap_v1.h index 33673b65..4e785a2b 100644 --- a/examples/csmap_v1.h +++ b/examples/csmap_v1.h @@ -231,7 +231,7 @@ int main(void) { return res; \
} \
STC_INLINE C##_##X##_result_t \
- C##_##X##_put(C##_##X* self, RawKey rkey MAP_ONLY_##C(, RawMapped rmapped)) { \
+ C##_##X##_emplace_put(C##_##X* self, RawKey rkey MAP_ONLY_##C(, RawMapped rmapped)) { \
C##_##X##_result_t res = C##_##X##_insert_entry_(self, rkey); \
if (res.second) *KEY_REF_##C(res.first) = keyFromRaw(rkey); \
MAP_ONLY_##C( else mappedDel(&res.first->second); \
@@ -239,9 +239,9 @@ int main(void) { return res; \
} \
STC_INLINE void \
- C##_##X##_push_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
+ C##_##X##_emplace_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
for (size_t i=0; i<n; ++i) SET_ONLY_##C( C##_##X##_emplace(self, arr[i]); ) \
- MAP_ONLY_##C( C##_##X##_put(self, arr[i].first, arr[i].second); ) \
+ MAP_ONLY_##C( C##_##X##_emplace(self, arr[i].first, arr[i].second); ) \
} \
\
STC_INLINE C##_##X##_result_t \
diff --git a/examples/inits.c b/examples/inits.c index 6e2d1bd9..fd5fdbd3 100644 --- a/examples/inits.c +++ b/examples/inits.c @@ -24,7 +24,7 @@ int main(void) // CVEC FLOAT / PRIORITY QUEUE
cvec_f floats = cvec_f_init();
- c_push_items(&floats, cvec_f, {4.0f, 2.0f, 5.0f, 3.0f, 1.0f});
+ c_emplace_n(&floats, cvec_f, {4.0f, 2.0f, 5.0f, 3.0f, 1.0f});
c_foreach (i, cvec_f, floats) printf("%.1f ", *i.ref);
puts("");
@@ -32,7 +32,7 @@ int main(void) // CVEC PRIORITY QUEUE
cpque_f_make_heap(&floats);
- c_push_items(&floats, cpque_f, {40.0f, 20.0f, 50.0f, 30.0f, 10.0f});
+ c_emplace_n(&floats, cpque_f, {40.0f, 20.0f, 50.0f, 30.0f, 10.0f});
// sorted:
while (! cpque_f_empty(floats)) {
@@ -58,7 +58,7 @@ int main(void) // CMAP CNT
cmap_cnt countries = cmap_cnt_init();
- c_push_items(&countries, cmap_cnt, {
+ c_emplace_n(&countries, cmap_cnt, {
{"Norway", 100},
{"Denmark", 50},
{"Iceland", 10},
@@ -81,7 +81,7 @@ int main(void) // CVEC PAIR
cvec_ip pairs1 = cvec_ip_init();
- c_push_items(&pairs1, cvec_ip, {
+ c_emplace_n(&pairs1, cvec_ip, {
{5, 6},
{3, 4},
{1, 2},
@@ -97,7 +97,7 @@ int main(void) // CLIST PAIR
clist_ip pairs2 = clist_ip_init();
- c_push_items(&pairs2, clist_ip, {
+ c_emplace_n(&pairs2, clist_ip, {
{5, 6},
{3, 4},
{1, 2},
diff --git a/examples/list.c b/examples/list.c index 84ef90f7..47b17f2c 100644 --- a/examples/list.c +++ b/examples/list.c @@ -33,7 +33,7 @@ int main() { puts("");
clist_fx_clear(&list);
- c_push_items(&list, clist_fx, {10, 20, 30, 40, 30, 50});
+ c_emplace_n(&list, clist_fx, {10, 20, 30, 40, 30, 50});
c_foreach (i, clist_fx, list) printf(" %g", *i.ref);
puts("");
diff --git a/examples/priority.c b/examples/priority.c index 548cb06d..4955a6aa 100644 --- a/examples/priority.c +++ b/examples/priority.c @@ -20,7 +20,7 @@ int main() { cpque_i_push(&heap, stc64_uniform(&rng, &dist));
// push some negative numbers too.
- c_push_items(&heap, cpque_i, {-231, -32, -873, -4, -343});
+ c_emplace_n(&heap, cpque_i, {-231, -32, -873, -4, -343});
c_forrange (N)
cpque_i_push(&heap, stc64_uniform(&rng, &dist));
diff --git a/stc/ccommon.h b/stc/ccommon.h index 5d63dbaa..50626b36 100644 --- a/stc/ccommon.h +++ b/stc/ccommon.h @@ -117,16 +117,16 @@ #define c_breakwith continue
#define c_init(ctype, c, ...) \
- ctype c = ctype##_init(); c_push_items(&c, ctype, __VA_ARGS__)
+ ctype c = ctype##_init(); c_emplace_n(&c, ctype, __VA_ARGS__)
-#define c_push_items(self, ctype, ...) do { \
+#define c_emplace_n(self, ctype, ...) do { \
const ctype##_rawvalue_t __arr[] = __VA_ARGS__; \
- ctype##_push_n(self, __arr, sizeof __arr/sizeof *__arr); \
+ ctype##_emplace_n(self, __arr, c_arraylen(__arr)); \
} while (0)
#define c_del(ctype, ...) do { \
- ctype##_t* __arr[] = {__VA_ARGS__}; \
- for (size_t __i=0; __i<sizeof __arr/sizeof *__arr; ++__i) \
+ ctype* __arr[] = {__VA_ARGS__}; \
+ for (size_t __i = 0; __i < c_arraylen(__arr); ++__i) \
ctype##_del(__arr[__i]); \
} while (0)
@@ -60,7 +60,7 @@ struct cdeq_rep { size_t size, cap; void* base[]; }; STC_INLINE size_t \
cdeq_##X##_capacity(cdeq_##X deq) {return _cdeq_rep(&deq)->cap;} \
STC_INLINE Value \
- cdeq_##X##_value_from_raw(RawValue raw) {return valueFromRaw(raw);} \
+ cdeq_##X##_value_fromraw(RawValue raw) {return valueFromRaw(raw);} \
STC_INLINE cdeq_##X##_value_t \
cdeq_##X##_value_clone(cdeq_##X##_value_t val) {return valueFromRaw(valueToRaw(&val));} \
STC_API void \
@@ -100,7 +100,7 @@ struct cdeq_rep { size_t size, cap; void* base[]; }; } \
\
STC_API void \
- cdeq_##X##_push_n(cdeq_##X *self, const cdeq_##X##_rawvalue_t arr[], size_t n); \
+ cdeq_##X##_emplace_n(cdeq_##X *self, const cdeq_##X##_rawvalue_t arr[], size_t n); \
STC_API void \
cdeq_##X##_push_back(cdeq_##X* self, Value value); \
STC_INLINE void \
@@ -226,7 +226,7 @@ static inline double _maxf(double x, double y) {return x > y ? x : y;} } \
\
STC_DEF void \
- cdeq_##X##_push_n(cdeq_##X *self, const cdeq_##X##_rawvalue_t arr[], size_t n) { \
+ cdeq_##X##_emplace_n(cdeq_##X *self, const cdeq_##X##_rawvalue_t arr[], size_t n) { \
if (!n) return; \
_cdeq_##X##_expand(self, n, false); \
cdeq_##X##_value_t* p = self->data + _cdeq_rep(self)->size; \
diff --git a/stc/clist.h b/stc/clist.h index ff05f97b..9ee6fb1f 100644 --- a/stc/clist.h +++ b/stc/clist.h @@ -108,7 +108,7 @@ STC_API size_t _clist_size(const clist_void* self); STC_INLINE size_t \
clist_##X##_size(clist_##X ls) {return _clist_size((const clist_void*) &ls);} \
STC_INLINE Value \
- clist_##X##_value_from_raw(RawValue raw) {return valueFromRaw(raw);} \
+ clist_##X##_value_fromraw(RawValue raw) {return valueFromRaw(raw);} \
STC_INLINE clist_##X##_value_t \
clist_##X##_value_clone(clist_##X##_value_t val) {return valueFromRaw(valueToRaw(&val));} \
\
@@ -120,7 +120,7 @@ STC_API size_t _clist_size(const clist_void* self); clist_##X##_clear(clist_##X* self) {clist_##X##_del(self);} \
\
STC_API void \
- clist_##X##_push_n(clist_##X *self, const clist_##X##_rawvalue_t arr[], size_t size); \
+ clist_##X##_emplace_n(clist_##X *self, const clist_##X##_rawvalue_t arr[], size_t size); \
STC_API void \
clist_##X##_push_back(clist_##X* self, Value value); \
STC_INLINE void \
@@ -240,7 +240,7 @@ STC_API size_t _clist_size(const clist_void* self); if (!self->last) self->last = entry; \
} \
STC_DEF void \
- clist_##X##_push_n(clist_##X *self, const clist_##X##_rawvalue_t arr[], size_t size) { \
+ clist_##X##_emplace_n(clist_##X *self, const clist_##X##_rawvalue_t arr[], size_t size) { \
for (size_t i=0; i<size; ++i) clist_##X##_push_back(self, valueFromRaw(arr[i])); \
} \
\
@@ -270,7 +270,7 @@ typedef struct {size_t idx; uint32_t hx;} chash_bucket_t; return res; \
} \
STC_INLINE void \
- C##_##X##_push_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
+ C##_##X##_emplace_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
for (size_t i=0; i<n; ++i) SET_ONLY_##C( C##_##X##_emplace(self, arr[i]); ) \
MAP_ONLY_##C( C##_##X##_emplace(self, arr[i].first, arr[i].second); ) \
} \
diff --git a/stc/cpque.h b/stc/cpque.h index 54ca04a7..f1bf7529 100644 --- a/stc/cpque.h +++ b/stc/cpque.h @@ -78,10 +78,10 @@ cpque_##X##_push(cpque_##X* self, cpque_##X##_value_t value); \
STC_INLINE void \
cpque_##X##_emplace(cpque_##X* self, cpque_##X##_rawvalue_t raw) { \
- cpque_##X##_push(self, ctype##_value_from_raw(raw)); \
+ cpque_##X##_push(self, ctype##_value_fromraw(raw)); \
} \
STC_API void \
- cpque_##X##_push_n(cpque_##X *self, const cpque_##X##_rawvalue_t arr[], size_t size); \
+ cpque_##X##_emplace_n(cpque_##X *self, const cpque_##X##_rawvalue_t arr[], size_t size); \
\
implement_cpque(X, ctype, cmpOpr)
@@ -129,7 +129,7 @@ if (c != n) arr[c] = value; \
} \
STC_API void \
- cpque_##X##_push_n(cpque_##X *self, const cpque_##X##_rawvalue_t arr[], size_t size) { \
+ cpque_##X##_emplace_n(cpque_##X *self, const cpque_##X##_rawvalue_t arr[], size_t size) { \
for (size_t i=0; i<size; ++i) cpque_##X##_push(self, arr[i]); \
} \
\
diff --git a/stc/cqueue.h b/stc/cqueue.h index 2c49b066..832e68de 100644 --- a/stc/cqueue.h +++ b/stc/cqueue.h @@ -88,8 +88,8 @@ ctype##_emplace_back(self, raw); \
} \
STC_INLINE void \
- cqueue_##X##_push_n(cqueue_##X *self, const cqueue_##X##_rawvalue_t arr[], size_t size) { \
- ctype##_push_n(self, arr, size); \
+ cqueue_##X##_emplace_n(cqueue_##X *self, const cqueue_##X##_rawvalue_t arr[], size_t size) { \
+ ctype##_emplace_n(self, arr, size); \
} \
typedef ctype##_iter_t cqueue_##X##_iter_t; \
STC_INLINE cqueue_##X##_iter_t \
diff --git a/stc/csmap.h b/stc/csmap.h index 6920b7c5..a7f49a08 100644 --- a/stc/csmap.h +++ b/stc/csmap.h @@ -262,7 +262,7 @@ struct csmap_rep { size_t root, disp, head, size, cap; void* nodes[]; }; return res; \
} \
STC_INLINE void \
- C##_##X##_push_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
+ C##_##X##_emplace_n(C##_##X* self, const C##_##X##_rawvalue_t arr[], size_t n) { \
for (size_t i=0; i<n; ++i) SET_ONLY_##C( C##_##X##_emplace(self, arr[i]); ) \
MAP_ONLY_##C( C##_##X##_emplace(self, arr[i].first, arr[i].second); ) \
} \
diff --git a/stc/cstack.h b/stc/cstack.h index 286a4eb7..ecfc00be 100644 --- a/stc/cstack.h +++ b/stc/cstack.h @@ -75,8 +75,8 @@ ctype##_emplace_back(self, raw); \
} \
STC_INLINE void \
- cstack_##X##_push_n(cstack_##X *self, const cstack_##X##_rawvalue_t arr[], size_t size) { \
- ctype##_push_n(self, arr, size); \
+ cstack_##X##_emplace_n(cstack_##X *self, const cstack_##X##_rawvalue_t arr[], size_t size) { \
+ ctype##_emplace_n(self, arr, size); \
} \
typedef ctype##_iter_t cstack_##X##_iter_t; \
STC_INLINE cstack_##X##_iter_t \
@@ -60,7 +60,7 @@ struct cvec_rep { size_t size, cap; void* data[]; }; STC_INLINE bool \
cvec_##X##_empty(cvec_##X vec) {return !_cvec_rep(&vec)->size;} \
STC_INLINE Value \
- cvec_##X##_value_from_raw(RawValue raw) {return valueFromRaw(raw);} \
+ cvec_##X##_value_fromraw(RawValue raw) {return valueFromRaw(raw);} \
STC_INLINE cvec_##X##_value_t \
cvec_##X##_value_clone(cvec_##X##_value_t val) {return valueFromRaw(valueToRaw(&val));} \
STC_INLINE void \
@@ -95,7 +95,7 @@ struct cvec_rep { size_t size, cap; void* data[]; }; cvec_##X##_del(self); *self = x; \
} \
STC_API void \
- cvec_##X##_push_n(cvec_##X *self, const cvec_##X##_rawvalue_t arr[], size_t size); \
+ cvec_##X##_emplace_n(cvec_##X *self, const cvec_##X##_rawvalue_t arr[], size_t size); \
STC_API void \
cvec_##X##_push_back(cvec_##X* self, Value value); \
STC_INLINE void \
@@ -204,7 +204,7 @@ static struct cvec_rep _cvec_inits = {0, 0}; } \
\
STC_DEF void \
- cvec_##X##_push_n(cvec_##X *self, const cvec_##X##_rawvalue_t arr[], size_t n) { \
+ cvec_##X##_emplace_n(cvec_##X *self, const cvec_##X##_rawvalue_t arr[], size_t n) { \
if (!n) return; \
cvec_##X##_reserve(self, _cvec_rep(self)->size + n); \
cvec_##X##_value_t* p = self->data + _cvec_rep(self)->size; \
|
