aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_shogi.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_shogi.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_shogi.c')
-rw-r--r--libcharconv_shogi.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libcharconv_shogi.c b/libcharconv_shogi.c
index d12f158..66604c5 100644
--- a/libcharconv_shogi.c
+++ b/libcharconv_shogi.c
@@ -7,16 +7,11 @@ libcharconv_shogi(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz
{
uint_least32_t c;
*n = 0;
- for (; slen--; s++) {
- switch (*s) {
- case 'w': c = UINT32_C(0x2616); goto conv;
- case 'b': c = UINT32_C(0x2617); goto conv;
- case 'W': c = UINT32_C(0x26C9); goto conv;
- case 'B': c = UINT32_C(0x26CA); goto conv;
- default:
- *n += 1u;
- break;
- }
+ for (; slen--; s++, ++*n) {
+ PLAIN_SINGLE('w', 0x2616);
+ PLAIN_SINGLE('b', 0x2617);
+ PLAIN_SINGLE('W', 0x2619);
+ PLAIN_SINGLE('B', 0x261A);
}
no_conv:
return LIBCHARCONV_NO_CONVERT;