From 51daf09029820be6762a7a1224dc256465be44e7 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sun, 10 Apr 2022 11:24:09 +0200 Subject: Parenthesized calls to i_drop(x) - can be defined as macro without parenthesis around arg. --- include/stc/alt/clist.h | 2 +- include/stc/alt/csmap.h | 8 ++++---- include/stc/clist.h | 2 +- include/stc/cmap.h | 8 ++++---- include/stc/cpque.h | 4 ++-- include/stc/csmap.h | 8 ++++---- include/stc/cvec.h | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/stc/alt/clist.h b/include/stc/alt/clist.h index 5c5144d5..fa4e9c80 100644 --- a/include/stc/alt/clist.h +++ b/include/stc/alt/clist.h @@ -232,7 +232,7 @@ STC_API size_t _clist_count(const clist_VOID* self); node->next = next; \ if (del == next) self->last = node = NULL; \ else if (self->last == del) self->last = node, node = NULL; \ - i_valdrop(&del->value); c_free(del); \ + i_valdrop((&del->value)); c_free(del); \ return node; \ } \ \ diff --git a/include/stc/alt/csmap.h b/include/stc/alt/csmap.h index d603ccbf..f7292819 100644 --- a/include/stc/alt/csmap.h +++ b/include/stc/alt/csmap.h @@ -105,7 +105,7 @@ int main(void) { STC_INLINE void \ _cx_memb(_value_drop)(_cx_value* val) { \ i_keydrop(_i_keyref(val)); \ - _i_MAP_ONLY( i_valdrop(&val->second); ) \ + _i_MAP_ONLY( i_valdrop((&val->second)); ) \ } \ \ STC_INLINE void \ @@ -134,7 +134,7 @@ int main(void) { _cx_memb(_insert)(_cx_self* self, i_key key _i_MAP_ONLY(, i_val mapped)) { \ _cx_result res = _cx_memb(_insert_entry_)(self, i_keyto(&key)); \ if (res.inserted) {*_i_keyref(res.ref) = key; _i_MAP_ONLY( res.ref->second = mapped; )} \ - else {i_keydrop(&key); _i_MAP_ONLY( i_valdrop(&mapped); )} \ + else {i_keydrop(&key); _i_MAP_ONLY( i_valdrop((&mapped)); )} \ return res; \ } \ \ @@ -143,7 +143,7 @@ int main(void) { _cx_memb(_insert_or_assign)(_cx_self* self, i_key key, i_val mapped) { \ _cx_result res = _cx_memb(_insert_entry_)(self, i_keyto(&key)); \ if (res.inserted) res.ref->first = key; \ - else {i_keydrop(&key); i_valdrop(&res.ref->second); } \ + else {i_keydrop(&key); i_valdrop((&res.ref->second)); } \ res.ref->second = mapped; return res; \ } \ \ @@ -156,7 +156,7 @@ int main(void) { _cx_memb(_emplace_or_assign)(_cx_self* self, i_keyraw rkey, i_valraw rmapped) { \ _cx_result res = _cx_memb(_insert_entry_)(self, rkey); \ if (res.inserted) res.ref->first = i_keyfrom(rkey); \ - else i_valdrop(&res.ref->second); \ + else i_valdrop((&res.ref->second)); \ res.ref->second = i_valfrom(rmapped); return res; \ } \ \ diff --git a/include/stc/clist.h b/include/stc/clist.h index c2df3134..1b911d63 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -251,7 +251,7 @@ _cx_memb(_erase_after_)(_cx_self* self, _cx_node* node) { node->next = next; if (del == next) self->last = node = NULL; else if (self->last == del) self->last = node, node = NULL; - i_valdrop(&del->value); c_free(del); + i_valdrop((&del->value)); c_free(del); return node; } diff --git a/include/stc/cmap.h b/include/stc/cmap.h index 3ad53301..d7f5d547 100644 --- a/include/stc/cmap.h +++ b/include/stc/cmap.h @@ -159,14 +159,14 @@ _cx_memb(_value_toraw)(_cx_value* val) { STC_INLINE void _cx_memb(_value_drop)(_cx_value* _val) { i_keydrop(_i_keyref(_val)); - _i_MAP_ONLY( i_valdrop(&_val->second); ) + _i_MAP_ONLY( i_valdrop((&_val->second)); ) } STC_INLINE _cx_result _cx_memb(_insert)(_cx_self* self, i_key _key _i_MAP_ONLY(, i_val _mapped)) { _cx_result _res = _cx_memb(_insert_entry_)(self, i_keyto(&_key)); if (_res.inserted) { *_i_keyref(_res.ref) = _key; _i_MAP_ONLY( _res.ref->second = _mapped; )} - else { i_keydrop(&_key); _i_MAP_ONLY( i_valdrop(&_mapped); )} + else { i_keydrop(&_key); _i_MAP_ONLY( i_valdrop((&_mapped)); )} return _res; } @@ -272,7 +272,7 @@ STC_DEF void _cx_memb(_clear)(_cx_self* self) { _cx_memb(_insert_or_assign)(_cx_self* self, i_key _key, i_val _mapped) { _cx_result _res = _cx_memb(_insert_entry_)(self, i_keyto(&_key)); if (_res.inserted) _res.ref->first = _key; - else { i_keydrop(&_key); i_valdrop(&_res.ref->second); } + else { i_keydrop(&_key); i_valdrop((&_res.ref->second)); } _res.ref->second = _mapped; return _res; } @@ -282,7 +282,7 @@ STC_DEF void _cx_memb(_clear)(_cx_self* self) { _cx_memb(_emplace_or_assign)(_cx_self* self, i_keyraw rkey, i_valraw rmapped) { _cx_result _res = _cx_memb(_insert_entry_)(self, rkey); if (_res.inserted) _res.ref->first = i_keyfrom(rkey); - else i_valdrop(&_res.ref->second); + else i_valdrop((&_res.ref->second)); _res.ref->second = i_valfrom(rmapped); return _res; } #endif diff --git a/include/stc/cpque.h b/include/stc/cpque.h index 3fa561ed..f862b7e4 100644 --- a/include/stc/cpque.h +++ b/include/stc/cpque.h @@ -67,7 +67,7 @@ STC_INLINE _cx_self _cx_memb(_with_size)(const size_t size, i_val null) { STC_INLINE void _cx_memb(_clear)(_cx_self* self) { size_t i = self->size; self->size = 0; - while (i--) { i_valdrop(&self->data[i]); } + while (i--) { i_valdrop((self->data + i)); } } STC_INLINE void _cx_memb(_drop)(_cx_self* self) @@ -135,7 +135,7 @@ STC_DEF _cx_self _cx_memb(_clone)(_cx_self q) { STC_DEF void _cx_memb(_erase_at)(_cx_self* self, const size_t idx) { - i_valdrop(&self->data[idx]); + i_valdrop((self->data + idx)); const size_t n = --self->size; self->data[idx] = self->data[n]; _cx_memb(_sift_down_)(self->data - 1, idx + 1, n); diff --git a/include/stc/csmap.h b/include/stc/csmap.h index 87c4de77..d3a7ec50 100644 --- a/include/stc/csmap.h +++ b/include/stc/csmap.h @@ -152,7 +152,7 @@ _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y) { STC_INLINE void _cx_memb(_value_drop)(_cx_value* val) { i_keydrop(_i_keyref(val)); - _i_MAP_ONLY( i_valdrop(&val->second); ) + _i_MAP_ONLY( i_valdrop((&val->second)); ) } #ifndef _i_isset @@ -268,7 +268,7 @@ STC_DEF _cx_result _cx_memb(_insert)(_cx_self* self, i_key key _i_MAP_ONLY(, i_val mapped)) { _cx_result res = _cx_memb(_insert_entry_)(self, i_keyto(&key)); if (res.inserted) { *_i_keyref(res.ref) = key; _i_MAP_ONLY( res.ref->second = mapped; )} - else { i_keydrop(&key); _i_MAP_ONLY( i_valdrop(&mapped); )} + else { i_keydrop(&key); _i_MAP_ONLY( i_valdrop((&mapped)); )} return res; } @@ -277,7 +277,7 @@ _cx_memb(_insert)(_cx_self* self, i_key key _i_MAP_ONLY(, i_val mapped)) { _cx_memb(_insert_or_assign)(_cx_self* self, i_key key, i_val mapped) { _cx_result res = _cx_memb(_insert_entry_)(self, i_keyto(&key)); if (res.inserted) res.ref->first = key; - else { i_keydrop(&key); i_valdrop(&res.ref->second); } + else { i_keydrop(&key); i_valdrop((&res.ref->second)); } res.ref->second = mapped; return res; } @@ -287,7 +287,7 @@ _cx_memb(_insert)(_cx_self* self, i_key key _i_MAP_ONLY(, i_val mapped)) { _cx_memb(_emplace_or_assign)(_cx_self* self, i_keyraw rkey, i_valraw rmapped) { _cx_result res = _cx_memb(_insert_entry_)(self, rkey); if (res.inserted) res.ref->first = i_keyfrom(rkey); - else i_valdrop(&res.ref->second); + else i_valdrop((&res.ref->second)); res.ref->second = i_valfrom(rmapped); return res; } #endif diff --git a/include/stc/cvec.h b/include/stc/cvec.h index 69e95e2b..3b3e1dde 100644 --- a/include/stc/cvec.h +++ b/include/stc/cvec.h @@ -295,7 +295,7 @@ _cx_memb(_resize)(_cx_self* self, const size_t len, i_val null) { if (!_cx_memb(_reserve)(self, len)) return false; struct cvec_rep *rep = cvec_rep_(self); const size_t n = rep->size; - for (size_t i = len; i < n; ++i) { i_valdrop(&self->data[i]); } + for (size_t i = len; i < n; ++i) { i_valdrop((self->data + i)); } for (size_t i = n; i < len; ++i) self->data[i] = null; if (rep->cap) rep->size = len; return true; -- cgit v1.2.3