summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-08-11 00:05:39 +0200
committerTyge Lovset <[email protected]>2022-08-11 00:05:39 +0200
commit35f63cb6d76f47a00daa5929808d75f715566657 (patch)
tree3be2f910275e37510530d28f20b3f74952c5877b /include/stc/cvec.h
parent0604d29a95d77f5dc9aeb4813e126a3831062648 (diff)
downloadSTC-modified-35f63cb6d76f47a00daa5929808d75f715566657.tar.gz
STC-modified-35f63cb6d76f47a00daa5929808d75f715566657.zip
Code formatting only.
Diffstat (limited to 'include/stc/cvec.h')
-rw-r--r--include/stc/cvec.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 99df920c..a457c3dc 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -136,14 +136,6 @@ STC_INLINE void _cx_memb(_pop)(_cx_self* self)
STC_INLINE _cx_value* _cx_memb(_push_back)(_cx_self* self, i_key value)
{ return _cx_memb(_push)(self, value); }
STC_INLINE void _cx_memb(_pop_back)(_cx_self* self) { _cx_memb(_pop)(self); }
-STC_INLINE _cx_iter _cx_memb(_begin)(const _cx_self* self)
- { size_t n = cvec_rep_(self)->size; return c_make(_cx_iter){n ? self->data : NULL, self->data + n}; }
-STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
- { return c_make(_cx_iter){NULL, self->data + cvec_rep_(self)->size}; }
-STC_INLINE void _cx_memb(_next)(_cx_iter* it) { if (++it->ref == it->_end) it->ref = NULL; }
-STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t offs)
- { if ((it.ref += offs) >= it._end) it.ref = NULL; return it; }
-STC_INLINE size_t _cx_memb(_index)(const _cx_self* cx, _cx_iter it) { return it.ref - cx->data; }
STC_INLINE _cx_self
_cx_memb(_with_size)(const size_t size, i_key null) {
@@ -204,6 +196,24 @@ _cx_memb(_at_mut)(_cx_self* self, const size_t idx) {
assert(idx < cvec_rep_(self)->size); return self->data + idx;
}
+
+STC_INLINE _cx_iter _cx_memb(_begin)(const _cx_self* self) {
+ size_t n = cvec_rep_(self)->size;
+ return c_make(_cx_iter){n ? self->data : NULL, self->data + n};
+}
+
+STC_INLINE _cx_iter _cx_memb(_end)(const _cx_self* self)
+ { return c_make(_cx_iter){NULL, self->data + cvec_rep_(self)->size}; }
+
+STC_INLINE void _cx_memb(_next)(_cx_iter* it)
+ { if (++it->ref == it->_end) it->ref = NULL; }
+
+STC_INLINE _cx_iter _cx_memb(_advance)(_cx_iter it, size_t n)
+ { if ((it.ref += n) >= it._end) it.ref = NULL; return it; }
+
+STC_INLINE size_t _cx_memb(_index)(const _cx_self* cx, _cx_iter it)
+ { return it.ref - cx->data; }
+
#if !c_option(c_no_cmp)
STC_INLINE _cx_iter