diff --git a/ncurses-5.7-20100116-wattrsetunused.patch b/ncurses-5.7-20100116-wattrsetunused.patch new file mode 100644 index 0000000..c422a8b --- /dev/null +++ b/ncurses-5.7-20100116-wattrsetunused.patch @@ -0,0 +1,17 @@ +diff -up ncurses-5.7/include/curses.h.in.wattrsetunused ncurses-5.7/include/curses.h.in +--- ncurses-5.7/include/curses.h.in.wattrsetunused 2010-01-19 13:40:06.000000000 +0100 ++++ ncurses-5.7/include/curses.h.in 2010-01-19 14:18:35.000000000 +0100 +@@ -1104,11 +1104,9 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NA + #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)) ++ NCURSES_CAST(int, (win)->_attrs = (at))) + #else +-#define wattrset(win,at) ((win)->_attrs = (at), \ +- NCURSES_CAST(int, (win)->_attrs)) ++#define wattrset(win,at) NCURSES_CAST(int, (win)->_attrs = (at)) + #endif + #endif /* NCURSES_OPAQUE */ + diff --git a/ncurses-5.7-20100116-windowlist.patch b/ncurses-5.7-20100116-windowlist.patch new file mode 100644 index 0000000..9b19fdb --- /dev/null +++ b/ncurses-5.7-20100116-windowlist.patch @@ -0,0 +1,36 @@ +diff -up ncurses-5.7/ncurses/curses.priv.h.windowlist ncurses-5.7/ncurses/curses.priv.h +--- ncurses-5.7/ncurses/curses.priv.h.windowlist 2010-01-19 17:37:05.000000000 +0100 ++++ ncurses-5.7/ncurses/curses.priv.h 2010-01-19 17:41:59.000000000 +0100 +@@ -1098,9 +1098,9 @@ extern NCURSES_EXPORT_VAR(SCREEN *) _nc_ + extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; + + WINDOWLIST { +- WINDOW win; /* first, so WINDOW_EXT() works */ + WINDOWLIST *next; + SCREEN *screen; /* screen containing the window */ ++ WINDOW win; /* WINDOW_EXT() needs to account for offset */ + #ifdef _XOPEN_SOURCE_EXTENDED + char addch_work[(MB_LEN_MAX * 9) + 1]; + unsigned addch_used; /* number of bytes in addch_work[] */ +@@ -1109,7 +1109,7 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) + #endif + }; + +-#define WINDOW_EXT(win,field) (((WINDOWLIST *)(win))->field) ++#define WINDOW_EXT(win,field) (((WINDOWLIST *)((void **)win - 2))->field) + + #define SP_PRE_INIT(sp) \ + sp->_cursrow = -1; \ +diff -up ncurses-5.7/ncurses/tinfo/lib_data.c.windowlist ncurses-5.7/ncurses/tinfo/lib_data.c +--- ncurses-5.7/ncurses/tinfo/lib_data.c.windowlist 2010-01-19 17:37:05.000000000 +0100 ++++ ncurses-5.7/ncurses/tinfo/lib_data.c 2010-01-19 17:45:24.000000000 +0100 +@@ -260,8 +260,7 @@ _nc_screen_of(WINDOW *win) + SCREEN *sp = 0; + + if (win != 0) { +- WINDOWLIST *wp = (WINDOWLIST *) win; +- sp = wp->screen; ++ sp = WINDOW_EXT(win, screen); + } + return (sp); + } diff --git a/ncurses.spec b/ncurses.spec index ed3fb4d..3db75cc 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -1,7 +1,7 @@ Summary: Ncurses support utilities Name: ncurses Version: 5.7 -Release: 4.20100116%{?dist} +Release: 5.20100116%{?dist} License: MIT Group: System Environment/Base URL: http://invisible-island.net/ncurses/ncurses.html @@ -15,6 +15,8 @@ Patch9: ncurses-5.6-20070612-libs.patch Patch11: ncurses-5.6-20080112-urxvt.patch Patch12: ncurses-5.6-20080628-kbs.patch Patch13: ncurses-5.7-20100116-transformdeps.patch +Patch14: ncurses-5.7-20100116-wattrsetunused.patch +Patch15: ncurses-5.7-20100116-windowlist.patch BuildRequires: gpm-devel pkgconfig BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -99,6 +101,8 @@ The ncurses-static package includes static libraries of the ncurses library. %patch11 -p1 -b .urxvt %patch12 -p1 -b .kbs %patch13 -p1 -b .transformdeps +%patch14 -p1 -b .wattrsetunused +%patch15 -p1 -b .windowlist # this will be in documentation, drop executable bits cp -p install-sh test @@ -276,6 +280,10 @@ bzip2 NEWS rm -rf ${RPM_BUILD_ROOT} %changelog +* Wed Jan 20 2010 Miroslav Lichvar 5.7-5.20100116 +- fix narrow/wide libtinfo compatibility +- fix wattrset macro to not produce warning with current gcc (#556645) + * Mon Jan 18 2010 Miroslav Lichvar 5.7-4.20100116 - update to patch 20100116 - don't require -ltinfo when linking with --no-add-needed