summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 19:20:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-10-06 19:20:43 (GMT)
commit99e9ce3656f195c60ba4e928559c05d47167901c (patch)
tree64fba30ebef34869f49fcdf5b36b3b41164698db /generic/tclEncoding.c
parentd84d03b91a4eb72f88b56011713706a6f36bc17c (diff)
downloadtcl-99e9ce3656f195c60ba4e928559c05d47167901c.zip
tcl-99e9ce3656f195c60ba4e928559c05d47167901c.tar.gz
tcl-99e9ce3656f195c60ba4e928559c05d47167901c.tar.bz2
Use more TCL_AUTO_LENGTH, when appropriate
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index bbc1b20..06041f1 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -1048,7 +1048,7 @@ Tcl_ExternalToUtfDString(
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
* for the default system encoding. */
const char *src, /* Source string in specified encoding. */
- size_t srcLen, /* Source string length in bytes, or (size_t)-1 for
+ size_t srcLen, /* Source string length in bytes, or -1 for
* encoding-specific string length. */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
@@ -1070,7 +1070,7 @@ Tcl_ExternalToUtfDString(
if (src == NULL) {
srcLen = 0;
- } else if (srcLen == (size_t)-1) {
+ } else if (srcLen == TCL_AUTO_LENGTH) {
srcLen = encodingPtr->lengthProc(src);
}
@@ -1122,7 +1122,7 @@ Tcl_ExternalToUtf(
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
* for the default system encoding. */
const char *src, /* Source string in specified encoding. */
- size_t srcLen, /* Source string length in bytes, or (size_t)-1
+ size_t srcLen, /* Source string length in bytes, or -1
* for encoding-specific string length. */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
@@ -1160,7 +1160,7 @@ Tcl_ExternalToUtf(
if (src == NULL) {
srcLen = 0;
- } else if (srcLen == (size_t)-1) {
+ } else if (srcLen == TCL_AUTO_LENGTH) {
srcLen = encodingPtr->lengthProc(src);
}
if (statePtr == NULL) {
@@ -1239,7 +1239,7 @@ Tcl_UtfToExternalDString(
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
- size_t srcLen, /* Source string length in bytes, or (size_t)-1 for
+ size_t srcLen, /* Source string length in bytes, or -1 for
* strlen(). */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
@@ -1261,7 +1261,7 @@ Tcl_UtfToExternalDString(
if (src == NULL) {
srcLen = 0;
- } else if (srcLen == (size_t)-1) {
+ } else if (srcLen == TCL_AUTO_LENGTH) {
srcLen = strlen(src);
}
flags = TCL_ENCODING_START | TCL_ENCODING_END;
@@ -1315,7 +1315,7 @@ Tcl_UtfToExternal(
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
- size_t srcLen, /* Source string length in bytes, or (size_t)-1
+ size_t srcLen, /* Source string length in bytes, or -1
* for strlen(). */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
@@ -1350,7 +1350,7 @@ Tcl_UtfToExternal(
if (src == NULL) {
srcLen = 0;
- } else if (srcLen == (size_t)-1) {
+ } else if (srcLen == TCL_AUTO_LENGTH) {
srcLen = strlen(src);
}
if (statePtr == NULL) {
@@ -1940,7 +1940,7 @@ LoadEscapeEncoding(
Tcl_DString lineString;
Tcl_DStringInit(&lineString);
- if (Tcl_Gets(chan, &lineString) == (size_t)-1) {
+ if (Tcl_Gets(chan, &lineString) == TCL_IO_FAILURE) {
break;
}
line = Tcl_DStringValue(&lineString);