From f4382b2415fcaf982e6a4732db8168cef133c0e3 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 25 Sep 2024 09:33:14 +0000 Subject: [PATCH] Improvements to comments on data structures and subroutines. FossilOrigin-Name: b217e3004b58af0e777726bdd652b999ad41815261299ef4ce8f8d2f6b0afe8d --- manifest | 13 +++++++------ manifest.uuid | 2 +- src/shell.c.in | 15 +++++++++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index 5a7ccac4ee..12999b09d5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C In\sthe\sCLI,\swhen\sdisplaying\sresults\sin\sa\scolumnar\sformat,\stake\sinto\saccount\nzero-width\sand\sdouble-width\sUnicode\scharacters. -D 2024-09-24T00:01:47.656 +C Improvements\sto\scomments\son\sdata\sstructures\sand\ssubroutines. +D 2024-09-25T09:33:14.835 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -768,7 +768,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c b2cd748488012312824508639b6af908461e45403037d5c4e19d9b0e8195507f F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe -F src/shell.c.in 732f0fba9d956854e540f8f86deba6b65710f2f24aa0aa5381fb365f28c2ca1b +F src/shell.c.in 9b68a945f3aafc78eac1a256a4a588a9310dbc61a0cd60378c5b7a78f789af50 F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -2213,8 +2213,9 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9a1fc8d36b5b262f9d17a4743b4b9bb54510cf257d2d9778ebc42d5224856b1e -R 988b7d0f85db9a0b2a0485e0d9883734 +P 47cfad71eddc6fc4414ff853ee172da72527620eee743721806072c6e0a80caa +R 711914e97aae1631ec1aaf0c7dbc2c36 +T +closed 47cfad71eddc6fc4414ff853ee172da72527620eee743721806072c6e0a80caa U drh -Z fd42c54152b4ee78f4ca90da8d2b64c2 +Z 9e5bc0454c6f58b185adbeed59d6a33c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2557008e97..a769bd751d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -47cfad71eddc6fc4414ff853ee172da72527620eee743721806072c6e0a80caa +b217e3004b58af0e777726bdd652b999ad41815261299ef4ce8f8d2f6b0afe8d diff --git a/src/shell.c.in b/src/shell.c.in index 8185e4c4ce..f40fdaecbc 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -670,7 +670,7 @@ static void SQLITE_CDECL iotracePrintf(const char *zFormat, ...){ } #endif -/* Lookup table to determine the number of columns consumed by a Unicode +/* Lookup table to estimate the number of columns consumed by a Unicode ** character. */ static const struct { @@ -742,9 +742,14 @@ static const struct { }; /* -** Return the width, in columns, of the single Unicode character c. -** For normal characters, the answer is always 1. But it might be 0 or 2 -** for zero-width and double-width characters. +** Return an estimate of the width, in columns, for the single Unicode +** character c. For normal characters, the answer is always 1. But the +** estimate might be 0 or 2 for zero-width and double-width characters. +** +** Different display devices display unicode using different widths. So +** it is impossible to know that true display width with 100% accuracy. +** Inaccuracies in the width estimates might cause columns to be misaligned. +** Unfortunately, there is nothing we can do about that. */ int cli_wcwidth(int c){ int iFirst, iLast; @@ -776,6 +781,8 @@ int cli_wcwidth(int c){ /* ** Compute the value and length of a multi-byte UTF-8 character that ** begins at z[0]. Return the length. Write the Unicode value into *pU. +** +** This routine only works for *multi-byte* UTF-8 characters. */ static int decodeUtf8(const unsigned char *z, int *pU){ if( (z[0] & 0xe0)==0xc0 && (z[1] & 0xc0)==0x80 ){ -- 2.39.5