diff options
| author | tylo <[email protected]> | 2021-10-06 09:47:51 +0200 |
|---|---|---|
| committer | tylo <[email protected]> | 2021-10-06 09:47:51 +0200 |
| commit | 0fa5220d8d7cddbb668d02045ebd36709ba0bc6f (patch) | |
| tree | 9b3cdb41228f8d02f5d526cb80b3f4ffa62e82e1 | |
| parent | d4ea76c273bbebdb2b1be7302a9a6edde2198134 (diff) | |
| download | STC-modified-0fa5220d8d7cddbb668d02045ebd36709ba0bc6f.tar.gz STC-modified-0fa5220d8d7cddbb668d02045ebd36709ba0bc6f.zip | |
More removal of parameter side-effects when invoking i_valfrom() i_valto() in cvec, cdeq.
| -rw-r--r-- | include/stc/cdeq.h | 8 | ||||
| -rw-r--r-- | include/stc/cvec.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index 7a5ae690..f31000db 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -315,11 +315,11 @@ cx_memb(_push_front)(Self* self, i_val value) { }
STC_DEF cx_iter_t
-cx_memb(_insert_range_p)(Self* self, cx_value_t* pos, const cx_value_t* p1,
- const cx_value_t* p2, bool clone) {
+cx_memb(_insert_range_p)(Self* self, cx_value_t* pos,
+ const cx_value_t* p1, const cx_value_t* p2, bool clone) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- if (clone) while (p1 != p2) *pos++ = i_valfrom(i_valto(p1++));
+ if (clone) while (p1 != p2) { *pos++ = i_valfrom(i_valto(p1)); ++p1; }
else memcpy(pos, p1, (p2 - p1)*sizeof *p1);
return it;
}
@@ -328,7 +328,7 @@ STC_DEF cx_iter_t cx_memb(_emplace_range_p)(Self* self, cx_value_t* pos, const cx_rawvalue_t* p1, const cx_rawvalue_t* p2) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- while (p1 != p2) *pos++ = i_valfrom(*p1++);
+ while (p1 != p2) { *pos++ = i_valfrom(*p1); ++p1; }
return it;
}
diff --git a/include/stc/cvec.h b/include/stc/cvec.h index 283e769d..745411fc 100644 --- a/include/stc/cvec.h +++ b/include/stc/cvec.h @@ -305,11 +305,11 @@ cx_memb(_insert_space_)(Self* self, cx_value_t* pos, size_t len) { }
STC_DEF cx_iter_t
-cx_memb(_insert_range_p)(Self* self, cx_value_t* pos, const cx_value_t* p1,
- const cx_value_t* p2, bool clone) {
+cx_memb(_insert_range_p)(Self* self, cx_value_t* pos,
+ const cx_value_t* p1, const cx_value_t* p2, bool clone) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- if (clone) while (p1 != p2) *pos++ = i_valfrom(i_valto(p1++));
+ if (clone) while (p1 != p2) { *pos++ = i_valfrom(i_valto(p1)); ++p1; }
else memcpy(pos, p1, (p2 - p1)*sizeof *p1);
return it;
}
@@ -319,7 +319,7 @@ cx_memb(_emplace_range_p)(Self* self, cx_value_t* pos, const cx_rawvalue_t* p1, const cx_rawvalue_t* p2) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- while (p1 != p2) *pos++ = i_valfrom(*p1++);
+ while (p1 != p2) { *pos++ = i_valfrom(*p1); ++p1; }
return it;
}
|
