diff options
| author | Tyge Lovset <[email protected]> | 2022-08-11 00:05:39 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-08-11 00:05:39 +0200 |
| commit | 35f63cb6d76f47a00daa5929808d75f715566657 (patch) | |
| tree | 3be2f910275e37510530d28f20b3f74952c5877b /include/stc/cdeq.h | |
| parent | 0604d29a95d77f5dc9aeb4813e126a3831062648 (diff) | |
| download | STC-modified-35f63cb6d76f47a00daa5929808d75f715566657.tar.gz STC-modified-35f63cb6d76f47a00daa5929808d75f715566657.zip | |
Code formatting only.
Diffstat (limited to 'include/stc/cdeq.h')
| -rw-r--r-- | include/stc/cdeq.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h index d08e0155..644af838 100644 --- a/include/stc/cdeq.h +++ b/include/stc/cdeq.h @@ -92,13 +92,6 @@ STC_INLINE _cx_value* _cx_memb(_back)(const _cx_self* self) { return self->data + cdeq_rep_(self)->size - 1; } STC_INLINE void _cx_memb(_pop_front)(_cx_self* self) // == _pop() when _i_queue { i_keydrop(self->data); ++self->data; --cdeq_rep_(self)->size; } -STC_INLINE _cx_iter _cx_memb(_begin)(const _cx_self* self) - { size_t n = cdeq_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 + cdeq_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; } #if !defined _i_queue @@ -143,6 +136,21 @@ _cx_memb(_erase_range)(_cx_self* self, _cx_iter i1, _cx_iter i2) { return _cx_memb(_erase_range_p)(self, i1.ref, (i2.ref ? i2.ref : i2._end)); } + +STC_INLINE _cx_iter _cx_memb(_begin)(const _cx_self* self) { + size_t n = cdeq_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 + cdeq_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; } + #if !defined _i_no_emplace STC_INLINE _cx_value* _cx_memb(_emplace_front)(_cx_self* self, _cx_raw raw) { |
