summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-29 13:59:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-29 13:59:55 (GMT)
commita293b747f1f66c39abb0988341c2d4e9d0594a2c (patch)
tree3578f19f6bc447997b3671e236163c4c4a79e3d0 /win
parent300d11729e97fd0dd74eda2e8d4430f7298411f5 (diff)
parent9d7eafebca8461def3b0ec64fd2996717dc7905a (diff)
downloadtcl-a293b747f1f66c39abb0988341c2d4e9d0594a2c.zip
tcl-a293b747f1f66c39abb0988341c2d4e9d0594a2c.tar.gz
tcl-a293b747f1f66c39abb0988341c2d4e9d0594a2c.tar.bz2
Merge 8.7
Diffstat (limited to 'win')
-rw-r--r--win/tclWin32Dll.c4
-rw-r--r--win/tclWinChan.c2
-rw-r--r--win/tclWinConsole.c14
-rw-r--r--win/tclWinError.c4
-rw-r--r--win/tclWinFCmd.c2
-rw-r--r--[-rwxr-xr-x]win/tclWinFile.c28
-rw-r--r--win/tclWinInt.h6
-rw-r--r--win/tclWinLoad.c2
-rw-r--r--win/tclWinNotify.c2
-rw-r--r--win/tclWinPanic.c4
10 files changed, 33 insertions, 35 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index ef8f503..9d927bb 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -290,7 +290,7 @@ TclWinDriveLetterForVolMountPoint(
{
MountPointMap *dlIter, *dlPtr2;
WCHAR Target[55]; /* Target of mount at mount point */
- WCHAR drive[4] = TEXT("A:\\");
+ WCHAR drive[4] = L"A:\\";
/*
* Detect the volume mounted there. Unfortunately, there is no simple way
@@ -368,7 +368,7 @@ TclWinDriveLetterForVolMountPoint(
* We couldn't find it, so we must iterate over the letters.
*/
- for (drive[0] = L'A'; drive[0] <= L'Z'; drive[0]++) {
+ for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) {
/*
* Try to read the volume mount point and see where it points.
*/
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index dcd8528..3b6e4e4 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -1571,7 +1571,7 @@ NativeIsComPort(
* The 4th character must be a digit 1..9
*/
- if ((p[3] < L'1') || (p[3] > L'9')) {
+ if ((p[3] < '1') || (p[3] > '9')) {
return 0;
}
return 1;
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 28969d6..3668ae3 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -202,8 +202,8 @@ static const Tcl_ChannelType consoleChannelType = {
*
* ReadConsoleBytes, WriteConsoleBytes --
*
- * Wrapper for ReadConsole{A,W}, that takes and returns number of bytes
- * instead of number of TCHARS.
+ * Wrapper for ReadConsoleW, that takes and returns number of bytes
+ * instead of number of WCHARS.
*
*----------------------------------------------------------------------
*/
@@ -217,7 +217,6 @@ ReadConsoleBytes(
{
DWORD ntchars;
BOOL result;
- int tcharsize = sizeof(TCHAR);
/*
* If user types a Ctrl-Break or Ctrl-C, ReadConsole will return
@@ -230,11 +229,11 @@ ReadConsoleBytes(
* will run and take whatever action it deems appropriate.
*/
do {
- result = ReadConsole(hConsole, lpBuffer, nbytes / tcharsize, &ntchars,
+ result = ReadConsole(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
NULL);
} while (result && ntchars == 0 && GetLastError() == ERROR_OPERATION_ABORTED);
if (nbytesread != NULL) {
- *nbytesread = ntchars * tcharsize;
+ *nbytesread = ntchars * sizeof(WCHAR);
}
return result;
}
@@ -248,12 +247,11 @@ WriteConsoleBytes(
{
DWORD ntchars;
BOOL result;
- int tcharsize = sizeof(TCHAR);
- result = WriteConsole(hConsole, lpBuffer, nbytes / tcharsize, &ntchars,
+ result = WriteConsole(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
NULL);
if (nbyteswritten != NULL) {
- *nbyteswritten = ntchars * tcharsize;
+ *nbyteswritten = ntchars * sizeof(WCHAR);
}
return result;
}
diff --git a/win/tclWinError.c b/win/tclWinError.c
index bce81fa..18f290f 100644
--- a/win/tclWinError.c
+++ b/win/tclWinError.c
@@ -394,14 +394,14 @@ tclWinDebugPanic(
char buf[TCL_MAX_WARN_LEN * 3];
vsnprintf(buf, sizeof(buf), format, argList);
- msgString[TCL_MAX_WARN_LEN-1] = L'\0';
+ msgString[TCL_MAX_WARN_LEN-1] = '\0';
MultiByteToWideChar(CP_UTF8, 0, buf, -1, msgString, TCL_MAX_WARN_LEN);
/*
* Truncate MessageBox string if it is too long to not overflow the buffer.
*/
- if (msgString[TCL_MAX_WARN_LEN-1] != L'\0') {
+ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') {
memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR));
}
OutputDebugStringW(msgString);
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index b26d125..b3d1ece 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -457,7 +457,7 @@ DoRenameFile(
return TCL_ERROR;
}
nativeTmp = (WCHAR *) tempBuf;
- nativeRest[0] = L'\0';
+ nativeRest[0] = '\0';
result = TCL_ERROR;
nativePrefix = (WCHAR *) L"tclr";
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 20f10ef..caf2a23 100755..100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -395,11 +395,11 @@ WinSymLinkDirectory(
*/
for (loop = nativeTarget; *loop != 0; loop++) {
- if (*loop == L'/') {
- *loop = L'\\';
+ if (*loop == '/') {
+ *loop = '\\';
}
}
- if ((nativeTarget[len-1] == L'\\') && (nativeTarget[len-2] != L':')) {
+ if ((nativeTarget[len-1] == '\\') && (nativeTarget[len-2] != ':')) {
nativeTarget[len-1] = 0;
}
@@ -572,7 +572,7 @@ WinReadLinkDirectory(
*/
offset = 0;
- if (reparseBuffer->MountPointReparseBuffer.PathBuffer[0] == L'\\') {
+ if (reparseBuffer->MountPointReparseBuffer.PathBuffer[0] == '\\') {
/*
* Check whether this is a mounted volume.
*/
@@ -586,7 +586,7 @@ WinReadLinkDirectory(
* to fix here. It doesn't seem very well documented.
*/
- reparseBuffer->MountPointReparseBuffer.PathBuffer[1]=L'\\';
+ reparseBuffer->MountPointReparseBuffer.PathBuffer[1] = '\\';
/*
* Check if a corresponding drive letter exists, and use that
@@ -815,7 +815,7 @@ tclWinDebugPanic(
va_start(argList, format);
vsnprintf(buf, sizeof(buf), format, argList);
- msgString[TCL_MAX_WARN_LEN-1] = L'\0';
+ msgString[TCL_MAX_WARN_LEN-1] = '\0';
MultiByteToWideChar(CP_UTF8, 0, buf, -1, msgString, TCL_MAX_WARN_LEN);
/*
@@ -823,7 +823,7 @@ tclWinDebugPanic(
* and cause possible oversized window error.
*/
- if (msgString[TCL_MAX_WARN_LEN-1] != L'\0') {
+ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') {
memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR));
}
if (IsDebuggerPresent()) {
@@ -1507,7 +1507,7 @@ TclpGetUserHome(
DWORD i, size = MAX_PATH;
wHomeDir = uiPtr->usri1_home_dir;
- if ((wHomeDir != NULL) && (wHomeDir[0] != L'\0')) {
+ if ((wHomeDir != NULL) && (wHomeDir[0] != '\0')) {
size = lstrlenW(wHomeDir);
Tcl_Utf16ToUtfDString(wHomeDir, size, bufferPtr);
} else {
@@ -2593,8 +2593,8 @@ TclpObjNormalizePath(
for (i=0 ; i<len ; i++) {
WCHAR wc = ((WCHAR *) nativePath)[i];
- if (wc >= L'a') {
- wc -= (L'a' - L'A');
+ if (wc >= 'a') {
+ wc -= ('a' - 'A');
((WCHAR *) nativePath)[i] = wc;
}
}
@@ -2684,8 +2684,8 @@ TclpObjNormalizePath(
if (isDrive) {
WCHAR drive = ((WCHAR *) nativePath)[0];
- if (drive >= L'a') {
- drive -= (L'a' - L'A');
+ if (drive >= 'a') {
+ drive -= ('a' - 'A');
((WCHAR *) nativePath)[0] = drive;
}
Tcl_DStringAppend(&dsNorm, (const char *)nativePath,
@@ -2785,8 +2785,8 @@ TclpObjNormalizePath(
* We have to make the drive letter uppercase.
*/
- if (wpath[0] >= L'a') {
- wpath[0] -= (L'a' - L'A');
+ if (wpath[0] >= 'a') {
+ wpath[0] -= ('a' - 'A');
}
Tcl_DStringAppend(&dsNorm, (const char *) wpath,
wpathlen * sizeof(WCHAR));
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index ba07d0e..07c1b9e 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -58,9 +58,9 @@ MODULE_SCOPE Tcl_Channel TclWinOpenSerialChannel(HANDLE handle,
char *channelName, int permissions);
MODULE_SCOPE HANDLE TclWinSerialOpen(HANDLE handle, const WCHAR *name,
DWORD access);
-MODULE_SCOPE int TclWinSymLinkCopyDirectory(const TCHAR *LinkOriginal,
- const TCHAR *LinkCopy);
-MODULE_SCOPE int TclWinSymLinkDelete(const TCHAR *LinkOriginal,
+MODULE_SCOPE int TclWinSymLinkCopyDirectory(const WCHAR *LinkOriginal,
+ const WCHAR *LinkCopy);
+MODULE_SCOPE int TclWinSymLinkDelete(const WCHAR *LinkOriginal,
int linkOnly);
MODULE_SCOPE int TclWinFileOwned(Tcl_Obj *);
diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c
index d0ab6e4..983cfa3 100644
--- a/win/tclWinLoad.c
+++ b/win/tclWinLoad.c
@@ -64,7 +64,7 @@ TclpDlopen(
int flags)
{
HINSTANCE hInstance = NULL;
- const TCHAR *nativeName;
+ const WCHAR *nativeName;
Tcl_LoadHandle handlePtr;
DWORD firstError;
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index b34fc4f..89a1b66 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -49,7 +49,7 @@ static Tcl_ThreadDataKey dataKey;
*/
static int notifierCount = 0;
-static const TCHAR className[] = TEXT("TclNotifier");
+static const WCHAR className[] = L"TclNotifier";
static int initialized = 0;
static CRITICAL_SECTION notifierMutex;
diff --git a/win/tclWinPanic.c b/win/tclWinPanic.c
index 5c6e02d..fbd3e46 100644
--- a/win/tclWinPanic.c
+++ b/win/tclWinPanic.c
@@ -42,14 +42,14 @@ Tcl_ConsolePanic(
va_start(argList, format);
vsnprintf(buf+3, sizeof(buf)-3, format, argList);
buf[sizeof(buf)-1] = 0;
- msgString[TCL_MAX_WARN_LEN-1] = L'\0';
+ msgString[TCL_MAX_WARN_LEN-1] = '\0';
MultiByteToWideChar(CP_UTF8, 0, buf+3, -1, msgString, TCL_MAX_WARN_LEN);
/*
* Truncate MessageBox string if it is too long to not overflow the buffer.
*/
- if (msgString[TCL_MAX_WARN_LEN-1] != L'\0') {
+ if (msgString[TCL_MAX_WARN_LEN-1] != '\0') {
memcpy(msgString + (TCL_MAX_WARN_LEN - 5), L" ...", 5 * sizeof(WCHAR));
}