diff options
Diffstat (limited to 'libcharconv_fraktur.c')
| -rw-r--r-- | libcharconv_fraktur.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/libcharconv_fraktur.c b/libcharconv_fraktur.c index e04d6ab..713e9a6 100644 --- a/libcharconv_fraktur.c +++ b/libcharconv_fraktur.c @@ -7,31 +7,14 @@ libcharconv_fraktur(const char *s, size_t slen, size_t *n, uint_least32_t *cp, s { uint_least32_t c; *n = 0; - for (; slen--; s++) { - if (*s == 'C') { - c = (uint_least32_t)UINT32_C(0x212D); - goto conv; - } else if (*s == 'H') { - c = (uint_least32_t)UINT32_C(0x210C); - goto conv; - } else if (*s == 'I') { - c = (uint_least32_t)UINT32_C(0x2111); - goto conv; - } else if (*s == 'R') { - c = (uint_least32_t)UINT32_C(0x211C); - goto conv; - } else if (*s == 'Z') { - c = (uint_least32_t)UINT32_C(0x2128); - goto conv; - } else if ('A' <= *s && *s <= 'Z') { - c = (uint_least32_t)(UINT32_C(0x1D504) + (unsigned)(*s - 'A')); - goto conv; - } else if ('a' <= *s && *s <= 'z') { - c = (uint_least32_t)(UINT32_C(0x1D51E) + (unsigned)(*s - 'a')); - goto conv; - } else { - *n += 1u; - } + for (; slen--; s++, ++*n) { + PLAIN_SINGLE('C', 0x212D); + PLAIN_SINGLE('H', 0x210C); + PLAIN_SINGLE('I', 0x2111); + PLAIN_SINGLE('R', 0x211C); + PLAIN_SINGLE('Z', 0x2128); + PLAIN_RANGE('A', 'Z', 0x1D504); + PLAIN_RANGE('a', 'z', 0X1D51E); } no_conv: return LIBCHARCONV_NO_CONVERT; |
