diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-09 13:06:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-05-09 13:06:02 (GMT) |
commit | 2e02e1affdde86a1dd00fc78a73af5924c6d30a0 (patch) | |
tree | edd17dc2eb2b5ee392bc152bec52ebad7a56461b /win | |
parent | 8f15f094913d1b1304514e093149538bf2cfedc5 (diff) | |
download | tcl-2e02e1affdde86a1dd00fc78a73af5924c6d30a0.zip tcl-2e02e1affdde86a1dd00fc78a73af5924c6d30a0.tar.gz tcl-2e02e1affdde86a1dd00fc78a73af5924c6d30a0.tar.bz2 |
Remove useless type-casts. Backport some changes from 9.0
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFile.c | 10 | ||||
-rw-r--r-- | win/tclWinReg.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f0c46f9..adc1d7d 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -170,7 +170,7 @@ static int NativeWriteReparse(const WCHAR *LinkDirectory, static int NativeMatchType(int isDrive, DWORD attr, const WCHAR *nativeName, Tcl_GlobTypeData *types); static int WinIsDrive(const char *name, size_t nameLen); -static Tcl_Size WinIsReserved(const char *path); +static size_t WinIsReserved(const char *path); static Tcl_Obj * WinReadLink(const WCHAR *LinkSource); static Tcl_Obj * WinReadLinkDirectory(const WCHAR *LinkDirectory); static int WinLink(const WCHAR *LinkSource, @@ -1245,7 +1245,7 @@ WinIsDrive( * (not any trailing :). */ -static Tcl_Size +static size_t WinIsReserved( const char *path) /* Path in UTF-8 */ { @@ -2579,14 +2579,14 @@ TclpObjNormalizePath( */ if (isDrive) { - Tcl_Size len = WinIsReserved(path); + size_t len = WinIsReserved(path); if (len > 0) { /* * Actually it does exist - COM1, etc. */ - Tcl_Size i; + size_t i; for (i=0 ; i<len ; i++) { WCHAR wc = ((WCHAR *)nativePath)[i]; @@ -2744,7 +2744,7 @@ TclpObjNormalizePath( sizeof(WCHAR)); Tcl_DStringAppend(&dsNorm, (const char *) nativeName, - (int) (wcslen(nativeName)*sizeof(WCHAR))); + wcslen(nativeName)*sizeof(WCHAR)); } } } diff --git a/win/tclWinReg.c b/win/tclWinReg.c index 3732550..1ccb105 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -804,7 +804,7 @@ GetValue( */ length = Tcl_DStringLength(&data) * (2 / sizeof(WCHAR)); - Tcl_DStringSetLength(&data, (int) length * sizeof(WCHAR)); + Tcl_DStringSetLength(&data, length * sizeof(WCHAR)); result = RegQueryValueExW(key, nativeValue, NULL, &type, (BYTE *) Tcl_DStringValue(&data), &length); } @@ -865,7 +865,7 @@ GetValue( */ Tcl_SetObjResult(interp, Tcl_NewByteArrayObj( - (BYTE *) Tcl_DStringValue(&data), (int) length)); + (BYTE *) Tcl_DStringValue(&data), length)); } Tcl_DStringFree(&data); return result; @@ -914,7 +914,7 @@ GetValueNames( resultPtr = Tcl_NewObj(); Tcl_DStringInit(&buffer); - Tcl_DStringSetLength(&buffer, (int) (MAX_KEY_LENGTH * sizeof(WCHAR))); + Tcl_DStringSetLength(&buffer, MAX_KEY_LENGTH * sizeof(WCHAR)); index = 0; result = TCL_OK; @@ -1221,7 +1221,7 @@ RecursiveDeleteKey( } Tcl_DStringInit(&subkey); - Tcl_DStringSetLength(&subkey, (int) (MAX_KEY_LENGTH * sizeof(WCHAR))); + Tcl_DStringSetLength(&subkey, MAX_KEY_LENGTH * sizeof(WCHAR)); mode = saveMode; while (result == ERROR_SUCCESS) { |