-- v2: combase: Use the isxdigit function instead of reimplementing it.
From: Alex Henrie alexhenrie24@gmail.com
--- dlls/combase/combase.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index 0695bb77405..898d571f1af 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -1308,15 +1308,6 @@ HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progi return hr; }
-static inline BOOL is_valid_hex(WCHAR c) -{ - if (!(((c >= '0') && (c <= '9')) || - ((c >= 'a') && (c <= 'f')) || - ((c >= 'A') && (c <= 'F')))) - return FALSE; - return TRUE; -} - static const BYTE guid_conv_table[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */ @@ -1346,7 +1337,7 @@ static BOOL guid_from_string(LPCWSTR s, GUID *id) id->Data1 = 0; for (i = 1; i < 9; ++i) { - if (!is_valid_hex(s[i])) return FALSE; + if (!isxdigit(s[i])) return FALSE; id->Data1 = (id->Data1 << 4) | guid_conv_table[s[i]]; } if (s[9] != '-') return FALSE; @@ -1354,7 +1345,7 @@ static BOOL guid_from_string(LPCWSTR s, GUID *id) id->Data2 = 0; for (i = 10; i < 14; ++i) { - if (!is_valid_hex(s[i])) return FALSE; + if (!isxdigit(s[i])) return FALSE; id->Data2 = (id->Data2 << 4) | guid_conv_table[s[i]]; } if (s[14] != '-') return FALSE; @@ -1362,7 +1353,7 @@ static BOOL guid_from_string(LPCWSTR s, GUID *id) id->Data3 = 0; for (i = 15; i < 19; ++i) { - if (!is_valid_hex(s[i])) return FALSE; + if (!isxdigit(s[i])) return FALSE; id->Data3 = (id->Data3 << 4) | guid_conv_table[s[i]]; } if (s[19] != '-') return FALSE; @@ -1374,7 +1365,7 @@ static BOOL guid_from_string(LPCWSTR s, GUID *id) if (s[i] != '-') return FALSE; i++; } - if (!is_valid_hex(s[i]) || !is_valid_hex(s[i + 1])) return FALSE; + if (!isxdigit(s[i]) || !isxdigit(s[i + 1])) return FALSE; id->Data4[(i - 20) / 2] = guid_conv_table[s[i]] << 4 | guid_conv_table[s[i + 1]]; }
This merge request was closed by Alex Henrie.