summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-22 18:13:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-22 18:13:29 (GMT)
commit6fec8f2b6ceb11f6c1cfe52126e45005b4376d98 (patch)
treeef35e5a1ab6cd6e2bc675f6e3c313823fc72b1b5
parent1451fc75379ac268ba27e88795a1ae76b64baf3f (diff)
downloadtcl-6fec8f2b6ceb11f6c1cfe52126e45005b4376d98.zip
tcl-6fec8f2b6ceb11f6c1cfe52126e45005b4376d98.tar.gz
tcl-6fec8f2b6ceb11f6c1cfe52126e45005b4376d98.tar.bz2
Let's get in the 'readability' changes from the 'unchained' branch, without the need for all those partial merges.
-rw-r--r--generic/tclUtf.c20
1 files 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;