summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-10 21:37:29 +0200
committerTyge Løvset <[email protected]>2022-09-10 21:37:29 +0200
commit7eaeb7bb2c7cad9b0a437df71a396424b0c6933e (patch)
treea3b0195e41f8451604cd907a6bd360c9c42f273d /include
parentd6a4bdb81312d5e3b1894d261932002b57f4c830 (diff)
downloadSTC-modified-7eaeb7bb2c7cad9b0a437df71a396424b0c6933e.tar.gz
STC-modified-7eaeb7bb2c7cad9b0a437df71a396424b0c6933e.zip
Renamed template parameter i_cap => i_capacity
Diffstat (limited to 'include')
-rw-r--r--include/stc/cbits.h18
-rw-r--r--include/stc/cstack.h16
-rw-r--r--include/stc/template.h2
3 files changed, 18 insertions, 18 deletions
diff --git a/include/stc/cbits.h b/include/stc/cbits.h
index a1b84acd..f6f57bcb 100644
--- a/include/stc/cbits.h
+++ b/include/stc/cbits.h
@@ -115,7 +115,7 @@ STC_INLINE bool _cbits_disjoint(const uint64_t* set, const uint64_t* other, cons
#define _i_memb(name) c_paste(i_type, name)
-#if !defined i_cap // DYNAMIC SIZE BITARRAY
+#if !defined i_capacity // DYNAMIC SIZE BITARRAY
#define _i_assert(x) assert(x)
#define i_type cbits
@@ -185,19 +185,19 @@ STC_INLINE cbits cbits_with_pattern(const size_t size, const uint64_t pattern) {
return set;
}
-#else // i_cap: FIXED SIZE BITARRAY
+#else // i_capacity: FIXED SIZE BITARRAY
#define _i_assert(x) (void)0
#ifndef i_type
-#define i_type c_paste(cbits, i_cap)
+#define i_type c_paste(cbits, i_capacity)
#endif
-struct { uint64_t data64[(i_cap - 1)/64 + 1]; } typedef i_type;
+struct { uint64_t data64[(i_capacity - 1)/64 + 1]; } typedef i_type;
STC_INLINE i_type _i_memb(_init)(void) { return c_make(i_type){0}; }
STC_INLINE void _i_memb(_inits)(i_type* self) {}
STC_INLINE void _i_memb(_drop)(i_type* self) {}
-STC_INLINE size_t _i_memb(_size)(const i_type* self) { return i_cap; }
+STC_INLINE size_t _i_memb(_size)(const i_type* self) { return i_capacity; }
STC_INLINE i_type _i_memb(_move)(i_type* self) { return *self; }
STC_INLINE i_type* _i_memb(_take)(i_type* self, i_type other)
@@ -213,17 +213,17 @@ 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 size_t size, const bool value) {
- assert(size <= i_cap);
+ assert(size <= i_capacity);
i_type set; _i_memb(_set_all)(&set, value);
return set;
}
STC_INLINE i_type _i_memb(_with_pattern)(const size_t size, const uint64_t pattern) {
- assert(size <= i_cap);
+ assert(size <= i_capacity);
i_type set; _i_memb(_set_pattern)(&set, pattern);
return set;
}
-#endif // i_cap
+#endif // i_capacity
// COMMON:
@@ -304,7 +304,7 @@ STC_INLINE bool _i_memb(_disjoint)(const i_type* self, const i_type* other) {
#define CBITS_H_INCLUDED
#undef _i_memb
#undef _i_assert
-#undef i_cap
+#undef i_capacity
#undef i_type
#undef i_opt
#undef i_header
diff --git a/include/stc/cstack.h b/include/stc/cstack.h
index 98d21e13..da38f508 100644
--- a/include/stc/cstack.h
+++ b/include/stc/cstack.h
@@ -34,9 +34,9 @@
#include "template.h"
#if !c_option(c_is_fwd)
-#ifdef i_cap
+#ifdef i_capacity
#define _i_no_clone
- _cx_deftypes(_c_cstack_fixed, _cx_self, i_key, i_cap);
+ _cx_deftypes(_c_cstack_fixed, _cx_self, i_key, i_capacity);
#else
_cx_deftypes(_c_cstack_types, _cx_self, i_key);
#endif
@@ -45,13 +45,13 @@ typedef i_keyraw _cx_raw;
STC_INLINE _cx_self _cx_memb(_init)(void) {
_cx_self s; s._len = 0;
-#ifndef i_cap
+#ifndef i_capacity
s._cap = 0; s.data = NULL;
#endif
return s;
}
-#ifdef i_cap
+#ifdef i_capacity
STC_INLINE void _cx_memb(_inits)(_cx_self* self)
{ self->_len = 0; }
#else
@@ -78,7 +78,7 @@ STC_INLINE void _cx_memb(_clear)(_cx_self* self) {
STC_INLINE void _cx_memb(_drop)(_cx_self* self) {
_cx_memb(_clear)(self);
-#ifndef i_cap
+#ifndef i_capacity
c_free(self->data);
#endif
}
@@ -90,16 +90,16 @@ STC_INLINE bool _cx_memb(_empty)(const _cx_self* self)
{ return !self->_len; }
STC_INLINE size_t _cx_memb(_capacity)(const _cx_self* self) {
-#ifndef i_cap
+#ifndef i_capacity
return self->_cap;
#else
- return i_cap;
+ return i_capacity;
#endif
}
STC_INLINE bool _cx_memb(_reserve)(_cx_self* self, size_t n) {
if (n < self->_len) return true;
-#ifndef i_cap
+#ifndef i_capacity
_cx_value *t = (_cx_value *)c_realloc(self->data, n*sizeof *t);
if (t) { self->_cap = n, self->data = t; return true; }
#endif
diff --git a/include/stc/template.h b/include/stc/template.h
index 41ecf7b0..04eea1d4 100644
--- a/include/stc/template.h
+++ b/include/stc/template.h
@@ -273,7 +273,7 @@
#undef i_cmp
#undef i_eq
#undef i_hash
-#undef i_cap
+#undef i_capacity
#undef i_size
#undef i_val