Skip to content

BLD: strict alias warning in float hashtable #18025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pandas/_libs/src/klib/khash_python.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <string.h>
#include <Python.h>

#include "khash.h"
Expand All @@ -14,7 +15,9 @@
// hash for 64 bit integers.
// GH 13436
khint64_t PANDAS_INLINE asint64(double key) {
return *(khint64_t *)(&key);
khint64_t val;
memcpy(&val, &key, sizeof(double));
return val;
}
#define kh_float64_hash_func(key) (khint32_t)((asint64(key))>>33^(asint64(key))^(asint64(key))<<11)
#define kh_float64_hash_equal(a, b) ((a) == (b) || ((b) != (b) && (a) != (a)))
Expand Down