summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cstack.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-23 22:44:33 +0200
committerTyge Løvset <[email protected]>2023-05-23 22:44:33 +0200
commitb1bbd0564a0d8d43172a654b51ff28bb62e0979a (patch)
treedc6da16a716f65c4d226b9600fd270f5173d735d /include/stc/cstack.h
parentf80a78239f545d7d73c8358056dd5d5825ccfe0b (diff)
downloadSTC-modified-b1bbd0564a0d8d43172a654b51ff28bb62e0979a.tar.gz
STC-modified-b1bbd0564a0d8d43172a654b51ff28bb62e0979a.zip
Some house holding cleanup.
Diffstat (limited to 'include/stc/cstack.h')
-rw-r--r--include/stc/cstack.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/include/stc/cstack.h b/include/stc/cstack.h
index ae8b3c40..fa0fab2b 100644
--- a/include/stc/cstack.h
+++ b/include/stc/cstack.h
@@ -41,20 +41,14 @@
#endif
typedef i_keyraw _cx_raw;
-STC_INLINE _cx_self _cx_memb(_init)(void) {
- _cx_self cx; cx._len = 0;
-#ifndef i_capacity
- cx._cap = 0; cx.data = NULL;
-#endif
- return cx;
-}
-
#ifdef i_capacity
-STC_INLINE void _cx_memb(_create)(_cx_self* self)
+STC_INLINE void _cx_memb(_init)(_cx_self* self)
{ self->_len = 0; }
#else
-STC_INLINE void _cx_memb(_create)(_cx_self* self)
- { self->_len = 0; self->_cap = 0; self->data = NULL; }
+STC_INLINE _cx_self _cx_memb(_init)(void) {
+ _cx_self out = {0};
+ return out;
+}
STC_INLINE _cx_self _cx_memb(_with_capacity)(intptr_t cap) {
_cx_self out = {(_cx_value *) i_malloc(cap*c_sizeof(i_key)), 0, cap};