From 6fec8f2b6ceb11f6c1cfe52126e45005b4376d98 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 22 Mar 2023 18:13:29 +0000 Subject: Let's get in the 'readability' changes from the 'unchained' branch, without the need for all those partial merges. --- generic/tclUtf.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 1a6ab68..b153dc9 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -182,8 +182,8 @@ Invalid( * * Tcl_UniCharToUtf -- * - * Stores the given Tcl_UniChar as a sequence of UTF-8 bytes in the - * provided buffer. Equivalent to Plan 9 runetochar(). + * Stores the given Tcl_UniChar as a sequence of UTF-8 bytes in the provided + * buffer. Equivalent to Plan 9 runetochar(). * * Surrogate pairs are handled as follows: When ch is a high surrogate, * the first byte of the 4-byte UTF-8 sequence is stored in the buffer and @@ -191,10 +191,9 @@ Invalid( * surrogate and the same buffer, the remaining 3 bytes of the 4-byte * UTF-8 sequence are produced. * - * If no low surrogate follows the high surrogate (which is actually - * illegal), this can be handled reasonably by calling Tcl_UniCharToUtf - * again with ch = -1. This produces a 3-byte UTF-8 sequence - * representing the high surrogate. + * If no low surrogate follows the high surrogate (which is actually illegal), + * calling Tcl_UniCharToUtf again with ch = -1 produces a 3-byte UTF-8 + * sequence representing the high surrogate. * * Results: * Returns the number of bytes stored into the buffer. @@ -208,12 +207,11 @@ Invalid( #undef Tcl_UniCharToUtf size_t Tcl_UniCharToUtf( - int ch, /* The Tcl_UniChar to be stored in the + int ch, /* The Tcl_UniChar to be stored in the * buffer. Can be or'ed with flag TCL_COMBINE */ - char *buf) /* Buffer in which the UTF-8 representation of - * the Tcl_UniChar is stored. Buffer must be - * large enough to hold the UTF-8 character - * (at most 4 bytes). */ + char *buf) /* Buffer in which the UTF-8 representation of + * the ch is stored. Must be large enough to hold the UTF-8 + * character (at most 4 bytes). */ { #if TCL_UTF_MAX > 3 int flags = ch; -- cgit v0.12