Skip to content

Commit 13df8b7

Browse files
committed
Strict warning compilation compliance fixes.
1 parent 5c4532e commit 13df8b7

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/unsafe_ops.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ void cache_operation(void* addr, size_t size, cache_operation_t op) {
380380
default: break;
381381
}
382382
#endif
383+
384+
size = 0;
385+
(void) size;
383386
}
384387

385388
void prefetch_memory(void* addr, size_t size, bool write_hint) {
@@ -666,14 +669,14 @@ uint32_t byte_swap32(uint32_t value) {
666669
}
667670

668671
uint64_t byte_swap64(uint64_t value) {
669-
return static_cast<uint64_t>((value & (0xFF00000000000000)) >> 56) |
670-
static_cast<uint64_t>((value & (0x00FF000000000000)) >> 40) |
671-
static_cast<uint64_t>((value & (0x0000FF0000000000)) >> 24) |
672-
static_cast<uint64_t>((value & (0x000000FF00000000)) >> 8) |
673-
static_cast<uint64_t>((value & (0x00000000FF000000)) << 8) |
674-
static_cast<uint64_t>((value & (0x0000000000FF0000)) << 24) |
675-
static_cast<uint64_t>((value & (0x000000000000FF00)) << 40) |
676-
static_cast<uint64_t>((value & (0x00000000000000FF)) << 56);
672+
return ((value & UINT64_C(0xFF00000000000000)) >> 56) |
673+
((value & UINT64_C(0x00FF000000000000)) >> 40) |
674+
((value & UINT64_C(0x0000FF0000000000)) >> 24) |
675+
((value & UINT64_C(0x000000FF00000000)) >> 8) |
676+
((value & UINT64_C(0x00000000FF000000)) << 8) |
677+
((value & UINT64_C(0x0000000000FF0000)) << 24) |
678+
((value & UINT64_C(0x000000000000FF00)) << 40) |
679+
((value & UINT64_C(0x00000000000000FF)) << 56);
677680
}
678681

679682
void convert_endianness_buffer(void* buffer, size_t size, size_t element_size) {

0 commit comments

Comments
 (0)