From: Thomas E. Dickey Date: Mon, 7 Mar 2011 10:49:20 +0000 (+0000) Subject: ncurses 5.8 - patch 20110305 X-Git-Tag: v5.9~6 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=9817912d803dae0223ada5ab28c6df521800d4bb ncurses 5.8 - patch 20110305 + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes for compiler warnings (report by Nicolas Boulenguez). + modify Ada95/gen/gen.c to declare unused bits in generated layouts, needed to compile when chtype is 64-bits using gnat 4.4.5 --- diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 31391864..86d3b697 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998,2010,2011 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 * @@ -32,7 +32,7 @@ /* Version Control - $Id: gen.c,v 1.54 2010/09/04 21:19:50 tom Exp $ + $Id: gen.c,v 1.55 2011/03/05 20:24:22 tom Exp $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -124,7 +124,10 @@ gen_reps( int len, /* size of the record in bytes */ int bias) { - int i, n, l, cnt = 0, low, high; + const char *unused_name = "Unused"; + int long_bits = (8 * (int)sizeof(unsigned long)); + int len_bits = (8 * len); + int i, j, n, l, cnt = 0, low, high; int width = strlen(RES_NAME) + 3; unsigned long a; unsigned long mask = 0; @@ -144,8 +147,32 @@ gen_reps( printf(" record\n"); for (i = 0; nap[i].name != (char *)0; i++) { + mask |= nap[i].attr; printf(" %-*s : Boolean;\n", width, nap[i].name); } + + /* + * Compute a mask for the unused bits in this target. + */ + mask = ~mask; + /* + * Bits in the biased area are unused by the target. + */ + for (j = 0; j < bias; ++j) + { + mask &= (unsigned long)(~(1L << j)); + } + /* + * Bits past the target's size are really unused. + */ + for (j = len_bits + bias; j < long_bits; ++j) + { + mask &= (unsigned long)(~(1L << j)); + } + if (mask != 0) + { + printf(" %-*s : Boolean;\n", width, unused_name); + } printf(" end record;\n"); printf(" pragma Convention (C, %s);\n\n", name); @@ -155,16 +182,22 @@ gen_reps( for (i = 0; nap[i].name != (char *)0; i++) { a = nap[i].attr; - mask |= a; l = find_pos((char *)&a, sizeof(a), &low, &high); if (l >= 0) printf(" %-*s at 0 range %2d .. %2d;\n", width, nap[i].name, low - bias, high - bias); } + if (mask != 0) + { + l = find_pos((char *)&mask, sizeof(mask), &low, &high); + if (l >= 0) + printf(" %-*s at 0 range %2d .. %2d;\n", width, unused_name, + low - bias, high - bias); + } i = 1; n = cnt; printf(" end record;\n"); - printf(" for %s'Size use %d;\n", name, 8 * len); + printf(" for %s'Size use %d;\n", name, len_bits); printf(" -- Please note: this rep. clause is generated and may be\n"); printf(" -- different on your system."); } diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in index 3d1554c7..0179fcf4 100644 --- a/Ada95/samples/Makefile.in +++ b/Ada95/samples/Makefile.in @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 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"), # @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.41 2011/03/06 01:22:23 Nicolas.Boulenguez Exp $ # .SUFFIXES: @@ -110,12 +110,9 @@ uninstall.libs :: ncurses$x : $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) -tour$x : explain.msg +tour$x : $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) -explain.msg: $(srcdir)/explain.txt - cp $(srcdir)/explain.txt $@ - rain$x : $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) @@ -124,7 +121,7 @@ mostlyclean: clean :: mostlyclean rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ - explain.msg trace screendump b~*.ad[bs] + trace screendump b~*.ad[bs] distclean :: clean rm -f Makefile diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb index 3129dfd7..93c497c3 100644 --- a/Ada95/samples/sample-explanation.adb +++ b/Ada95/samples/sample-explanation.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 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 -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.21 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.22 $ +-- $Date: 2011/03/06 01:22:23 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and @@ -58,7 +58,7 @@ package body Sample.Explanation is Help_Keys : constant String := "HELPKEYS"; In_Help : constant String := "INHELP"; - File_Name : constant String := "explain.msg"; + File_Name : constant String := "explain.txt"; F : File_Type; type Help_Line; diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr index 62d67702..2396e2ce 100644 --- a/Ada95/src/library.gpr +++ b/Ada95/src/library.gpr @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------ --- Copyright (c) 2010 Free Software Foundation, Inc. -- +-- Copyright (c) 2010,2011 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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- $Id: library.gpr,v 1.5 2010/11/27 22:15:04 tom Exp $ +-- $Id: library.gpr,v 1.6 2011/03/06 01:22:23 Nicolas.Boulenguez Exp $ -- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html -- http://www.adaworld.com/debian/debian-ada-policy.html project Library is @@ -43,6 +43,7 @@ project Library is for Source_Dirs use (Source_Dir & "/src", Source_Dir2, Build_Dir & "/src"); + for Library_Options use ("-lpanel", "-lmenu", "-lform"); package Compiler is for Default_Switches ("Ada") use ("-g", diff --git a/INSTALL b/INSTALL index 282c2a36..167b2280 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.152 2011/02/25 22:10:53 tom Exp $ +-- $Id: INSTALL,v 1.153 2011/03/05 19:09:48 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -733,7 +733,8 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables. + executables, e.g., by setting "--with-chtype=long" (the configure + script supplies "unsigned"). --with-database=XXX Specify the terminfo source file to install. Usually you will wish diff --git a/NEWS b/NEWS index 55f3cc74..18a5c2d3 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.1651 2011/02/26 16:54:31 tom Exp $ +-- $Id: NEWS,v 1.1654 2011/03/06 01:25:25 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. +20110305 + + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes + for compiler warnings (report by Nicolas Boulenguez). + + modify Ada95/gen/gen.c to declare unused bits in generated layouts, + needed to compile when chtype is 64-bits using gnat 4.4.5 + 20110226 5.8 release for upload to ftp.gnu.org 20110226 diff --git a/dist.mk b/dist.mk index 1929e970..7dc34c1b 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.800 2011/02/25 22:11:00 tom Exp $ +# $Id: dist.mk,v 1.801 2011/03/05 15:31:36 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 = 8 -NCURSES_PATCH = 20110226 +NCURSES_PATCH = 20110305 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c index 7a2eecd9..84f17ae0 100644 --- a/ncurses/base/lib_slk.c +++ b/ncurses/base/lib_slk.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 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 * @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_slk.c,v 1.47 2010/12/25 22:58:58 tom Exp $") +MODULE_ID("$Id: lib_slk.c,v 1.48 2011/03/05 21:21:52 tom Exp $") #ifdef USE_TERM_DRIVER #define NumLabels InfoOf(SP_PARM).numlabels @@ -138,7 +138,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols) { int i; int res = OK; - int max_length; + size_t max_length; SCREEN *sp; int numlab; @@ -189,9 +189,9 @@ _nc_slk_initialize(WINDOW *stwin, int cols) == NULL) returnCode(slk_failed(NCURSES_SP_ARG)); - max_length = SP_PARM->_slk->maxlen; + max_length = (size_t) SP_PARM->_slk->maxlen; for (i = 0; i < SP_PARM->_slk->labcnt; i++) { - size_t used = (size_t) max_length + 1; + size_t used = max_length + 1; SP_PARM->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used); if (SP_PARM->_slk->ent[i].ent_text == 0) @@ -202,8 +202,10 @@ _nc_slk_initialize(WINDOW *stwin, int cols) if (SP_PARM->_slk->ent[i].form_text == 0) returnCode(slk_failed(NCURSES_SP_ARG)); - memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1); - SP_PARM->_slk->ent[i].form_text[used] = '\0'; + if (used > 1) { + memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1); + } + SP_PARM->_slk->ent[i].form_text[used - 1] = '\0'; SP_PARM->_slk->ent[i].visible = (char) (i < SP_PARM->_slk->maxlab); }