diff options
author | nijtmans <nijtmans> | 2010-09-13 14:20:38 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-09-13 14:20:38 (GMT) |
commit | 977fd8496d174524a12ac1d1bda9ef02b2194503 (patch) | |
tree | 03d8642b19420af74dc2a6df0008c01cb554ad79 /win/tclWinConsole.c | |
parent | 4b90c100d6369a76746f961863759d9c26d4c3eb (diff) | |
download | tcl-977fd8496d174524a12ac1d1bda9ef02b2194503.zip tcl-977fd8496d174524a12ac1d1bda9ef02b2194503.tar.gz tcl-977fd8496d174524a12ac1d1bda9ef02b2194503.tar.bz2 |
Various clean-ups, converting from tclWinProc->xxxProc directly to Xxx
(no change in functionality)
Diffstat (limited to 'win/tclWinConsole.c')
-rw-r--r-- | win/tclWinConsole.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index eb24ef6..6ad92f1 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinConsole.c,v 1.24 2010/05/11 14:47:12 nijtmans Exp $ + * RCS: @(#) $Id: tclWinConsole.c,v 1.25 2010/09/13 14:20:39 nijtmans Exp $ */ #include "tclWinInt.h" @@ -197,9 +197,8 @@ readConsoleBytes( { DWORD ntchars; BOOL result; - int tcharsize; - tcharsize = tclWinProcs->useWide? 2 : 1; - result = tclWinProcs->readConsoleProc( + int tcharsize = sizeof(TCHAR); + result = ReadConsole( hConsole, lpBuffer, nbytes / tcharsize, &ntchars, NULL); if (nbytesread) *nbytesread = (ntchars*tcharsize); @@ -215,9 +214,8 @@ writeConsoleBytes( { DWORD ntchars; BOOL result; - int tcharsize; - tcharsize = tclWinProcs->useWide? 2 : 1; - result = tclWinProcs->writeConsoleProc( + int tcharsize = sizeof(TCHAR); + result = WriteConsole( hConsole, lpBuffer, nbytes / tcharsize, &ntchars, NULL); if (nbyteswritten) *nbyteswritten = (ntchars*tcharsize); @@ -1405,11 +1403,11 @@ TclWinOpenConsoleChannel( Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto"); Tcl_SetChannelOption(NULL, infoPtr->channel, "-eofchar", "\032 {}"); - if (tclWinProcs->useWide) - Tcl_SetChannelOption(NULL, infoPtr->channel, "-encoding", "unicode"); - else - Tcl_SetChannelOption(NULL, infoPtr->channel, "-encoding", encoding); - +#ifdef UNICODE + Tcl_SetChannelOption(NULL, infoPtr->channel, "-encoding", "unicode"); +#else + Tcl_SetChannelOption(NULL, infoPtr->channel, "-encoding", encoding); +#endif return infoPtr->channel; } |