/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 1998-2010,2016 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_window.c,v 1.28 2009/12/19 22:01:07 tom Exp $")
+MODULE_ID("$Id: lib_window.c,v 1.32 2021/10/23 23:06:24 tom Exp $")
NCURSES_EXPORT(void)
_nc_synchook(WINDOW *win)
/* move a derived window */
{
WINDOW *orig;
- int i;
int rc = ERR;
T((T_CALLED("mvderwin(%p,%d,%d)"), (void *) win, y, x));
&& (x >= 0 && y >= 0)
&& (x + getmaxx(win) <= getmaxx(orig))
&& (y + getmaxy(win) <= getmaxy(orig))) {
+ int i;
+
wsyncup(win);
win->_parx = x;
win->_pary = y;
{
T((T_CALLED("wsyncdown(%p)"), (void *) win));
- if (win && win->_parent) {
+ if (win != NULL && win->_parent != NULL) {
WINDOW *pp = win->_parent;
int y;
/* make an exact duplicate of the given window */
{
WINDOW *nwin = 0;
- size_t linesize;
- int i;
T((T_CALLED("dupwin(%p)"), (void *) win));
SCREEN *sp = _nc_screen_of(win);
#endif
_nc_lock_global(curses);
- if (win->_flags & _ISPAD) {
+ if (IS_PAD(win)) {
nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx
win->_maxy + 1,
win->_maxx + 1);
}
if (nwin != 0) {
+ int i;
+ size_t linesize;
nwin->_curx = win->_curx;
nwin->_cury = win->_cury;
nwin->_regtop = win->_regtop;
nwin->_regbottom = win->_regbottom;
- if (win->_flags & _ISPAD)
+ if (IS_PAD(win))
nwin->_pad = win->_pad;
- linesize = (win->_maxx + 1) * sizeof(NCURSES_CH_T);
+ linesize = (unsigned) (win->_maxx + 1) * sizeof(NCURSES_CH_T);
for (i = 0; i <= nwin->_maxy; i++) {
memcpy(nwin->_line[i].text, win->_line[i].text, linesize);
nwin->_line[i].firstchar = win->_line[i].firstchar;