mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 09:44:24 +03:00
ASCII: Split out A-F test.
This commit is contained in:
parent
04d74a79ae
commit
3ec522429a
@ -122,6 +122,17 @@ static inline bool ascii_is_hex_lower(char c)
|
|||||||
(c >= 'a' && c <= 'f'));
|
(c >= 'a' && c <= 'f'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test whether a character is 'A' to 'F' (uppercase).
|
||||||
|
*
|
||||||
|
* \param[in] c Character to test.
|
||||||
|
* \return true iff `c` is 'A' to 'F' (uppercase), else false.
|
||||||
|
*/
|
||||||
|
static inline bool ascii_is_af_upper(char c)
|
||||||
|
{
|
||||||
|
return (c >= 'A' && c <= 'F');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether a character is hexadecimal (upper case).
|
* Test whether a character is hexadecimal (upper case).
|
||||||
*
|
*
|
||||||
@ -130,8 +141,7 @@ static inline bool ascii_is_hex_lower(char c)
|
|||||||
*/
|
*/
|
||||||
static inline bool ascii_is_hex_upper(char c)
|
static inline bool ascii_is_hex_upper(char c)
|
||||||
{
|
{
|
||||||
return (ascii_is_digit(c) ||
|
return (ascii_is_digit(c) || ascii_is_af_upper(c));
|
||||||
(c >= 'A' && c <= 'F'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -143,7 +153,7 @@ static inline bool ascii_is_hex_upper(char c)
|
|||||||
static inline bool ascii_is_hex(char c)
|
static inline bool ascii_is_hex(char c)
|
||||||
{
|
{
|
||||||
return (ascii_is_digit(c) ||
|
return (ascii_is_digit(c) ||
|
||||||
(c >= 'A' && c <= 'F') ||
|
ascii_is_af_upper(c) ||
|
||||||
(c >= 'a' && c <= 'f'));
|
(c >= 'a' && c <= 'f'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user