Add/move code into kutil library
This commit is contained in:
12
src/modules/kutil/misc.h
Normal file
12
src/modules/kutil/misc.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
namespace kutil {
|
||||
|
||||
constexpr uint32_t
|
||||
byteswap(uint32_t x)
|
||||
{
|
||||
return ((x >> 24) & 0x000000ff) | ((x >> 8) & 0x0000ff00)
|
||||
| ((x << 8) & 0x00ff0000) | ((x << 24) & 0xff000000);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user