From 89175dffb0245ffaa1ffec80373cb9990f8dc7fe Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 18 Sep 2016 02:03:51 +0000 Subject: [PATCH] ncurses 6.0 - patch 20160917 + build-fix for gnat6, which unhelpfully attempts to compile C files. + fix typo in 20160910 changes (Debian #837892, patch by Sven Joachim). --- Ada95/src/Makefile.in | 8 +++-- Ada95/src/library-cfg.sh | 50 ++++++++++++++++++++++++++++++++ Ada95/src/library.gpr | 7 +++-- MANIFEST | 1 + NEWS | 6 +++- VERSION | 2 +- dist.mk | 4 +-- ncurses/tinfo/MKfallback.sh | 14 +++++---- ncurses/tinfo/write_entry.c | 4 +-- ncurses/win32con/win_driver.c | 6 ++-- package/debian-mingw/changelog | 4 +-- package/debian-mingw64/changelog | 4 +-- package/debian/changelog | 4 +-- package/mingw-ncurses.nsi | 4 +-- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- test/ncurses.c | 9 +++--- test/worm.c | 10 +++---- 18 files changed, 102 insertions(+), 39 deletions(-) create mode 100644 Ada95/src/library-cfg.sh diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in index 10bd2ce7..557c8a51 100644 --- a/Ada95/src/Makefile.in +++ b/Ada95/src/Makefile.in @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.72 2016/08/13 18:04:27 tom Exp $ +# $Id: Makefile.in,v 1.73 2016/09/18 00:25:32 tom Exp $ # .SUFFIXES: @@ -90,7 +90,7 @@ ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) LIB_NAME = AdaCurses SONAME = @ADA_SHAREDLIB@ -GNAT_PROJECT = $(srcdir)/library.gpr +GNAT_PROJECT = AdaCurses.gpr # build/source are the Ada95 tree BUILD_DIR = .. @@ -270,8 +270,10 @@ STATIC_DIRS = \ @USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \ @USE_GNAT_PROJECTS@ $(STATIC_C_OBJS) \ @USE_GNAT_PROJECTS@ $(STATIC_DIRS) +@USE_GNAT_PROJECTS@ $(SHELL) $(srcdir)/library-cfg.sh $(srcdir)/library.gpr $(CFLAGS_NORMAL) >$(GNAT_PROJECT) @USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static @USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS) +@USE_GNAT_PROJECTS@ -rm -f $(GNAT_PROJECT) @USE_GNAT_PROJECTS@ @USE_GNAT_LIBRARIES@install \ @USE_GNAT_LIBRARIES@install.libs :: \ @@ -302,7 +304,9 @@ SHARED_DIRS = \ @MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS) \ @MAKE_ADA_SHAREDLIB@ $(SHARED_OBJS) @MAKE_ADA_SHAREDLIB@ cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/ +@MAKE_ADA_SHAREDLIB@ $(SHELL) $(srcdir)/library-cfg.sh $(srcdir)/library.gpr $(CFLAGS_SHARED) >$(GNAT_PROJECT) @MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic +@MAKE_ADA_SHAREDLIB@ -rm -f $(GNAT_PROJECT) install \ install.libs :: $(ADA_INCLUDE) diff --git a/Ada95/src/library-cfg.sh b/Ada95/src/library-cfg.sh new file mode 100644 index 00000000..d1c1ce35 --- /dev/null +++ b/Ada95/src/library-cfg.sh @@ -0,0 +1,50 @@ +#!/bin/sh +############################################################################## +# Copyright (c) 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 "Software"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# +# $Id: library-cfg.sh,v 1.1 2016/09/17 23:45:03 tom Exp $ +# +# Work around incompatible behavior introduced with gnat6, which causes +# gnatmake to attempt to compile all of the C objects which might be part of +# the project. This can only work if we provide the compiler flags (done here +# by making a copy of the project file with that information filled in). +input=$1 +shift 1 +param= +while test $# != 0 +do + test -n "$param" && param="$param," + param="$param\"$1\"" + shift 1 +done + +sed \ + -e '/for Default_Switches ("C") use/s,-- ,,' \ + -e '/for Default_Switches ("C") use/s% use .*'%" use($param);"% \ + $input +exit 0 diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr index e7380f09..dc31103a 100644 --- a/Ada95/src/library.gpr +++ b/Ada95/src/library.gpr @@ -25,10 +25,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- $Id: library.gpr,v 1.9 2014/06/01 01:13:09 tom Exp $ +-- $Id: library.gpr,v 1.10 2016/09/18 00:25:54 tom Exp $ -- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html -- http://www.adaworld.com/debian/debian-ada-policy.html -project Library is +project AdaCurses is Build_Dir := External ("BUILD_DIR"); Source_Dir := External ("SOURCE_DIR"); Source_Dir2 := External ("SOURCE_DIR2"); @@ -51,6 +51,7 @@ project Library is "-gnatafno", "-gnatVa", -- All validity checks "-gnatwa"); -- Activate all optional errors + -- for Default_Switches ("C") use end Compiler; for Languages use ("C", "Ada"); -end Library; +end AdaCurses; diff --git a/MANIFEST b/MANIFEST index 528f07a0..a038ad63 100644 --- a/MANIFEST +++ b/MANIFEST @@ -132,6 +132,7 @@ ./Ada95/src/c_threaded_variables.h ./Ada95/src/c_varargs_to_ada.c ./Ada95/src/c_varargs_to_ada.h +./Ada95/src/library-cfg.sh ./Ada95/src/library.gpr ./Ada95/src/modules ./Ada95/src/ncurses_compat.c diff --git a/NEWS b/NEWS index b43ff725..1ecda2f6 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.2664 2016/09/10 22:07:14 tom Exp $ +-- $Id: NEWS,v 1.2667 2016/09/18 00:38:06 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,10 @@ 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. +20160917 + + build-fix for gnat6, which unhelpfully attempts to compile C files. + + fix typo in 20160910 changes (Debian #837892, patch by Sven Joachim). + 20160910 + trim dead code ifdef'd with HIDE_EINTR since 970830 (discussion with Leon Winter). diff --git a/VERSION b/VERSION index c2e12e30..3bf18a61 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20160910 +5:0:9 6.0 20160917 diff --git a/dist.mk b/dist.mk index a6426d6a..44b75de3 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.1123 2016/09/04 17:02:31 tom Exp $ +# $Id: dist.mk,v 1.1124 2016/09/17 13:25:35 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 = 6 NCURSES_MINOR = 0 -NCURSES_PATCH = 20160910 +NCURSES_PATCH = 20160917 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/tinfo/MKfallback.sh b/ncurses/tinfo/MKfallback.sh index 11f1d2ea..53d05f87 100755 --- a/ncurses/tinfo/MKfallback.sh +++ b/ncurses/tinfo/MKfallback.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 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 "Software"), # @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: MKfallback.sh,v 1.15 2010/08/07 20:32:34 tom Exp $ +# $Id: MKfallback.sh,v 1.16 2016/09/17 21:28:03 tom Exp $ # # MKfallback.sh -- create fallback table for entry reads # @@ -119,17 +119,19 @@ then const TERMTYPE *tp; for (tp = fallbacks; - tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE); - tp++) - if (_nc_name_match(tp->term_names, name, "|")) + tp < fallbacks + sizeof(fallbacks)/sizeof(TERMTYPE); + tp++) { + if (_nc_name_match(tp->term_names, name, "|")) { return(tp); + } + } EOF else echo " /* the fallback list is empty */"; fi cat < 0) { if (rc < 0) rc = 0; - rc += nRead; + rc = rc + (int) nRead; if (inp_rec.EventType == KEY_EVENT) { if (!inp_rec.Event.KeyEvent.bKeyDown) continue; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 5385754f..cf4d4727 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20160910) unstable; urgency=low +ncurses6 (6.0+20160917) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 04 Sep 2016 13:02:31 -0400 + -- Thomas E. Dickey Sat, 17 Sep 2016 09:25:35 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 5385754f..cf4d4727 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20160910) unstable; urgency=low +ncurses6 (6.0+20160917) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 04 Sep 2016 13:02:31 -0400 + -- Thomas E. Dickey Sat, 17 Sep 2016 09:25:35 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index bf3b36ab..f1716303 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.0+20160910) unstable; urgency=low +ncurses6 (6.0+20160917) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 04 Sep 2016 13:02:31 -0400 + -- Thomas E. Dickey Sat, 17 Sep 2016 09:25:35 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 0ebea19d..b8d4960d 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.175 2016/09/04 17:02:31 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.176 2016/09/17 13:25:35 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "0" !define VERSION_YYYY "2016" -!define VERSION_MMDD "0910" +!define VERSION_MMDD "0917" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 258de5f7..348a9d0a 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.0 -Release: 20160910 +Release: 20160917 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index a63bf1dc..5284b886 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.0 -Release: 20160910 +Release: 20160917 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/test/ncurses.c b/test/ncurses.c index 8f3ac071..ddd054e4 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.445 2016/09/10 23:30:15 tom Exp $ +$Id: ncurses.c,v 1.446 2016/09/17 21:12:04 tom Exp $ ***************************************************************************/ @@ -2704,7 +2704,8 @@ init_all_colors(bool xterm_colors, char *palette_file) int n; int got; char result[BUFSIZ]; - int check_n, check_r, check_g, check_b; + int check_n; + unsigned check_r, check_g, check_b; raw(); noecho(); @@ -6925,11 +6926,11 @@ show_settings(void) show_string_setting("longname", longname()); show_number_setting("baudrate", baudrate()); if (erasechar() > 0) { - show_string_setting("unctrl(erasechar)", unctrl(erasechar())); + show_string_setting("unctrl(erasechar)", unctrl((chtype) erasechar())); show_string_setting("keyname(erasechar)", keyname(erasechar())); } if (killchar() > 0) { - show_string_setting("unctrl(killchar)", unctrl(killchar())); + show_string_setting("unctrl(killchar)", unctrl((chtype) killchar())); show_string_setting("keyname(killchar)", keyname(killchar())); } #if USE_WIDEC_SUPPORT diff --git a/test/worm.c b/test/worm.c index c3fc0da8..92bdb254 100644 --- a/test/worm.c +++ b/test/worm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,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 * @@ -61,7 +61,7 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.65 2013/06/22 20:01:41 tom Exp $ + $Id: worm.c,v 1.66 2016/09/17 21:12:30 tom Exp $ */ #include @@ -324,9 +324,9 @@ draw_worm(WINDOW *win, void *data) static bool quit_worm(int bitnum) { - pending |= (1 << bitnum); + pending = (pending | (unsigned) (1 << bitnum)); napms(10); /* let the other thread(s) have a chance */ - pending &= ~(1 << bitnum); + pending = (pending & (unsigned) ~(1 << bitnum)); return quitting; } @@ -335,7 +335,7 @@ start_worm(void *arg) { unsigned long compare = 0; Trace(("start_worm")); - while (!quit_worm(((struct worm *) arg) - worm)) { + while (!quit_worm((int) (((struct worm *) arg) - worm))) { while (compare < sequence) { ++compare; #if HAVE_USE_WINDOW