From b5b62cc15edd2f4f2053a629cbcf6340b15e307e Mon Sep 17 00:00:00 2001 From: Willy Tu Date: Thu, 8 Jun 2023 08:48:19 -0700 Subject: 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 Signed-off-by: Ed Tanous --- redfish-core/include/utils/hex_utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'redfish-core/include') 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(ch) - 'A' + 10; + rc = static_cast(ch - 'A') + 10U; } else if (ch >= 'a' && ch <= 'f') { - rc = static_cast(ch) - 'a' + 10; + rc = static_cast(ch - 'a') + 10U; } return rc; -- cgit v1.2.3