Skip to content

Commit

Permalink
add clarifying comment
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Jan 1, 2025
1 parent 0bfd088 commit 2719a3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/OpenEXRCore/internal_huf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,9 @@ READ64(const uint8_t * c)
#endif

#ifndef HAVE_READ64
// the previous code did (effectively) the commented out line below, but
// the type cast to uint64_t triggers UB with an unaligned read (memcpy
// above will be removed by the compiler and inlined to a safe load/cast)
//#define READ64(c) __builtin_bswap64 (*(const uint64_t*) (c))
# define READ64(c) \
((uint64_t) (c)[0] << 56) | ((uint64_t) (c)[1] << 48) | \
Expand Down

0 comments on commit 2719a3b

Please sign in to comment.