]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_refresh.c
ncurses 5.9 - patch 20111022
[ncurses.git] / ncurses / base / lib_refresh.c
index 01d363f43fde63cccdcfd128589e0ba0b0459857..a77bc487f21c4f8cd4d7dfc0677b473cda93fa60 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -42,7 +42,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_refresh.c,v 1.43 2009/10/24 22:08:32 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.45 2011/06/25 19:02:22 Vassili.Courzakis Exp $")
 
 NCURSES_EXPORT(int)
 wrefresh(WINDOW *win)
 
 NCURSES_EXPORT(int)
 wrefresh(WINDOW *win)
@@ -77,11 +77,11 @@ wrefresh(WINDOW *win)
 NCURSES_EXPORT(int)
 wnoutrefresh(WINDOW *win)
 {
 NCURSES_EXPORT(int)
 wnoutrefresh(WINDOW *win)
 {
-    NCURSES_SIZE_T limit_x;
-    NCURSES_SIZE_T src_row, src_col;
-    NCURSES_SIZE_T begx;
-    NCURSES_SIZE_T begy;
-    NCURSES_SIZE_T dst_row, dst_col;
+    int limit_x;
+    int src_row, src_col;
+    int begx;
+    int begy;
+    int dst_row, dst_col;
 #if USE_SCROLL_HINTS
     bool wide;
 #endif
 #if USE_SCROLL_HINTS
     bool wide;
 #endif
@@ -90,12 +90,6 @@ wnoutrefresh(WINDOW *win)
 #endif
 
     T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
 #endif
 
     T((T_CALLED("wnoutrefresh(%p)"), (void *) win));
-#ifdef TRACE
-    if (USE_TRACEF(TRACE_UPDATE)) {
-       _tracedump("...win", win);
-       _nc_unlock_global(tracef);
-    }
-#endif /* TRACE */
 
     /*
      * This function will break badly if we try to refresh a pad.
 
     /*
      * This function will break badly if we try to refresh a pad.
@@ -104,6 +98,13 @@ wnoutrefresh(WINDOW *win)
        || (win->_flags & _ISPAD))
        returnCode(ERR);
 
        || (win->_flags & _ISPAD))
        returnCode(ERR);
 
+#ifdef TRACE
+    if (USE_TRACEF(TRACE_UPDATE)) {
+       _tracedump("...win", win);
+       _nc_unlock_global(tracef);
+    }
+#endif /* TRACE */
+
     /* put them here so "win == 0" won't break our code */
     begx = win->_begx;
     begy = win->_begy;
     /* put them here so "win == 0" won't break our code */
     begx = win->_begx;
     begy = win->_begy;
@@ -150,8 +151,8 @@ wnoutrefresh(WINDOW *win)
     for (src_row = 0, dst_row = begy + win->_yoffset;
         src_row <= win->_maxy && dst_row <= NewScreen(SP_PARM)->_maxy;
         src_row++, dst_row++) {
     for (src_row = 0, dst_row = begy + win->_yoffset;
         src_row <= win->_maxy && dst_row <= NewScreen(SP_PARM)->_maxy;
         src_row++, dst_row++) {
-       register struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]);
-       register struct ldat *oline = &win->_line[src_row];
+       struct ldat *nline = &(NewScreen(SP_PARM)->_line[dst_row]);
+       struct ldat *oline = &win->_line[src_row];
 
        if (oline->firstchar != _NOCHANGE) {
            int last_src = oline->lastchar;
 
        if (oline->firstchar != _NOCHANGE) {
            int last_src = oline->lastchar;
@@ -163,7 +164,7 @@ wnoutrefresh(WINDOW *win)
            dst_col = src_col + begx;
 
            if_WIDEC({
            dst_col = src_col + begx;
 
            if_WIDEC({
-               register int j;
+               int j;
 
                /*
                 * Ensure that we will copy complete multi-column characters
 
                /*
                 * Ensure that we will copy complete multi-column characters
@@ -204,7 +205,7 @@ wnoutrefresh(WINDOW *win)
                                       : win->_maxx);
                int fix_left = dst_col;
                int fix_right = last_dst;
                                       : win->_maxx);
                int fix_left = dst_col;
                int fix_right = last_dst;
-               register int j;
+               int j;
 
                /*
                 * Check for boundary cases where we may overwrite part of a
 
                /*
                 * Check for boundary cases where we may overwrite part of a
@@ -281,8 +282,9 @@ wnoutrefresh(WINDOW *win)
     }
 
     if (!win->_leaveok) {
     }
 
     if (!win->_leaveok) {
-       NewScreen(SP_PARM)->_cury = win->_cury + win->_begy + win->_yoffset;
-       NewScreen(SP_PARM)->_curx = win->_curx + win->_begx;
+       NewScreen(SP_PARM)->_cury = (NCURSES_SIZE_T) (win->_cury +
+                                                     win->_begy + win->_yoffset);
+       NewScreen(SP_PARM)->_curx = (NCURSES_SIZE_T) (win->_curx + win->_begx);
     }
     NewScreen(SP_PARM)->_leaveok = win->_leaveok;
 
     }
     NewScreen(SP_PARM)->_leaveok = win->_leaveok;