X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_mvwin.c;h=18d31c13319b4c43d755e6a8a17f7a2f9b89251f;hp=090d8fe730abc6cd6cb89aeda7246866bb4200a5;hb=6b99a559185b3b8fad80b56bc2070b08101c33d1;hpb=7a6bbc8cf41c5186d46accc3d08622dc86526b34;ds=sidebyside diff --git a/ncurses/base/lib_mvwin.c b/ncurses/base/lib_mvwin.c index 090d8fe7..18d31c13 100644 --- a/ncurses/base/lib_mvwin.c +++ b/ncurses/base/lib_mvwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -40,12 +42,16 @@ #include -MODULE_ID("$Id: lib_mvwin.c,v 1.15 2009/04/18 18:25:37 tom Exp $") +MODULE_ID("$Id: lib_mvwin.c,v 1.18 2010/12/19 01:22:58 tom Exp $") NCURSES_EXPORT(int) mvwin(WINDOW *win, int by, int bx) { - T((T_CALLED("mvwin(%p,%d,%d)"), win, by, bx)); +#if NCURSES_SP_FUNCS + SCREEN *sp = _nc_screen_of(win); +#endif + + T((T_CALLED("mvwin(%p,%d,%d)"), (void *) win, by, bx)); if (!win || (win->_flags & _ISPAD)) returnCode(ERR); @@ -96,8 +102,8 @@ mvwin(WINDOW *win, int by, int bx) } #endif - if (by + win->_maxy > screen_lines(CURRENT_SCREEN) - 1 - || bx + win->_maxx > screen_columns(CURRENT_SCREEN) - 1 + if (by + win->_maxy > screen_lines(SP_PARM) - 1 + || bx + win->_maxx > screen_columns(SP_PARM) - 1 || by < 0 || bx < 0) returnCode(ERR); @@ -108,7 +114,7 @@ mvwin(WINDOW *win, int by, int bx) * new location. This ensures that if the caller has refreshed another * window at the same location, that this one will be displayed. */ - win->_begy = by; - win->_begx = bx; + win->_begy = (NCURSES_SIZE_T) by; + win->_begx = (NCURSES_SIZE_T) bx; returnCode(touchwin(win)); }