diff options
| author | Tyge Løvset <[email protected]> | 2022-10-21 09:26:13 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-10-21 09:26:13 +0200 |
| commit | 2cefae32252f3051f75f44f4718a62a1210bd3a7 (patch) | |
| tree | be09d9f91e918ad36a21e5919200e8343b3e0884 /include/stc/carc.h | |
| parent | 650f6218c1b2afce696b2dd7e98c76dcdeafce24 (diff) | |
| download | STC-modified-2cefae32252f3051f75f44f4718a62a1210bd3a7.tar.gz STC-modified-2cefae32252f3051f75f44f4718a62a1210bd3a7.zip | |
Fixed wrong formatting of 64bit values various places.
Finialized cbox/carc issues.
Diffstat (limited to 'include/stc/carc.h')
| -rw-r--r-- | include/stc/carc.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h index cbe2e9e7..7209eb28 100644 --- a/include/stc/carc.h +++ b/include/stc/carc.h @@ -81,7 +81,7 @@ int main() { #if !(defined i_cmp || defined i_less || defined i_key_class || defined i_val_class) #define _i_no_cmp #endif -#if !(defined i_eq || defined i_hash) +#if !(defined i_eq || defined i_hash || defined i_key_class || defined i_val_class) #define _i_no_hash #endif #include "template.h" @@ -174,15 +174,6 @@ STC_INLINE void _cx_memb(_take)(_cx_self* self, _cx_self ptr) { *self = ptr; } -STC_INLINE uint64_t _cx_memb(_value_hash)(const _cx_value* x) { - #if defined _i_no_hash - return (uint64_t)x; - #else - _cx_raw rx = i_keyto(x); - return i_hash((&rx)); - #endif -} - STC_INLINE int _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y) { #if defined _i_no_cmp return c_default_cmp(&x, &y); @@ -192,6 +183,15 @@ STC_INLINE int _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y) { #endif } +STC_INLINE uint64_t _cx_memb(_value_hash)(const _cx_value* x) { + #if defined _i_no_hash + return (uintptr_t)x; + #else + _cx_raw rx = i_keyto(x); + return i_hash((&rx)); + #endif +} + STC_INLINE bool _cx_memb(_value_eq)(const _cx_value* x, const _cx_value* y) { #if defined _i_no_hash return x == y; |
