diff options
| author | Tyge Løvset <[email protected]> | 2022-04-10 16:17:34 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-10 16:17:34 +0200 |
| commit | 0500c38d693c9157e522dd7198982b9c7aeb8651 (patch) | |
| tree | dbcfd615cac21034b2bebd6be8b8aef5fcdbd426 /include/stc/clist.h | |
| parent | 3c8792d9365c2d0ecf7d60bebc6bf1ae0e91b664 (diff) | |
| download | STC-modified-0500c38d693c9157e522dd7198982b9c7aeb8651.tar.gz STC-modified-0500c38d693c9157e522dd7198982b9c7aeb8651.zip | |
Parenthesized args in calls to i_keyfrom(c), i_keyto(p) i_valfrom(c), i_valto(p), and i_keydrop(p) - can be defined as macro without parenthesized args.
Diffstat (limited to 'include/stc/clist.h')
| -rw-r--r-- | include/stc/clist.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h index bf5201e7..ed8bb1ca 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -109,7 +109,7 @@ STC_API _cx_node* _cx_memb(_erase_after_)(_cx_self* self, _cx_node* node); #if !defined _i_no_clone
STC_API _cx_self _cx_memb(_clone)(_cx_self cx);
STC_INLINE i_val _cx_memb(_value_clone)(i_val val)
- { return i_valfrom(i_valto(&val)); }
+ { i_valraw r = i_valto((&val)); return i_valfrom(r); }
STC_INLINE void
_cx_memb(_copy)(_cx_self *self, _cx_self other) {
if (self->last == other.last) return;
@@ -192,7 +192,9 @@ _cx_memb(_get_mut)(_cx_self* self, i_valraw val) { STC_DEF _cx_self
_cx_memb(_clone)(_cx_self cx) {
_cx_self out = _cx_memb(_init)();
- c_foreach (it, _cx_self, cx) _cx_memb(_push_back)(&out, i_valfrom(i_valto(it.ref)));
+ i_valraw r;
+ c_foreach (it, _cx_self, cx)
+ r = i_valto(it.ref), _cx_memb(_push_back)(&out, i_valfrom(r));
return out;
}
#endif
@@ -298,7 +300,7 @@ _cx_memb(_remove)(_cx_self* self, i_valraw val) { _cx_node* prev = self->last, *node;
while (prev) {
node = prev->next;
- i_valraw r = i_valto(&node->value);
+ i_valraw r = i_valto((&node->value));
if (i_cmp((&r), (&val)) == 0)
prev = _cx_memb(_erase_after_)(self, prev), ++n;
else
@@ -309,8 +311,8 @@ _cx_memb(_remove)(_cx_self* self, i_valraw val) { static int
_cx_memb(_sort_cmp_)(const clist_VOID_node* x, const clist_VOID_node* y) {
- i_valraw a = i_valto(&((const _cx_node *) x)->value);
- i_valraw b = i_valto(&((const _cx_node *) y)->value);
+ i_valraw a = i_valto((&((const _cx_node *) x)->value));
+ i_valraw b = i_valto((&((const _cx_node *) y)->value));
return i_cmp((&a), (&b));
}
|
