summaryrefslogtreecommitdiffstats
path: root/win/tclWinConsole.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-20 21:01:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-09-20 21:01:44 (GMT)
commit0a6728c33d79445c6e4fc81ab9c78f2aa1f2cd82 (patch)
tree898f83b2086deef0af087ce4fe673972d0126a32 /win/tclWinConsole.c
parent213711869322b5aa9b50b4eed31a91f662c058bb (diff)
downloadtcl-0a6728c33d79445c6e4fc81ab9c78f2aa1f2cd82.zip
tcl-0a6728c33d79445c6e4fc81ab9c78f2aa1f2cd82.tar.gz
tcl-0a6728c33d79445c6e4fc81ab9c78f2aa1f2cd82.tar.bz2
Let's use GetWindowLongW/SetWindowLongW on Win32 directly. Missed them because they are not used in Win64.
Diffstat (limited to 'win/tclWinConsole.c')
-rw-r--r--win/tclWinConsole.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 449bea9..173fe9e 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -208,7 +208,6 @@ ReadConsoleBytes(
{
DWORD ntchars;
BOOL result;
- int tcharsize = sizeof(WCHAR);
/*
* If user types a Ctrl-Break or Ctrl-C, ReadConsole will return
@@ -221,11 +220,11 @@ ReadConsoleBytes(
* will run and take whatever action it deems appropriate.
*/
do {
- result = ReadConsoleW(hConsole, lpBuffer, nbytes / tcharsize, &ntchars,
+ result = ReadConsoleW(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;
}
@@ -239,12 +238,11 @@ WriteConsoleBytes(
{
DWORD ntchars;
BOOL result;
- int tcharsize = sizeof(WCHAR);
- result = WriteConsoleW(hConsole, lpBuffer, nbytes / tcharsize, &ntchars,
+ result = WriteConsoleW(hConsole, lpBuffer, nbytes / sizeof(WCHAR), &ntchars,
NULL);
if (nbyteswritten != NULL) {
- *nbyteswritten = ntchars * tcharsize;
+ *nbyteswritten = ntchars * sizeof(WCHAR);
}
return result;
}