diff options
| author | Mattias Andrée <m@maandree.se> | 2026-01-28 22:03:48 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-01-28 22:03:48 +0100 |
| commit | 40bf70fb8f23e5ff7212b568c69e0725372e5b57 (patch) | |
| tree | 0d4be706d0182ddeafd4eaafd073e12c2fa2a9e8 /libcharconv_sans_serif.c | |
| parent | Misc stuff (diff) | |
| download | charconv-40bf70fb8f23e5ff7212b568c69e0725372e5b57.tar.gz charconv-40bf70fb8f23e5ff7212b568c69e0725372e5b57.tar.bz2 charconv-40bf70fb8f23e5ff7212b568c69e0725372e5b57.tar.xz | |
Clean up
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcharconv_sans_serif.c')
| -rw-r--r-- | libcharconv_sans_serif.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/libcharconv_sans_serif.c b/libcharconv_sans_serif.c index 787d14b..4edf373 100644 --- a/libcharconv_sans_serif.c +++ b/libcharconv_sans_serif.c @@ -10,16 +10,10 @@ libcharconv_sans_serif(const char *s, size_t slen, size_t *n, uint_least32_t *cp *n = 0; for (; slen--; s++) { old_slen = slen; - if ('A' <= *s && *s <= 'Z') { - c = (uint_least32_t)(UINT32_C(0x1D5A0) + (unsigned)(*s - 'A')); - goto conv; - } else if ('a' <= *s && *s <= 'z') { - c = (uint_least32_t)(UINT32_C(0x1D5BA) + (unsigned)(*s - 'a')); - goto conv; - } else if ('0' <= *s && *s <= '9') { - c = (uint_least32_t)(UINT32_C(0x1D7E2) + (unsigned)(*s - '0')); - goto conv; - } else if ((unsigned char)s[0] == 0xE2u) { + PLAIN_RANGE('A', 'Z', 0x1D5A0); + PLAIN_RANGE('a', 'z', 0x1D5BA); + PLAIN_RANGE('0', '9', 0x1D7E2); + if ((unsigned char)s[0] == 0xE2u) { if (!slen--) goto indeterminate; if ((unsigned char)s[1] == 0x93u) { |
