summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cbox.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-10-21 09:26:13 +0200
committerTyge Løvset <[email protected]>2022-10-21 09:26:13 +0200
commit2cefae32252f3051f75f44f4718a62a1210bd3a7 (patch)
treebe09d9f91e918ad36a21e5919200e8343b3e0884 /include/stc/cbox.h
parent650f6218c1b2afce696b2dd7e98c76dcdeafce24 (diff)
downloadSTC-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/cbox.h')
-rw-r--r--include/stc/cbox.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/stc/cbox.h b/include/stc/cbox.h
index fbd19c50..17ec026f 100644
--- a/include/stc/cbox.h
+++ b/include/stc/cbox.h
@@ -73,7 +73,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"
@@ -148,15 +148,6 @@ STC_INLINE void _cx_memb(_take)(_cx_self* self, _cx_self other) {
*self = other;
}
-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);
@@ -166,6 +157,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;