From c701c58a43d7f5446b5594b73664a7f6d9812e27 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 24 Mar 2025 21:21:25 -0400 Subject: Use in_range() where appropriate --- src/string_utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/string_utils.h b/src/string_utils.h index 6a098991..f4b27bcc 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -51,13 +51,13 @@ is_xdigit(const int c) static inline bool is_space(const char c) { - return c == ' ' || (c >= '\t' && c <= '\r'); + return c == ' ' || in_range(c, '\t', '\r'); } static inline bool is_print(const int c) { - return c >= 0x20 && c <= 0x7E; + return in_range(c, 0x20, 0x7E); } static inline bool @@ -88,7 +88,7 @@ hex_digit_value(const uint8_t c) static inline char serd_to_upper(const char c) { - return (char)((c >= 'a' && c <= 'z') ? c - 32 : c); + return (char)(in_range(c, 'a', 'z') ? (c - 32) : c); } SERD_PURE_FUNC static inline int -- cgit v1.2.1