summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-02-24 08:25:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-02-24 08:25:27 (GMT)
commit1c3c25097b1f63d6b1a0446c2c441833c4ecec11 (patch)
treeb31d83c6f1b53c0dc8d916171e315e8263905870 /generic/tclEncoding.c
parent956059093c78b2194ab303a729a15f0041dc8b2c (diff)
downloadtcl-1c3c25097b1f63d6b1a0446c2c441833c4ecec11.zip
tcl-1c3c25097b1f63d6b1a0446c2c441833c4ecec11.tar.gz
tcl-1c3c25097b1f63d6b1a0446c2c441833c4ecec11.tar.bz2
int -> Tcl_Size in tclEncoding.c (making the diff between Tcl 8.7 and 9.0 smaller)
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 8e13b43..f32baac 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -36,7 +36,7 @@ typedef struct {
* encoding is deleted. */
void *clientData; /* Arbitrary value associated with encoding
* type. Passed to conversion functions. */
- int nullSize; /* Number of 0x00 bytes that signify
+ Tcl_Size nullSize; /* Number of 0x00 bytes that signify
* end-of-string in this encoding. This number
* is used to determine the source string
* length when the srcLen argument is
@@ -374,7 +374,7 @@ int
Tcl_SetEncodingSearchPath(
Tcl_Obj *searchPath)
{
- int dummy;
+ Tcl_Size dummy;
if (TCL_ERROR == TclListObjLengthM(NULL, searchPath, &dummy)) {
return TCL_ERROR;
@@ -421,7 +421,7 @@ void
TclSetLibraryPath(
Tcl_Obj *path)
{
- int dummy;
+ Tcl_Size dummy;
if (TCL_ERROR == TclListObjLengthM(NULL, path, &dummy)) {
return;
@@ -457,7 +457,7 @@ TclSetLibraryPath(
static void
FillEncodingFileMap(void)
{
- int i, numDirs = 0;
+ Tcl_Size i, numDirs = 0;
Tcl_Obj *map, *searchPath;
searchPath = Tcl_GetEncodingSearchPath();
@@ -472,7 +472,7 @@ FillEncodingFileMap(void)
* entries found, we favor files earlier on the search path.
*/
- int j, numFiles;
+ Tcl_Size j, numFiles;
Tcl_Obj *directory, *matchFileList;
Tcl_Obj **filev;
Tcl_GlobTypeData readableFiles = {
@@ -1005,7 +1005,7 @@ Tcl_GetEncodingNames(
*
*---------------------------------------------------------------------------
*/
-int
+Tcl_Size
Tcl_GetEncodingNulLength(
Tcl_Encoding encoding)
{
@@ -1171,7 +1171,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. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* encoding-specific string length. */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
@@ -1210,12 +1210,12 @@ Tcl_ExternalToUtfDString(
*-------------------------------------------------------------------------
*/
-int
+Tcl_Size
Tcl_ExternalToUtfDStringEx(
Tcl_Encoding encoding, /* The encoding for the source string, or NULL
* for the default system encoding. */
const char *src, /* Source string in specified encoding. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* encoding-specific string length. */
int flags, /* Conversion control flags. */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
@@ -1224,7 +1224,8 @@ Tcl_ExternalToUtfDStringEx(
char *dst;
Tcl_EncodingState state;
const Encoding *encodingPtr;
- int dstLen, result, soFar, srcRead, dstWrote, dstChars;
+ int result, soFar, srcRead, dstWrote, dstChars;
+ Tcl_Size dstLen;
const char *srcStart = src;
Tcl_DStringInit(dstPtr);
@@ -1255,7 +1256,7 @@ Tcl_ExternalToUtfDStringEx(
src += srcRead;
if (result != TCL_CONVERT_NOSPACE) {
Tcl_DStringSetLength(dstPtr, soFar);
- return (result == TCL_OK) ? TCL_INDEX_NONE : (int)(src - srcStart);
+ return (result == TCL_OK) ? TCL_INDEX_NONE : (Tcl_Size)(src - srcStart);
}
flags &= ~TCL_ENCODING_START;
srcLen -= srcRead;
@@ -1292,7 +1293,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. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* encoding-specific string length. */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
@@ -1302,7 +1303,7 @@ Tcl_ExternalToUtf(
* routine under control of flags argument. */
char *dst, /* Output buffer in which converted string is
* stored. */
- int dstLen, /* The maximum length of output buffer in
+ Tcl_Size dstLen, /* The maximum length of output buffer in
* bytes. */
int *srcReadPtr, /* Filled with the number of bytes from the
* source string that were converted. This may
@@ -1409,7 +1410,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. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* strlen(). */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
@@ -1449,12 +1450,12 @@ Tcl_UtfToExternalDString(
*-------------------------------------------------------------------------
*/
-int
+Tcl_Size
Tcl_UtfToExternalDStringEx(
Tcl_Encoding encoding, /* The encoding for the converted string, or
* NULL for the default system encoding. */
const char *src, /* Source string in UTF-8. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* strlen(). */
int flags, /* Conversion control flags. */
Tcl_DString *dstPtr) /* Uninitialized or free DString in which the
@@ -1465,7 +1466,7 @@ Tcl_UtfToExternalDStringEx(
const Encoding *encodingPtr;
int result, soFar, srcRead, dstWrote, dstChars;
const char *srcStart = src;
- int dstLen;
+ Tcl_Size dstLen;
Tcl_DStringInit(dstPtr);
dst = Tcl_DStringValue(dstPtr);
@@ -1494,7 +1495,7 @@ Tcl_UtfToExternalDStringEx(
while (i >= soFar) {
Tcl_DStringSetLength(dstPtr, i--);
}
- return (result == TCL_OK) ? TCL_INDEX_NONE : (int)(src - srcStart);
+ return (result == TCL_OK) ? TCL_INDEX_NONE : (Tcl_Size)(src - srcStart);
}
flags &= ~TCL_ENCODING_START;
@@ -1532,7 +1533,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. */
- int srcLen, /* Source string length in bytes, or < 0 for
+ Tcl_Size srcLen, /* Source string length in bytes, or < 0 for
* strlen(). */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
@@ -1542,7 +1543,7 @@ Tcl_UtfToExternal(
* routine under control of flags argument. */
char *dst, /* Output buffer in which converted string
* is stored. */
- int dstLen, /* The maximum length of output buffer in
+ Tcl_Size dstLen, /* The maximum length of output buffer in
* bytes. */
int *srcReadPtr, /* Filled with the number of bytes from the
* source string that were converted. This may
@@ -1653,7 +1654,7 @@ OpenEncodingFileChannel(
Tcl_Obj *map = TclGetProcessGlobalValue(&encodingFileMap);
Tcl_Obj **dir, *path, *directory = NULL;
Tcl_Channel chan = NULL;
- int i, numDirs;
+ Tcl_Size i, numDirs;
TclListObjGetElementsM(NULL, searchPath, &numDirs, &dir);
Tcl_IncrRefCount(nameObj);
@@ -1918,7 +1919,7 @@ LoadTableEncoding(
for (i = 0; i < numPages; i++) {
int ch;
const char *p;
- int expected = 3 + 16 * (16 * 4 + 1);
+ Tcl_Size expected = 3 + 16 * (16 * 4 + 1);
if (Tcl_ReadChars(chan, objPtr, expected, 0) != expected) {
return NULL;
@@ -2154,7 +2155,7 @@ LoadEscapeEncoding(
Tcl_DStringInit(&escapeData);
while (1) {
- int argc;
+ Tcl_Size argc;
const char **argv;
char *line;
Tcl_DString lineString;
@@ -3919,8 +3920,7 @@ EscapeFromUtfProc(
result = TCL_CONVERT_NOSPACE;
break;
}
- memcpy(dst, subTablePtr->sequence,
- subTablePtr->sequenceLen);
+ memcpy(dst, subTablePtr->sequence, subTablePtr->sequenceLen);
dst += subTablePtr->sequenceLen;
}
}
@@ -4138,11 +4138,11 @@ unilen4(
static void
InitializeEncodingSearchPath(
char **valuePtr,
- unsigned int *lengthPtr,
+ TCL_HASH_TYPE *lengthPtr,
Tcl_Encoding *encodingPtr)
{
const char *bytes;
- int i, numDirs, numBytes;
+ Tcl_Size i, numDirs, numBytes;
Tcl_Obj *libPathObj, *encodingObj, *searchPathObj;
TclNewLiteralStringObj(encodingObj, "encoding");