summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-04-10 16:17:34 +0200
committerTyge Løvset <[email protected]>2022-04-10 16:17:34 +0200
commit0500c38d693c9157e522dd7198982b9c7aeb8651 (patch)
treedbcfd615cac21034b2bebd6be8b8aef5fcdbd426 /include/stc/cvec.h
parent3c8792d9365c2d0ecf7d60bebc6bf1ae0e91b664 (diff)
downloadSTC-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/cvec.h')
-rw-r--r--include/stc/cvec.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index c523ea45..c7f1a001 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -97,7 +97,7 @@ STC_API _cx_self _cx_memb(_clone)(_cx_self cx);
STC_API _cx_iter _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos,
const _cx_value* p1, const _cx_value* p2);
STC_INLINE i_val _cx_memb(_value_clone)(_cx_value val)
- { return i_valfrom(i_valto(&val)); }
+ { i_valraw r = i_valto((&val)); return i_valfrom(r); }
STC_INLINE i_val _cx_memb(_value_fromraw)(i_valraw raw) { return i_valfrom(raw); }
STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) {
if (self->data == other.data) return;
@@ -363,7 +363,9 @@ _cx_memb(_clone_range_p)(_cx_self* self, _cx_value* pos,
const _cx_value* p1, const _cx_value* p2) {
pos = _cx_memb(_insert_space_)(self, pos, p2 - p1);
_cx_iter it = {pos};
- for (; p1 != p2; ++p1) *pos++ = i_valfrom(i_valto(p1));
+ i_valraw r;
+ for (; p1 != p2; ++p1)
+ r = i_valto(p1), *pos++ = i_valfrom(r);
return it;
}
#if !defined _i_no_emplace
@@ -372,7 +374,7 @@ _cx_memb(_emplace_range_p)(_cx_self* self, _cx_value* pos,
const _cx_raw* p1, const _cx_raw* p2) {
pos = _cx_memb(_insert_space_)(self, pos, p2 - p1);
_cx_iter it = {pos};
- for (; p1 != p2; ++p1) *pos++ = i_valfrom(*p1);
+ for (; p1 != p2; ++p1) *pos++ = i_valfrom((*p1));
return it;
}
#endif