aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-04-26 16:05:17 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-04-26 16:05:17 -0700
commita5d15fbccff504461b824b130f9cbc27905264a8 (patch)
tree98b0c4aac795a9faa322516cc1323119157b8995 /include
parent62f04ff585edd4f932f18ecad109f1d0213973a6 (diff)
fix(bio): buffer copying error
Diffstat (limited to 'include')
-rw-r--r--include/libn/macro/map.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/include/libn/macro/map.h b/include/libn/macro/map.h
index fae50ee..0743c1b 100644
--- a/include/libn/macro/map.h
+++ b/include/libn/macro/map.h
@@ -161,7 +161,6 @@ static const double __ac_HASH_UPPER = 0.77;
return 0;
#define MAP_PUT(map, key, val, hashfunc, equalfunc, resizefunc, err) \
- { \
int32 x = 0; \
if (map->n_occupied >= map->upper_bound) { \
if (map->n_buckets > (map->size << 1)) { \
@@ -214,16 +213,13 @@ static const double __ac_HASH_UPPER = 0.77;
++map->size; \
} else \
*err = 0; \
- return x; \
- }
+ return x;
#define MAP_DEL(map, x) \
- { \
if (x != map->n_buckets && !__ac_iseither(map->flags, x)) { \
__ac_set_isdel_true(map->flags, x); \
--map->size; \
- } \
- }
+ }
#define KEY_EXIST(m, x) (!__ac_iseither((m)->flags, (x)))
@@ -232,7 +228,7 @@ static const double __ac_HASH_UPPER = 0.77;
#define SET_STRUCT_BODY(key_t) \
int32 n_buckets, size, n_occupied, upper_bound; \
int32 *flags; \
- key_t *keys; \
+ key_t *keys \
#define SET_MAKE(type, h, alloc) \
type *set; \
@@ -242,7 +238,7 @@ static const double __ac_HASH_UPPER = 0.77;
#define SET_FREE(set, free, h) \
free(h, set->keys); \
free(h, set->flags); \
- free(h, set);
+ free(h, set)
#define SET_RESET(set) \
if (set && set->flags) { \
@@ -343,7 +339,6 @@ static const double __ac_HASH_UPPER = 0.77;
return 0;
#define SET_PUT(set, key, hashfunc, equalfunc, resizefunc, err) \
- { \
int32 x = 0; \
if (set->n_occupied >= set->upper_bound) { \
if (set->n_buckets > (set->size << 1)) { \
@@ -396,13 +391,10 @@ static const double __ac_HASH_UPPER = 0.77;
++set->size; \
} else \
*err = 0; \
- return x; \
- }
+ return x
#define SET_DEL(set, x) \
- { \
if (x != set->n_buckets && !__ac_iseither(set->flags, x)) { \
__ac_set_isdel_true(set->flags, x); \
--set->size; \
- } \
- }
+ }