aboutsummaryrefslogtreecommitdiff
path: root/lib/mbstring
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-04 23:28:20 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-06-04 23:28:20 +0200
commitbd5a2308f2873c6b28527d5cebd2d2d160ebf9ba (patch)
tree06e7cd4eff506eb14084d4fac9062100e13adf6a /lib/mbstring
parentf7c38329d5737b2850021b67cb39447ad15b4439 (diff)
Formatting
Diffstat (limited to 'lib/mbstring')
-rw-r--r--lib/mbstring/u8chk.c2
-rw-r--r--lib/mbstring/u8prev.c5
-rw-r--r--lib/mbstring/u8tor.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/mbstring/u8chk.c b/lib/mbstring/u8chk.c
index 20c4f3f..bf93005 100644
--- a/lib/mbstring/u8chk.c
+++ b/lib/mbstring/u8chk.c
@@ -1,5 +1,5 @@
-#include "rune.h"
#include "mbstring.h"
+#include "rune.h"
const char8_t *
u8chk(struct u8view sv)
diff --git a/lib/mbstring/u8prev.c b/lib/mbstring/u8prev.c
index ff580c2..2f8213e 100644
--- a/lib/mbstring/u8prev.c
+++ b/lib/mbstring/u8prev.c
@@ -23,11 +23,12 @@ u8prev(rune *ch, const char8_t **p, const char8_t *start)
} else if (d > 2 && u8bytec(s[-1]) && u8bytec(s[-2]) && u8byte3(s[-3])) {
if (ch) {
*ch = ((s[-3] & 0x0F) << 12) | ((s[-2] & 0x3F) << 6)
- | (s[-1] & 0x3F);
+ | (s[-1] & 0x3F);
}
off = 3;
} else if (d > 3 && u8bytec(s[-1]) && u8bytec(s[-2]) && u8bytec(s[-3])
- && u8byte4(s[-4])) {
+ && u8byte4(s[-4]))
+ {
if (ch) {
*ch = ((s[-4] & 0x07) << 18) | ((s[-3] & 0x3F) << 12)
| ((s[-2] & 0x3F) << 6) | (s[-1] & 0x3F);
diff --git a/lib/mbstring/u8tor.c b/lib/mbstring/u8tor.c
index eb54689..fddc97c 100644
--- a/lib/mbstring/u8tor.c
+++ b/lib/mbstring/u8tor.c
@@ -13,8 +13,8 @@ u8tor(rune *ch, const char8_t *s)
} else if (u8byte3(s[0]) && u8bytec(s[1]) && u8bytec(s[2])) {
*ch = ((s[0] & 0x0F) << 12) | ((s[1] & 0x3F) << 6) | (s[2] & 0x3F);
return 3;
- } else if (u8byte4(s[0]) && u8bytec(s[1]) && u8bytec(s[2])
- && u8bytec(s[3])) {
+ } else if (u8byte4(s[0]) && u8bytec(s[1]) && u8bytec(s[2]) && u8bytec(s[3]))
+ {
*ch = ((s[0] & 0x07) << 18) | ((s[1] & 0x3F) << 12)
| ((s[2] & 0x3F) << 6) | (s[3] & 0x3F);
return 4;