[newlib-cygwin] Remove dead code from fhandler_console.

Corinna Vinschen corinna@sourceware.org
Sun Mar 20 10:55:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=922e21a3eae20cdf68aa8a2db6b03a52648c3d1e

commit 922e21a3eae20cdf68aa8a2db6b03a52648c3d1e
Author: Peter Foley <pefoley2@pefoley.com>
Date:   Sat Mar 19 13:45:48 2016 -0400

    Remove dead code from fhandler_console.
    
    This if is unconditionally false, so remove it.
    
    winsup/cygwin/fhandler_console.cc: In member function 'bool dev_console::fillin(HANDLE)':
    winsup/cygwin/fhandler_console.cc:740:22: error: self-comparison always evaluates to false [-Werror=tautological-compare]
           if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
               ~~~~~~~~~~~^~~~~~~~~~~~~
    winsup/cygwin/fhandler_console.cc:740:50: error: self-comparison always evaluates to false [-Werror=tautological-compare]
           if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
                                           ~~~~~~~~~~~^~~~~~~~~~~~~
    
    winsup/cygwin/ChangeLog
    * fhandle_console.cc (fillin): remove dead code
    
    Signed-off-by: Peter Foley <pefoley2@pefoley.com>

Diff:
---
 winsup/cygwin/fhandler_console.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index ef2d1c5..41af223 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -746,8 +746,6 @@ dev_console::fillin (HANDLE h)
     {
       dwWinSize.Y = 1 + b.srWindow.Bottom - b.srWindow.Top;
       dwWinSize.X = 1 + b.srWindow.Right - b.srWindow.Left;
-      if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
-	dwEnd.X = dwEnd.Y = 0;
       if (b.dwCursorPosition.Y > dwEnd.Y
 	  || (b.dwCursorPosition.Y >= dwEnd.Y && b.dwCursorPosition.X > dwEnd.X))
 	dwEnd = b.dwCursorPosition;



More information about the Cygwin-cvs mailing list