Skip to content

Commit 6f04a86

Browse files
committed
static cast
1 parent cef842e commit 6f04a86

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

libc/include/llvm-libc-macros/endian-macros.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@
2020
#define htobe16(x) __builtin_bswap16((x))
2121
#define htobe32(x) __builtin_bswap32((x))
2222
#define htobe64(x) __builtin_bswap64((x))
23-
#define htole16(x) __LLVM_LIBC_CAST(reinterpret_cast, uint16_t, x)
24-
#define htole32(x) __LLVM_LIBC_CAST(reinterpret_cast, uint32_t, x)
25-
#define htole64(x) __LLVM_LIBC_CAST(reinterpret_cast, uint64_t, x)
23+
#define htole16(x) __LLVM_LIBC_CAST(static_cast, uint16_t, x)
24+
#define htole32(x) __LLVM_LIBC_CAST(static_cast, uint32_t, x)
25+
#define htole64(x) __LLVM_LIBC_CAST(static_cast, uint64_t, x)
2626
#define be16toh(x) __builtin_bswap16((x))
2727
#define be32toh(x) __builtin_bswap32((x))
2828
#define be64toh(x) __builtin_bswap64((x))
29-
#define le16toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint16_t, x)
30-
#define le32toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint32_t, x)
31-
#define le64toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint64_t, x)
29+
#define le16toh(x) __LLVM_LIBC_CAST(static_cast, uint16_t, x)
30+
#define le32toh(x) __LLVM_LIBC_CAST(static_cast, uint32_t, x)
31+
#define le64toh(x) __LLVM_LIBC_CAST(static_cast, uint64_t, x)
3232

3333
#else
3434

35-
#define htobe16(x) __LLVM_LIBC_CAST(reinterpret_cast, uint16_t, x)
36-
#define htobe32(x) __LLVM_LIBC_CAST(reinterpret_cast, uint32_t, x)
37-
#define htobe64(x) __LLVM_LIBC_CAST(reinterpret_cast, uint64_t, x)
35+
#define htobe16(x) __LLVM_LIBC_CAST(static_cast, uint16_t, x)
36+
#define htobe32(x) __LLVM_LIBC_CAST(static_cast, uint32_t, x)
37+
#define htobe64(x) __LLVM_LIBC_CAST(static_cast, uint64_t, x)
3838
#define htole16(x) __builtin_bswap16((x))
3939
#define htole32(x) __builtin_bswap32((x))
4040
#define htole64(x) __builtin_bswap64((x))
41-
#define be16toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint16_t, x)
42-
#define be32toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint32_t, x)
43-
#define be64toh(x) __LLVM_LIBC_CAST(reinterpret_cast, uint64_t, x)
41+
#define be16toh(x) __LLVM_LIBC_CAST(static_cast, uint16_t, x)
42+
#define be32toh(x) __LLVM_LIBC_CAST(static_cast, uint32_t, x)
43+
#define be64toh(x) __LLVM_LIBC_CAST(static_cast, uint64_t, x)
4444
#define le16toh(x) __builtin_bswap16((x))
4545
#define le32toh(x) __builtin_bswap32((x))
4646
#define le64toh(x) __builtin_bswap64((x))

0 commit comments

Comments
 (0)