[ekg2-commit] r3832 - trunk/plugins/ncurses: trunk/plugins/ncurses/old.c

SVN commit svn w toxygen.net
Pon, 3 Mar 2008, 00:30:02 CET


Author: darkjames
Date: 2008-03-03 00:30:02 +0100 (Mon, 03 Mar 2008)
New Revision: 3832

Modified:
   trunk/plugins/ncurses/old.c
Log:
- move sanity check outside loop.
   (it should fix warnings, and optimize loop a little)



Modified: trunk/plugins/ncurses/old.c
===================================================================
--- trunk/plugins/ncurses/old.c	2008-03-02 21:08:34 UTC (rev 3831)
+++ trunk/plugins/ncurses/old.c	2008-03-02 23:30:02 UTC (rev 3832)
@@ -844,6 +844,12 @@
 		n->redraw = 1;
 	}
 
+	if (left < 0)			left = 0;
+	if (left > stdscr->_maxx)	left = stdscr->_maxx;
+
+	if (top < 0)			top = 0;
+	if (top > stdscr->_maxy)	top = stdscr->_maxy;
+
 	for (l = windows; l; l = l->next) {
 		window_t *w = l->data;
 		ncurses_window_t *n = w->private;
@@ -886,16 +892,6 @@
 		w->top = top;
 		w->left = left;
 
-		if (w->left < 0)
-			w->left = 0;
-		if (w->left > stdscr->_maxx)
-			w->left = stdscr->_maxx;
-
-		if (w->top < 0)
-			w->top = 0;
-		if (w->top > stdscr->_maxy)
-			w->top = stdscr->_maxy;
-
 		mvwin(n->window, w->top, w->left);
 
 		if (n->overflow) {



Więcej informacji o liście dyskusyjnej ekg2-commit