summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-05-19 20:55:57 +0200
committerTyge Lovset <[email protected]>2023-05-19 20:55:57 +0200
commit26513bb1352ab4e4ffe931aabd80868216afc551 (patch)
treeb21b3ede63e3661ad279c80e25ad9719a00281aa /include/stc
parentd629139d053fdc1ff24bc0dc1985e1a2d1a0ac47 (diff)
downloadSTC-modified-26513bb1352ab4e4ffe931aabd80868216afc551.tar.gz
STC-modified-26513bb1352ab4e4ffe931aabd80868216afc551.zip
Minor cbits change.
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/cbits.h2
-rw-r--r--include/stc/cdeq.h4
-rw-r--r--include/stc/cqueue.h4
3 files changed, 4 insertions, 6 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h
index 855d6eb7..cf13790a 100644
--- a/include/stc/cbits.h
+++ b/include/stc/cbits.h
@@ -128,7 +128,6 @@ STC_INLINE bool _cbits_disjoint(const uint64_t* set, const uint64_t* other, cons
typedef struct { uint64_t *data64; int64_t _size; } i_type;
STC_INLINE cbits cbits_init(void) { return c_LITERAL(cbits){NULL}; }
-STC_INLINE void cbits_create(cbits* self) { self->data64 = NULL; self->_size = 0; }
STC_INLINE void cbits_drop(cbits* self) { c_free(self->data64); }
STC_INLINE int64_t cbits_size(const cbits* self) { return self->_size; }
@@ -200,7 +199,6 @@ STC_INLINE cbits cbits_with_pattern(const int64_t size, const uint64_t pattern)
typedef struct { uint64_t data64[(i_capacity - 1)/64 + 1]; } i_type;
STC_INLINE i_type _i_memb(_init)(void) { return c_LITERAL(i_type){0}; }
-STC_INLINE void _i_memb(_create)(i_type* self) {}
STC_INLINE void _i_memb(_drop)(i_type* self) {}
STC_INLINE int64_t _i_memb(_size)(const i_type* self) { return i_capacity; }
STC_INLINE i_type _i_memb(_move)(i_type* self) { return *self; }
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h
index 77fb015f..b3714bf8 100644
--- a/include/stc/cdeq.h
+++ b/include/stc/cdeq.h
@@ -94,7 +94,7 @@ _cx_memb(_emplace_at)(_cx_self* self, _cx_iter it, const _cx_raw raw)
{ return _cx_memb(_insert_at)(self, it, i_keyfrom(raw)); }
#endif
-#if defined _i_has_eq || defined _i_has_cmp
+#if defined _i_has_cmp || defined _i_has_eq
STC_API _cx_iter _cx_memb(_find_in)(_cx_iter p1, _cx_iter p2, _cx_raw raw);
STC_INLINE _cx_iter
@@ -172,7 +172,7 @@ _cx_memb(_emplace_n)(_cx_self* self, const intptr_t idx, const _cx_raw* raw, con
}
#endif
-#if defined _i_has_eq || defined _i_has_cmp
+#if defined _i_has_cmp || defined _i_has_eq
STC_DEF _cx_iter
_cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
for (; i1.pos != i2.pos; _cx_memb(_next)(&i1)) {
diff --git a/include/stc/cqueue.h b/include/stc/cqueue.h
index 1f2c7d0f..571c1fe9 100644
--- a/include/stc/cqueue.h
+++ b/include/stc/cqueue.h
@@ -62,7 +62,7 @@ STC_INLINE _cx_value* _cx_memb(_emplace)(_cx_self* self, _cx_raw raw)
{ return _cx_memb(_push)(self, i_keyfrom(raw)); }
#endif
-#if defined _i_has_eq || defined _i_has_cmp
+#if defined _i_has_cmp || defined _i_has_eq
STC_API bool _cx_memb(_eq)(const _cx_self* self, const _cx_self* other);
#endif
@@ -216,7 +216,7 @@ _cx_memb(_clone)(_cx_self cx) {
}
#endif // i_no_clone
-#if defined _i_has_eq || defined _i_has_cmp
+#if defined _i_has_cmp || defined _i_has_eq
STC_DEF bool
_cx_memb(_eq)(const _cx_self* self, const _cx_self* other) {
if (_cx_memb(_size)(self) != _cx_memb(_size)(other)) return false;