Add/move code into kutil library

This commit is contained in:
Justin C. Miller
2018-04-17 23:41:28 -07:00
parent 2050b89334
commit a27b8d6a3a
15 changed files with 80 additions and 45 deletions

12
src/modules/kutil/misc.h Normal file
View 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);
}
}