Skip to content

Commit

Permalink
build: Add missing cast when assigning uint to pointer (#230)
Browse files Browse the repository at this point in the history
This impacts only big endian architectures.
  • Loading branch information
SlouchyButton authored Aug 23, 2024
1 parent fc0db22 commit 79b57b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions regressions/ck_ec/benchmark/ck_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void wait64(const struct ck_ec_wait_state *state,
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
low_half = address;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
low_half = (uintptr_t)address + sizeof(uint32_t);
low_half = (void *)((uintptr_t)address + sizeof(uint32_t));
#else
# error "__BYTE_ORDER__ must be defined."
#endif
Expand Down Expand Up @@ -165,7 +165,7 @@ static void wake64(const struct ck_ec_ops *ops, const uint64_t *address)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
low_half = address;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
low_half = (uintptr_t)address + sizeof(uint32_t);
low_half = (void *)((uintptr_t)address + sizeof(uint32_t));
#else
# error "__BYTE_ORDER__ must be defined."
#endif
Expand Down
4 changes: 2 additions & 2 deletions regressions/ck_ec/validate/ck_ec_smoke_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void wait64(const struct ck_ec_wait_state *state,
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
low_half = address;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
low_half = (uintptr_t)address + sizeof(uint32_t);
low_half = (void *)((uintptr_t)address + sizeof(uint32_t));
#else
# error "__BYTE_ORDER__ must be defined."
#endif
Expand Down Expand Up @@ -90,7 +90,7 @@ static void wake64(const struct ck_ec_ops *ops, const uint64_t *address)
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
low_half = address;
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
low_half = (uintptr_t)address + sizeof(uint32_t);
low_half = (void *)((uintptr_t)address + sizeof(uint32_t));
#else
# error "__BYTE_ORDER__ must be defined."
#endif
Expand Down

0 comments on commit 79b57b4

Please sign in to comment.