From: Thomas E. Dickey Date: Sun, 17 May 2009 00:47:23 +0000 (+0000) Subject: ncurses 5.7 - patch 20090516 X-Git-Tag: v5.8~91 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=9dda8e1ed1bfb63fa23d99a816f6c046ba0e307c ncurses 5.7 - patch 20090516 + work around antique BSD game's manipulation of stdscr, etc., versus SCREEN's copy of the pointer (Debian #528411). + add a cast to wattrset macro to avoid compiler warning when comparing its result against ERR (adapted from patch by Matt Kraii, Debian #528374). --- diff --git a/NEWS b/NEWS index 2903d41b..7d93054a 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1386 2009/05/10 21:27:04 tom Exp $ +-- $Id: NEWS,v 1.1388 2009/05/17 00:20:31 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,13 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20090516 + + work around antique BSD game's manipulation of stdscr, etc., versus + SCREEN's copy of the pointer (Debian #528411). + + add a cast to wattrset macro to avoid compiler warning when comparing + its result against ERR (adapted from patch by Matt Kraii, Debian + #528374). + 20090510 + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). diff --git a/dist.mk b/dist.mk index 8f754ab7..de34e5de 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.699 2009/05/10 21:27:04 tom Exp $ +# $Id: dist.mk,v 1.700 2009/05/15 23:35:19 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 7 -NCURSES_PATCH = 20090510 +NCURSES_PATCH = 20090516 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/curses.h.in b/include/curses.h.in index b76a5c4d..665645b2 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.199 2009/05/09 15:48:04 tom Exp $ */ +/* $Id: curses.h.in,v 1.200 2009/05/16 23:27:59 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -1093,9 +1093,9 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); #if !NCURSES_OPAQUE #if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@ #define wattrset(win,at) ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = (at)) + NCURSES_CAST(int, (win)->_attrs = (at))) #else -#define wattrset(win,at) ((win)->_attrs = (at)) +#define wattrset(win,at) NCURSES_CAST(int, (win)->_attrs = (at)) #endif #endif /* NCURSES_OPAQUE */ diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c index 714e3e7e..61248f5d 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.118 2009/04/18 23:53:04 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.119 2009/05/15 23:47:26 tom Exp $") static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); @@ -260,10 +260,13 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch) /* * Build up multibyte characters until we have a wide-character. */ - if_WIDEC({ #if NCURSES_SP_FUNCS - SCREEN *sp = _nc_screen_of(win); +#define DeriveSP() SCREEN *sp = _nc_screen_of(win); +#else +#define DeriveSP() /*nothing*/ #endif + if_WIDEC({ + DeriveSP(); if (WINDOW_EXT(win, addch_used) != 0 || !Charable(ch)) { int len = _nc_build_wch(win, CHREF(ch)); diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 7e99b358..b91053bc 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -82,7 +82,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.255 2009/05/10 00:53:14 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.256 2009/05/17 00:13:49 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -668,8 +668,27 @@ NCURSES_SP_NAME(doupdate) (NCURSES_SP_DCL0) T((T_CALLED("doupdate()"))); +#if !USE_REENTRANT + /* + * It is "legal" but unlikely that an application could assign a new + * value to one of the standard windows. Check for that possibility + * and try to recover. + * + * We do not allow applications to assign new values in the reentrant + * model. + */ +#define SyncScreens(internal,exported) \ + if (internal == 0) internal = exported; \ + if (internal != exported) exported = internal + + SyncScreens(CurScreen(SP_PARM), curscr); + SyncScreens(NewScreen(SP_PARM), newscr); + SyncScreens(StdScreen(SP_PARM), stdscr); +#endif + if (CurScreen(SP_PARM) == 0 - || NewScreen(SP_PARM) == 0) + || NewScreen(SP_PARM) == 0 + || StdScreen(SP_PARM) == 0) returnCode(ERR); #ifdef TRACE