summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-14 18:31:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-14 18:31:24 (GMT)
commit14994d8a856c6e59890aad6023793a6760c98e1a (patch)
tree1c5559c8ce5c44ad2f0275b5c0bc56d0c65cbab8 /win/tclWin32Dll.c
parent5e1789954df3a512ab8d71df2c60ffb6ea72b777 (diff)
parent919ec44584344d71c8ddad8d14d58adfdec28e8b (diff)
downloadtcl-14994d8a856c6e59890aad6023793a6760c98e1a.zip
tcl-14994d8a856c6e59890aad6023793a6760c98e1a.tar.gz
tcl-14994d8a856c6e59890aad6023793a6760c98e1a.tar.bz2
Merge trunk. Some more size_t additions in parameters/fields
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 599c126..24ae687 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -466,8 +466,8 @@ TclWinDriveLetterForVolMountPoint(
TCHAR *
Tcl_WinUtfToTChar(
const char *string, /* Source string in UTF-8. */
- int len, /* Source string length in bytes, or -1 for
- * strlen(). */
+ size_t len, /* Source string length in bytes, or (size_t)-1
+ * for strlen(). */
Tcl_DString *dsPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
{
@@ -478,7 +478,7 @@ Tcl_WinUtfToTChar(
Tcl_DStringSetLength(dsPtr, 2*size+2);
wp = (TCHAR *)Tcl_DStringValue(dsPtr);
MultiByteToWideChar(CP_UTF8, 0, string, len, wp, size+1);
- if (len == -1) --size; /* account for 0-byte at string end */
+ if (len == (size_t)-1) --size; /* account for 0-byte at string end */
Tcl_DStringSetLength(dsPtr, 2*size);
wp[size] = 0;
return wp;
@@ -487,15 +487,15 @@ Tcl_WinUtfToTChar(
char *
Tcl_WinTCharToUtf(
const TCHAR *string, /* Source string in Unicode. */
- int len, /* Source string length in bytes, or -1 for
- * platform-specific string length. */
+ size_t len, /* Source string length in bytes, or (size_t)-1
+ * for platform-specific string length. */
Tcl_DString *dsPtr) /* Uninitialized or free DString in which the
* converted string is stored. */
{
char *p;
int size;
- if (len > 0) {
+ if (len != (size_t)-1) {
len /= 2;
}
size = WideCharToMultiByte(CP_UTF8, 0, string, len, 0, 0, NULL, NULL);
@@ -503,7 +503,7 @@ Tcl_WinTCharToUtf(
Tcl_DStringSetLength(dsPtr, size+1);
p = (char *)Tcl_DStringValue(dsPtr);
WideCharToMultiByte(CP_UTF8, 0, string, len, p, size, NULL, NULL);
- if (len == -1) --size; /* account for 0-byte at string end */
+ if (len == (size_t)-1) --size; /* account for 0-byte at string end */
Tcl_DStringSetLength(dsPtr, size);
p[size] = 0;
return p;