Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Merge one more #ifdef with mostly identical co...



details:   https://anonhg.NetBSD.org/src/rev/9b9fbe2df0f7
branches:  trunk
changeset: 445926:9b9fbe2df0f7
user:      uwe <uwe%NetBSD.org@localhost>
date:      Sun Nov 18 02:34:39 2018 +0000

description:
Merge one more #ifdef with mostly identical code in both branches.
The same object code is generated modulo gratuitously different order
of checks.

diffstat:

 lib/libcurses/refresh.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (47 lines):

diff -r 9b9336041bf6 -r 9b9fbe2df0f7 lib/libcurses/refresh.c
--- a/lib/libcurses/refresh.c   Sun Nov 18 02:17:24 2018 +0000
+++ b/lib/libcurses/refresh.c   Sun Nov 18 02:34:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: refresh.c,v 1.98 2018/11/18 02:17:24 uwe Exp $ */
+/*     $NetBSD: refresh.c,v 1.99 2018/11/18 02:34:39 uwe Exp $ */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c  8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.98 2018/11/18 02:17:24 uwe Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.99 2018/11/18 02:34:39 uwe Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -1249,24 +1249,19 @@
 #endif
                _cursesi_screen->ly = wy;
                _cursesi_screen->lx = wx;
-#ifndef HAVE_WCHAR
                while (wx <= lch &&
                       (!celleq(nsp, csp)
                        || (wlp->flags & __ISFORCED)))
                {
-                       if (ce != NULL &&
-                           wx >= nlsp && nsp->ch == ' ' && nsp->attr == lspc)
-                       {
+#ifndef HAVE_WCHAR
+                       if (ce != NULL && wx >= nlsp
+                           && nsp->ch == ' ' && nsp->attr == lspc)
 #else
-               while ((!celleq(nsp, csp) || (wlp->flags & __ISFORCED)) &&
-                       wx <= lch)
-               {
                        if (ce != NULL && wx >= nlsp
                           && nsp->ch == (wchar_t)btowc((int)' ') /* XXX */
                           && (nsp->attr & WA_ATTRIBUTES) == lspc)
+#endif
                        {
-
-#endif
                                /* Check for clear to end-of-line. */
                                cep = &curscr->alines[wy]->line[win->maxx - 1];
 #ifndef HAVE_WCHAR



Home | Main Index | Thread Index | Old Index