int i;
for (i = 0; i < length && p < limit && ISXDIGIT (*p); ++i, ++p)
- result = (result << 4) + host_hex_value (*p);
+ result = (result << 4) + fromhex (*p);
for (i = 3; i >= 0; --i)
{
i < 3 && p < limit && ISDIGIT (*p) && *p != '8' && *p != '9';
++i)
{
- value = 8 * value + host_hex_value (*p);
+ value = 8 * value + fromhex (*p);
++p;
}
while (p < limit && ISXDIGIT (*p))
{
- value = 16 * value + host_hex_value (*p);
+ value = 16 * value + fromhex (*p);
++p;
}
return c & 0237;
}
-/* Convert a host character, C, to its hex value. C must already have
- been validated using isxdigit. */
-
-int
-host_hex_value (char c)
-{
- if (isdigit (c))
- return c - '0';
- if (c >= 'a' && c <= 'f')
- return 10 + c - 'a';
- gdb_assert (c >= 'A' && c <= 'F');
- return 10 + c - 'A';
-}
-
\f
/* Public character management functions. */
character. */
char host_letter_to_control_character (char c);
-/* Convert a hex digit character to its numeric value. E.g., 'f' is
- converted to 15. This function assumes that C is a valid hex
- digit. Both upper- and lower-case letters are recognized. */
-int host_hex_value (char c);
-
#endif /* CHARSET_H */
case '6':
case '7':
{
- int i = host_hex_value (c);
+ int i = fromhex (c);
int count = 0;
while (++count < 3)
{
(*string_ptr)++;
i *= 8;
- i += host_hex_value (c);
+ i += fromhex (c);
}
else
{
for (i = 0; i < build_id->size; ++i)
{
char c1 = string[i * 2], c2 = string[i * 2 + 1];
- int byte = (host_hex_value (c1) << 4) | host_hex_value (c2);
+ int byte = (fromhex (c1) << 4) | fromhex (c2);
if (byte != build_id->data[i])
return 0;
case '6':
case '7':
{
- int i = host_hex_value (c);
+ int i = fromhex (c);
int count = 0;
while (++count < 3)
{
{
(*string_ptr)++;
i *= 8;
- i += host_hex_value (c);
+ i += fromhex (c);
}
else
{