summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-04-27 20:34:22 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-04-27 20:34:22 (GMT)
commit7f433932f67e088cdf21d42138a2fd4c96620ef0 (patch)
tree2db163bbfb804c1ec96248b750928eda8c59ceee /generic
parent76130df46050131c3a1c4ec22d6adbfaa637f2a7 (diff)
downloadtcl-7f433932f67e088cdf21d42138a2fd4c96620ef0.zip
tcl-7f433932f67e088cdf21d42138a2fd4c96620ef0.tar.gz
tcl-7f433932f67e088cdf21d42138a2fd4c96620ef0.tar.bz2
memset(0xff) instead of memset(0) to accomodate tests that fill buffer with
0xff.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEncoding.c12
-rw-r--r--generic/tclStringObj.c2
-rw-r--r--generic/tclUtf.c4
3 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 851ae64..abce00b 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2538,7 +2538,7 @@ UtfToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
profile = CHANNEL_PROFILE_GET(flags);
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
@@ -2759,7 +2759,7 @@ Utf32ToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
/*
* Check alignment with utf-32 (4 == sizeof(UTF-32))
@@ -3035,7 +3035,7 @@ Utf16ToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
/*
* Check alignment with utf-16 (2 == sizeof(UTF-16))
@@ -3455,7 +3455,7 @@ TableToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
toUnicode = (const unsigned short *const *) dataPtr->toUnicode;
prefixBytes = dataPtr->prefixBytes;
@@ -3703,7 +3703,7 @@ Iso88591ToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
result = TCL_OK;
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
@@ -3949,7 +3949,7 @@ EscapeToUtfProc(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, dstLen);
+ memset(dst, 0xff, dstLen);
state = PTR2INT(*statePtr);
if (flags & TCL_ENCODING_START) {
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 3b1f0fb..6bc1c18 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -4502,7 +4502,7 @@ ExtendStringRepWithUnicode(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(dst, 0, stringPtr->allocated - origLength);
+ memset(dst, 0xff, stringPtr->allocated - origLength);
for (i = 0; i < numChars; i++) {
dst += Tcl_UniCharToUtf(unicode[i], dst);
}
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 42d2bea..54cef2f 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -354,7 +354,7 @@ Tcl_UniCharToUtfDString(
* Once TCL_UTF_MAX == 3 is removed and Tcl_UniCharToUtf restored to its
* prior non-stateful nature, this call to memset can also be removed.
*/
- memset(p, 0, Tcl_DStringLength(dsPtr) - oldLength);
+ memset(p, 0xff, Tcl_DStringLength(dsPtr) - oldLength);
for (w = uniStr; w < wEnd; ) {
p += Tcl_UniCharToUtf(*w, p);
@@ -405,7 +405,7 @@ Tcl_Char16ToUtfDString(
* Because TCL_COMBINE is used here, memset() is required even when
* TCL_UTF_MAX == 4.
*/
- memset(p, 0, Tcl_DStringLength(dsPtr) - oldLength);
+ memset(p, 0xff, Tcl_DStringLength(dsPtr) - oldLength);
for (w = uniStr; w < wEnd; ) {
if (!len && ((*w & 0xFC00) != 0xDC00)) {