diff options
author | David Robillard <d@drobilla.net> | 2021-05-30 12:23:07 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-14 19:37:51 -0500 |
commit | 89612ec05f596d135640413e093251fb9691ca14 (patch) | |
tree | 9c3e3d4491e6eb694aa0d429ba52ad80b0a5dc17 /src/string_utils.h | |
parent | cab9b5621b4db600376090f28fdc76c7ac6bd728 (diff) | |
download | serd-89612ec05f596d135640413e093251fb9691ca14.tar.gz serd-89612ec05f596d135640413e093251fb9691ca14.tar.bz2 serd-89612ec05f596d135640413e093251fb9691ca14.zip |
Add support for converting literals to canonical form
Diffstat (limited to 'src/string_utils.h')
-rw-r--r-- | src/string_utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/string_utils.h b/src/string_utils.h index 54f7877c..5cf7ba8c 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -60,7 +60,7 @@ is_xdigit(const int c) } static inline bool -is_space(const char c) +is_space(const int c) { switch (c) { case ' ': @@ -89,16 +89,16 @@ is_windows_path(const char* path) } static inline char -serd_to_upper(const char c) +serd_to_lower(const char c) { - return (char)((c >= 'a' && c <= 'z') ? c - 32 : c); + return (char)((c >= 'A' && c <= 'Z') ? c + 32 : c); } static inline int serd_strncasecmp(const char* s1, const char* s2, size_t n) { for (; n > 0 && *s2; s1++, s2++, --n) { - if (serd_to_upper(*s1) != serd_to_upper(*s2)) { + if (serd_to_lower(*s1) != serd_to_lower(*s2)) { return ((*(const uint8_t*)s1 < *(const uint8_t*)s2) ? -1 : +1); } } |