/****************************************************************************
- * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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_overlay.c,v 1.21 2002/09/21 23:03:32 tom Exp $")
+MODULE_ID("$Id: lib_overlay.c,v 1.23 2007/04/07 17:13:52 tom Exp $")
static int
overlap(const WINDOW *const s, WINDOW *const d, int const flag)
if (s == 0 || d == 0) {
returnCode(ERR);
} else {
- T(("src : begy %d, begx %d, maxy %d, maxx %d",
- s->_begy, s->_begx, s->_maxy, s->_maxx));
- T(("dst : begy %d, begx %d, maxy %d, maxx %d",
- d->_begy, d->_begx, d->_maxy, d->_maxx));
+ T(("src : begy %ld, begx %ld, maxy %ld, maxx %ld",
+ (long) s->_begy,
+ (long) s->_begx,
+ (long) s->_maxy,
+ (long) s->_maxx));
+ T(("dst : begy %ld, begx %ld, maxy %ld, maxx %ld",
+ (long) d->_begy,
+ (long) d->_begx,
+ (long) d->_maxy,
+ (long) d->_maxx));
sx1 = s->_begx;
sy1 = s->_begy;
{
int sx, sy, dx, dy;
bool touched;
- attr_t bk = AttrOf(dst->_nc_bkgd);
- attr_t mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0);
+ attr_t bk;
+ attr_t mask;
T((T_CALLED("copywin(%p, %p, %d, %d, %d, %d, %d, %d, %d)"),
src, dst, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, over));
if (!src || !dst)
returnCode(ERR);
+ bk = AttrOf(dst->_nc_bkgd);
+ mask = ~(attr_t) ((bk & A_COLOR) ? A_COLOR : 0);
+
/* make sure rectangle exists in source */
if ((sminrow + dmaxrow - dminrow) > (src->_maxy + 1) ||
(smincol + dmaxcol - dmincol) > (src->_maxx + 1)) {