aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_fraktur.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-28 22:03:48 +0100
committerMattias Andrée <m@maandree.se>2026-01-28 22:03:48 +0100
commit40bf70fb8f23e5ff7212b568c69e0725372e5b57 (patch)
tree0d4be706d0182ddeafd4eaafd073e12c2fa2a9e8 /libcharconv_fraktur.c
parentMisc stuff (diff)
downloadcharconv-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_fraktur.c')
-rw-r--r--libcharconv_fraktur.c33
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;