diff options
author | Willy Tu <wltu@google.com> | 2023-06-08 18:48:19 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-08 21:05:01 +0300 |
commit | b5b62cc15edd2f4f2053a629cbcf6340b15e307e (patch) | |
tree | af636538d3394bb4c93a6a4f0ac35fec20355f37 /redfish-core/include | |
parent | c51a58ee9231e48bb25ede75307591758f911395 (diff) | |
download | bmcweb-b5b62cc15edd2f4f2053a629cbcf6340b15e307e.tar.xz |
hex_units: Fix Werror=conversion
Convert all types to uint8_t to not hit the conversion warning.
Change-Id: Ia535ca0a2f4045cbde06a2f8f8eaad9570a0f4a5
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Diffstat (limited to 'redfish-core/include')
-rw-r--r-- | redfish-core/include/utils/hex_utils.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redfish-core/include/utils/hex_utils.hpp b/redfish-core/include/utils/hex_utils.hpp index f3728ea892..07ef4c8dfd 100644 --- a/redfish-core/include/utils/hex_utils.hpp +++ b/redfish-core/include/utils/hex_utils.hpp @@ -43,11 +43,11 @@ inline uint8_t hexCharToNibble(char ch) } else if (ch >= 'A' && ch <= 'F') { - rc = static_cast<uint8_t>(ch) - 'A' + 10; + rc = static_cast<uint8_t>(ch - 'A') + 10U; } else if (ch >= 'a' && ch <= 'f') { - rc = static_cast<uint8_t>(ch) - 'a' + 10; + rc = static_cast<uint8_t>(ch - 'a') + 10U; } return rc; |