Skip to content

Commit a4b4354

Browse files
committed
CLN: Remove aliasing
Remove aliasing to prevent warnings
1 parent b262e3c commit a4b4354

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

randomstate/interface/dSFMT/dSFMT-shim.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ static NPY_INLINE double random_double(aug_state *state) {
6767
}
6868

6969
static NPY_INLINE uint64_t random_raw_values(aug_state *state) {
70+
uint64_t out;
7071
double d = random_double_from_buffer(state);
71-
return *((uint64_t *)&d);
72+
73+
memcpy(&out, &d, sizeof(d));
74+
return out;
7275
}
7376

7477
extern void entropy_init(aug_state *state);

0 commit comments

Comments
 (0)