summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/tclWin32Dll.c2
-rw-r--r--win/tclWinInit.c17
-rw-r--r--win/tclWinPort.h2
-rw-r--r--win/tclWinSock.c6
-rw-r--r--win/tclWinThrd.c2
5 files changed, 15 insertions, 14 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index d8a8717..e4adb1d 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -49,7 +49,7 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
*/
typedef struct MountPointMap {
- const TCHAR *volumeName; /* Native wide string volume name. */
+ TCHAR *volumeName; /* Native wide string volume name. */
TCHAR driveLetter; /* Drive letter corresponding to the volume
* name. */
struct MountPointMap *nextPtr;
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index b5a07aa..d2ee7e1 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -172,7 +172,7 @@ TclpInitPlatform(void)
void
TclpInitLibraryPath(
char **valuePtr,
- int *lengthPtr,
+ size_t *lengthPtr,
Tcl_Encoding *encodingPtr)
{
#define LIBRARY_SIZE 64
@@ -214,9 +214,10 @@ TclpInitLibraryPath(
TclGetProcessGlobalValue(&sourceLibraryDir));
*encodingPtr = NULL;
- bytes = TclGetStringFromObj(pathPtr, lengthPtr);
- *valuePtr = ckalloc((*lengthPtr) + 1);
- memcpy(*valuePtr, bytes, (size_t)(*lengthPtr)+1);
+ bytes = TclGetString(pathPtr);
+ *lengthPtr = pathPtr->length;
+ *valuePtr = ckalloc(*lengthPtr + 1);
+ memcpy(*valuePtr, bytes, *lengthPtr + 1);
Tcl_DecrRefCount(pathPtr);
}
@@ -334,7 +335,7 @@ AppendEnvironment(
static void
InitializeDefaultLibraryDir(
char **valuePtr,
- int *lengthPtr,
+ size_t *lengthPtr,
Tcl_Encoding *encodingPtr)
{
HMODULE hModule = TclWinGetTclInstance();
@@ -361,7 +362,7 @@ InitializeDefaultLibraryDir(
*lengthPtr = strlen(name);
*valuePtr = ckalloc(*lengthPtr + 1);
*encodingPtr = NULL;
- memcpy(*valuePtr, name, (size_t) *lengthPtr + 1);
+ memcpy(*valuePtr, name, *lengthPtr + 1);
}
/*
@@ -385,7 +386,7 @@ InitializeDefaultLibraryDir(
static void
InitializeSourceLibraryDir(
char **valuePtr,
- int *lengthPtr,
+ size_t *lengthPtr,
Tcl_Encoding *encodingPtr)
{
HMODULE hModule = TclWinGetTclInstance();
@@ -412,7 +413,7 @@ InitializeSourceLibraryDir(
*lengthPtr = strlen(name);
*valuePtr = ckalloc(*lengthPtr + 1);
*encodingPtr = NULL;
- memcpy(*valuePtr, name, (size_t) *lengthPtr + 1);
+ memcpy(*valuePtr, name, *lengthPtr + 1);
}
/*
diff --git a/win/tclWinPort.h b/win/tclWinPort.h
index 159a708..41201c7 100644
--- a/win/tclWinPort.h
+++ b/win/tclWinPort.h
@@ -551,7 +551,7 @@ typedef DWORD_PTR * PDWORD_PTR;
* address platform-specific issues.
*/
-#define TclpReleaseFile(file) ckfree((char *) file)
+#define TclpReleaseFile(file) ckfree(file)
/*
* The following macros and declarations wrap the C runtime library
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 4690708..ec881d2 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -331,7 +331,7 @@ void printaddrinfolist(struct addrinfo *addrlist, char *prefix)
void
InitializeHostName(
char **valuePtr,
- int *lengthPtr,
+ size_t *lengthPtr,
Tcl_Encoding *encodingPtr)
{
TCHAR tbuf[MAX_COMPUTERNAME_LENGTH + 1];
@@ -368,8 +368,8 @@ InitializeHostName(
*encodingPtr = Tcl_GetEncoding(NULL, "utf-8");
*lengthPtr = Tcl_DStringLength(&ds);
- *valuePtr = ckalloc((*lengthPtr) + 1);
- memcpy(*valuePtr, Tcl_DStringValue(&ds), (size_t)(*lengthPtr)+1);
+ *valuePtr = ckalloc(*lengthPtr + 1);
+ memcpy(*valuePtr, Tcl_DStringValue(&ds), *lengthPtr + 1);
Tcl_DStringFree(&ds);
}
diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c
index e46b0a0..b9cde72 100644
--- a/win/tclWinThrd.c
+++ b/win/tclWinThrd.c
@@ -180,7 +180,7 @@ TclWinThreadStart(
lpOrigStartAddress = winThreadPtr->lpStartAddress;
lpOrigParameter = winThreadPtr->lpParameter;
- ckfree((char *)winThreadPtr);
+ ckfree(winThreadPtr);
return lpOrigStartAddress(lpOrigParameter);
}