diff options
| author | Dan Engelbrecht <[email protected]> | 2022-03-23 23:45:06 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-03-31 11:29:27 +0200 |
| commit | 7255a5652f5e4788f13a1d6bbcbd53c7f93f90d8 (patch) | |
| tree | aeabdf91c72dbd61f8b55096cc1e42e1337c2cc6 /zencore/string.cpp | |
| parent | Rename FormatHex to ToHex (diff) | |
| download | zen-7255a5652f5e4788f13a1d6bbcbd53c7f93f90d8.tar.xz zen-7255a5652f5e4788f13a1d6bbcbd53c7f93f90d8.zip | |
clean up number -> hex -> number code
Diffstat (limited to 'zencore/string.cpp')
| -rw-r--r-- | zencore/string.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/zencore/string.cpp b/zencore/string.cpp index 933d210e7..ad6ee78fc 100644 --- a/zencore/string.cpp +++ b/zencore/string.cpp @@ -335,33 +335,6 @@ NiceNumGeneral(uint64_t Num, std::span<char> Buffer, NicenumFormat Format) } } -bool -ParseHex(const std::string HexString, uint32_t& OutValue) -{ - if (HexString.length() != 8) - { - return false; - } - OutValue = strtoul(HexString.data(), 0, 16); - return true; -} - -static const char HexLUT[] = "0123456789abcdef"; - -void -ToHex(uint32_t Value, char OutBlockHexString[9]) -{ - OutBlockHexString[0] = HexLUT[(Value >> 28) & 0xf]; - OutBlockHexString[1] = HexLUT[(Value >> 24) & 0xf]; - OutBlockHexString[2] = HexLUT[(Value >> 20) & 0xf]; - OutBlockHexString[3] = HexLUT[(Value >> 16) & 0xf]; - OutBlockHexString[4] = HexLUT[(Value >> 12) & 0xf]; - OutBlockHexString[5] = HexLUT[(Value >> 8) & 0xf]; - OutBlockHexString[6] = HexLUT[(Value >> 4) & 0xf]; - OutBlockHexString[7] = HexLUT[(Value >> 0) & 0xf]; - OutBlockHexString[8] = 0; -} - size_t NiceNumToBuffer(uint64_t Num, std::span<char> Buffer) { |