Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Takashi Yano
On Tue, 3 Mar 2020 21:03:38 +0100 Hans-Bernhard Bröker wrote: > OTOH the MS documentation calls this DWORD* an "optional output" > argument. If I'm reading that right, it means it should be fine to just > pass NULL to indicate that we don't need it: > > inline void sendOut (HANDLE ) > { >

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Hans-Bernhard Bröker
Am 03.03.2020 um 01:35 schrieb Takashi Yano: The second argument DWORD *wn of sendOut() is not used outside sendOut(), so it can be covered up like: inline void sendOut (HANDLE ) { DWORD wn; WriteConsoleA (handle, buf, ixput, , 0); } I doubt that will improve much, if anything. There

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Takashi Yano
On Tue, 3 Mar 2020 12:14:00 +0100 Corinna Vinschen wrote: > Btw., looking through the code with this change I wonder about ixput not > being set to 0 in sendOut, right after calling WriteConsoleA. That > would drop the need to call empty after calls to sendOut and thus clean > up the code, no?

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-03 Thread Corinna Vinschen
Hi Hans-Bernhard, On Mar 3 00:07, Hans-Bernhard Bröker wrote: > Replace direct access to a pair of co-dependent variables > by calls to methods of a class that encapsulates their relation. > > Also replace C #define by C++ class constant. > --- > winsup/cygwin/fhandler_console.cc | 135

Re: [PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-02 Thread Takashi Yano
Hi Hans, Thanks for the patch. On Tue, 3 Mar 2020 00:07:25 +0100 Hans-Bernhard Bröker wrote: > + inline void sendOut(HANDLE , DWORD *wn) { WriteConsoleA > (handle, buf, ixput, wn, 0); }; The second argument DWORD *wn of sendOut() is not used outside sendOut(), so it can be covered up like:

[PATCH 1/1] Collect handling of wpixput and wpbuf into a helper class.

2020-03-02 Thread Hans-Bernhard Bröker
Replace direct access to a pair of co-dependent variables by calls to methods of a class that encapsulates their relation. Also replace C #define by C++ class constant. --- winsup/cygwin/fhandler_console.cc | 135 -- 1 file changed, 70 insertions(+), 65 deletions(-)