summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cbits.h
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-12 19:39:59 +0200
committertylov <[email protected]>2023-07-12 21:01:46 +0200
commitebe5abc29d51c643520301e42124365477f44957 (patch)
treef1188f5c649f4244c384484ae584894280396272 /include/stc/cbits.h
parent715a02ba8155de2f7d446e8d7d2ae305c27996b9 (diff)
downloadSTC-modified-ebe5abc29d51c643520301e42124365477f44957.tar.gz
STC-modified-ebe5abc29d51c643520301e42124365477f44957.zip
Changed docs and examples to use i_key* template parameters instead of i_val* for all non-maps.
Renamed c_ASSERT() to c_assert() and added optional message parameter to c_static_assert().
Diffstat (limited to 'include/stc/cbits.h')
-rw-r--r--include/stc/cbits.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h
index 9463c82c..66bc6354 100644
--- a/include/stc/cbits.h
+++ b/include/stc/cbits.h
@@ -90,7 +90,7 @@ STC_INLINE _llong _cbits_count(const uint64_t* set, const _llong sz) {
STC_INLINE char* _cbits_to_str(const uint64_t* set, const _llong sz,
char* out, _llong start, _llong stop) {
if (stop > sz) stop = sz;
- assert(start <= stop);
+ c_assert(start <= stop);
c_memset(out, '0', stop - start);
for (_llong i = start; i < stop; ++i)
@@ -122,7 +122,7 @@ STC_INLINE bool _cbits_disjoint(const uint64_t* set, const uint64_t* other, cons
#if !defined i_capacity // DYNAMIC SIZE BITARRAY
-#define _i_assert(x) assert(x)
+#define _i_assert(x) c_assert(x)
#define i_type cbits
typedef struct { uint64_t *data64; _llong _size; } i_type;
@@ -216,13 +216,13 @@ STC_INLINE void _i_memb(_set_all)(i_type *self, const bool value);
STC_INLINE void _i_memb(_set_pattern)(i_type *self, const uint64_t pattern);
STC_INLINE i_type _i_memb(_with_size)(const _llong size, const bool value) {
- assert(size <= i_capacity);
+ c_assert(size <= i_capacity);
i_type set; _i_memb(_set_all)(&set, value);
return set;
}
STC_INLINE i_type _i_memb(_with_pattern)(const _llong size, const uint64_t pattern) {
- assert(size <= i_capacity);
+ c_assert(size <= i_capacity);
i_type set; _i_memb(_set_pattern)(&set, pattern);
return set;
}