summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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--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 915f9a3..4fc97db 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 739d595..1f9c757 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 f6358d1..177837a 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 7897ff7..fc07b3e 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 a69ec3b..6780328 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -455,7 +455,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 92a300a..080156e 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
@@ -814,7 +814,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);
/*
@@ -822,7 +822,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()) {
@@ -1484,7 +1484,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);
TclWCharToUtfDString(wHomeDir, size, bufferPtr);
} else {
@@ -2563,8 +2563,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;
}
}
@@ -2654,8 +2654,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,
@@ -2752,8 +2752,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 a12ed16..f019744 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 9d398d7..be6299c 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 59dfe5d..85945e3 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));
}