diff options
| author | Tyge Løvset <[email protected]> | 2022-02-14 08:12:26 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-14 08:12:26 +0100 |
| commit | e7585be46ff8a7f37b57d944f90b401978db4e53 (patch) | |
| tree | 35a02092754bc2daf3d6ac63df52b550aa759909 /include/stc | |
| parent | 73babb8790566afbf105fdda3d6149b498f3242f (diff) | |
| parent | 8d4a2f591986e929a4d1a446dbed4494c0a00866 (diff) | |
| download | STC-modified-e7585be46ff8a7f37b57d944f90b401978db4e53.tar.gz STC-modified-e7585be46ff8a7f37b57d944f90b401978db4e53.zip | |
Merge pull request #19 from camel-cdr/patch-1
Fixed cmap.h for `sizeof(uint_fast8_t) != 1`
Diffstat (limited to 'include/stc')
| -rw-r--r-- | include/stc/cmap.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/cmap.h b/include/stc/cmap.h index d3281163..d4040e57 100644 --- a/include/stc/cmap.h +++ b/include/stc/cmap.h @@ -54,7 +54,7 @@ int main(void) { #include <stdlib.h>
#include <string.h>
#define _cmap_inits {NULL, NULL, 0, 0, 0.85f}
-typedef struct { MAP_SIZE_T idx; uint_fast8_t hx; } chash_bucket_t;
+typedef struct { MAP_SIZE_T idx; uint8_t hx; } chash_bucket_t;
#endif // CMAP_H_INCLUDED
#ifndef _i_prefix
@@ -288,8 +288,8 @@ STC_DEF void _cx_memb(_clear)(_cx_self* self) { STC_DEF chash_bucket_t
_cx_memb(_bucket_)(const _cx_self* self, const _cx_rawkey* rkeyptr) {
const uint64_t _hash = i_hash(rkeyptr, sizeof *rkeyptr);
- uint_fast8_t _hx; _cx_size _cap = self->bucket_count;
- chash_bucket_t b = {c_PASTE(fastrange_,MAP_SIZE_T)(_hash, _cap), (uint_fast8_t)(_hash | 0x80)};
+ uint8_t _hx; _cx_size _cap = self->bucket_count;
+ chash_bucket_t b = {c_PASTE(fastrange_,MAP_SIZE_T)(_hash, _cap), (uint8_t)(_hash | 0x80)};
const uint8_t* _hashx = self->_hashx;
while ((_hx = _hashx[b.idx])) {
if (_hx == b.hx) {
|
