Changeset: 044e5e238712 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/044e5e238712
Modified Files:
gdk/gdk_hash.c
gdk/gdk_hash.h
Branch: ustr
Log Message:
Work around compilation issue on MacOS with GCC.
"error: dereferencing type-punned pointer will break strict-aliasing rules"
possibly because size_t is unsigned long and ulng is uint64_t is unsigned long
long.
diffs (35 lines):
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -884,7 +884,7 @@ BAThash_impl(BAT *restrict b, struct can
if (offsets) {
TIMEOUT_LOOP_IDX(p, cnt1, qry_ctx) {
var_t off = VarHeapVal(bi.base, o -
b->hseqbase, bi.width);
- c = hash_oid(h, &off);
+ c = HASHbucket(h, (BUN) mix_oid(off));
hget = HASHget(h, c);
if (hget == BUN_NONE) {
if (h->nheads == maxslots)
@@ -995,7 +995,7 @@ BAThash_impl(BAT *restrict b, struct can
if (offsets) {
TIMEOUT_LOOP(ci->ncand - p, qry_ctx) {
var_t off = VarHeapVal(bi.base, o -
b->hseqbase, bi.width);
- c = hash_oid(h, &off);
+ c = HASHbucket(h, (BUN) mix_oid(off));
hget = HASHget(h, c);
h->nheads += hget == BUN_NONE;
if (!hascand) {
diff --git a/gdk/gdk_hash.h b/gdk/gdk_hash.h
--- a/gdk/gdk_hash.h
+++ b/gdk/gdk_hash.h
@@ -208,8 +208,10 @@ HASHgetlink(const Hash *h, BUN i)
#define hash_hge(H,V) HASHbucket(H, (BUN) mix_hge(*(const uhge *) (V)))
#endif
#if SIZEOF_OID == SIZEOF_INT
+#define mix_oid(V) mix_int(V)
#define hash_oid(H,V) hash_int(H,V)
#else
+#define mix_oid(V) mix_lng(V)
#define hash_oid(H,V) hash_lng(H,V)
#endif
#define hash_inet4(H,V) HASHbucket(H, (BUN) mix_inet4(*(const inet4 *)
(V)))
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]