core: make bt_uuid_hash() portable across archs
authorBrian Gix <brian.gix@intel.com>
Wed, 29 Jun 2022 21:16:39 +0000 (14:16 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
commit05dcd1348e3f5f300181ea645951916f7dfebbc7
treef59bd96c6d7ec093a18ce17129bb4a0a591d3e58
parent3776294b8b62b701f46ab84750e065042c0c0b12
core: make bt_uuid_hash() portable across archs

bt_uuid_t is defined as a byte array, so it can cause alignment errors
on some architectures, when the two 64 bit halves are treated as u64s.
This patch ensures proper alignment across all architectures.

Fixes:
src/adapter.c: In function ‘bt_uuid_hash’:
src/adapter.c:3617:8: error: cast increases required alignment of
target type [-Werror=cast-align]
  val = (uint64_t *)&uuid_128.value.u128;
        ^
cc1: all warnings being treated as errors

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/adapter.c