summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-03-19 14:56:45 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-03-19 14:56:45 (GMT)
commit16b3adf662893e6db67e82fb1df01063e1315548 (patch)
treebcfa89065ecea0a374bed505c235b77cba3db0a3 /generic/tclUtf.c
parent7bf9d79d60378e206b741af48b8cf6c55451557e (diff)
downloadtcl-16b3adf662893e6db67e82fb1df01063e1315548.zip
tcl-16b3adf662893e6db67e82fb1df01063e1315548.tar.gz
tcl-16b3adf662893e6db67e82fb1df01063e1315548.tar.bz2
Fix indentation/brace usage style issues
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 0babf4d..3dede09 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -234,8 +234,8 @@ Tcl_UniCharToUtf(
((ch & 0xF800) == 0xD800)) {
if (ch & 0x0400) {
/* Low surrogate */
- if ( (0x80 == (0xC0 & buf[0]))
- && (0 == (0xCF & buf[1]))) {
+ if ( (0x80 == (0xC0 & buf[0]))
+ && (0 == (0xCF & buf[1]))) {
/* Previous Tcl_UniChar was a high surrogate, so combine */
buf[2] = (char) (0x80 | (0x3F & ch));
buf[1] |= (char) (0x80 | (0x0F & (ch >> 6)));
@@ -246,12 +246,11 @@ Tcl_UniCharToUtf(
/* High surrogate */
/* Add 0x10000 to the raw number encoded in the surrogate
- * pair in order to get the code point.
- */
+ * pair in order to get the code point. */
ch += 0x40;
/* Fill buffer with specific 3-byte (invalid) byte combination,
- so following low surrogate can recognize it and combine */
+ * so following low surrogate can recognize it and combine */
buf[2] = (char) ((ch << 4) & 0x30);
buf[1] = (char) (0x80 | (0x3F & (ch >> 2)));
buf[0] = (char) (0xF0 | (0x07 & (ch >> 8)));
@@ -268,9 +267,9 @@ Tcl_UniCharToUtf(
return 4;
}
} else if (ch == -1) {
- if ( (0x80 == (0xC0 & buf[0]))
- && (0 == (0xCF & buf[1]))
- && (0xF0 == (0xF8 & buf[-1]))) {
+ if ( (0x80 == (0xC0 & buf[0]))
+ && (0 == (0xCF & buf[1]))
+ && (0xF0 == (0xF8 & buf[-1]))) {
ch = 0xD7C0
+ ((0x07 & buf[-1]) << 8)
+ ((0x3F & buf[0]) << 2)