Skip to content

Commit

Permalink
More portable code
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Aug 25, 2022
1 parent 8d8c607 commit 0164b87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/array_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,8 +1918,9 @@ bool memequals(const void *s1, const void *s2, size_t n) {
}

while (ptr1 < end8) {
uint64_t v1 = *((const uint64_t*)ptr1);
uint64_t v2 = *((const uint64_t*)ptr2);
uint64_t v1, v2;
memcpy(&v1,ptr1,sizeof(uint64_t));
memcpy(&v2,ptr2,sizeof(uint64_t));
if (v1 != v2) {
return false;
}
Expand Down

0 comments on commit 0164b87

Please sign in to comment.