summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/cmap.h4
-rw-r--r--include/stc/forward.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h
index 50df1b64..1cb8bb3f 100644
--- a/include/stc/cmap.h
+++ b/include/stc/cmap.h
@@ -53,7 +53,7 @@ int main(void) {
#include "forward.h"
#include <stdlib.h>
#include <string.h>
-#define _cmap_inits {NULL, NULL, 0, 0, 0.85f}
+#define _cmap_inits {0.85f}
typedef struct { size_t idx; uint8_t hx; } chash_bucket_t;
#endif // CMAP_H_INCLUDED
@@ -382,10 +382,10 @@ _cx_memb(_reserve)(_cx_self* self, const size_t _newcap) {
_nbuckets |= 1;
#endif
_cx_self m = {
+ self->max_load_factor,
c_alloc_n(_cx_value, _nbuckets),
(uint8_t *) c_calloc(_nbuckets + 1, 1),
self->size, (i_size)_nbuckets,
- self->max_load_factor
};
bool ok = m.table && m._hashx;
if (ok) { /* Rehash: */
diff --git a/include/stc/forward.h b/include/stc/forward.h
index 9c462b8e..04566b98 100644
--- a/include/stc/forward.h
+++ b/include/stc/forward.h
@@ -125,10 +125,10 @@ typedef union {
} SELF##_iter; \
\
typedef struct { \
+ float max_load_factor; \
SELF##_value* table; \
uint8_t* _hashx; \
SELF##_size_t size, bucket_count; \
- float max_load_factor; \
} SELF
#if defined STC_CSMAP_V1