From 687aeec3e382083652c3bb2e94fb6d3bf101a1f9 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Tue, 8 Mar 2011 02:01:18 +0000 Subject: [PATCH] ncurses 5.8 - patch 20110307 + revert changes to limit-checks from 20110122 (Debian #616711). > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + corrected a minor sign error in a field of Low_Level_Field_Type, to conform to form.h. + replaced C_Int by Curses_Bool as return type for some callbacks, see fieldtype(3FORM). + modify samples/sample-explain.adb to provide explicit message when explain.txt is not found. --- ..._interface-curses-forms-field_types.ads.m4 | 20 +++++++++---------- Ada95/samples/sample-explanation.adb | 10 ++++++++-- ...e-curses-forms-field_types-user-choice.adb | 14 ++++++------- ...e-curses-forms-field_types-user-choice.ads | 10 +++++----- ...nterface-curses-forms-field_types-user.adb | 14 ++++++------- ...nterface-curses-forms-field_types-user.ads | 10 +++++----- ...nal_interface-curses-forms-field_types.adb | 14 ++++++------- NEWS | 12 ++++++++++- dist.mk | 4 ++-- ncurses/base/lib_newwin.c | 6 +++--- 10 files changed, 65 insertions(+), 49 deletions(-) diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 index 36314012..c7082b42 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -10,7 +10,7 @@ include(M4MACRO)dnl -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,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 -- @@ -38,7 +38,7 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.15 $ +-- $Revision: 1.16 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -101,15 +101,15 @@ private pragma Convention (C, Freearg_Function); type Field_Check_Function is access - function (Fld : Field; Usr : System.Address) return C_Int; + function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Function); type Char_Check_Function is access - function (Ch : C_Int; Usr : System.Address) return C_Int; + function (Ch : C_Int; Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Function); type Choice_Function is access - function (Fld : Field; Usr : System.Address) return C_Int; + function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Choice_Function); -- +---------------------------------------------------------------------- @@ -117,7 +117,7 @@ private -- | type Low_Level_Field_Type is record - Status : Interfaces.C.short; + Status : Interfaces.C.unsigned_short; Ref_Count : Interfaces.C.long; Left, Right : System.Address; Makearg : Makearg_Function; @@ -174,7 +174,7 @@ private -- introduced by this binding. function Field_Check_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Router); -- This is the Field_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -182,7 +182,7 @@ private -- function. function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Router); -- This is the Char_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -190,7 +190,7 @@ private -- function. function Next_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Next_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -198,7 +198,7 @@ private -- function. function Prev_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Prev_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb index 93c497c3..09f882c3 100644 --- a/Ada95/samples/sample-explanation.adb +++ b/Ada95/samples/sample-explanation.adb @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.22 $ --- $Date: 2011/03/06 01:22:23 $ +-- $Revision: 1.23 $ +-- $Date: 2011/03/08 00:44:36 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and @@ -405,4 +405,10 @@ package body Sample.Explanation is begin Open (F, In_File, File_Name); +exception + when Name_Error => + Put_Line (Standard_Error, + "The file explain.txt was not found in the current directory." + ); + raise; end Sample.Explanation; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb index f26a42cd..2a3ae477 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,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.15 $ --- $Date: 2008/07/26 18:48:58 $ +-- $Revision: 1.16 $ +-- $Date: 2011/03/08 01:16:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; @@ -50,7 +50,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is pragma Warnings (On); function Generic_Next (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := @@ -58,11 +58,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is (To_Argument_Access (Usr).Typ); begin Result := Next (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Next; function Generic_Prev (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := @@ -70,7 +70,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is (To_Argument_Access (Usr).Typ); begin Result := Previous (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Prev; -- ----------------------------------------------------------------------- diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads index 1e69f43a..0707ddca 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,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.12 $ --- $Date: 2008/07/26 18:49:20 $ +-- $Revision: 1.13 $ +-- $Date: 2011/03/08 01:16:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -78,14 +78,14 @@ private function C_Generic_Choice return C_Field_Type; function Generic_Next (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Next); -- This is the generic next Choice_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivates. It routes -- the call to the Next implementation for the type. function Generic_Prev (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Prev); -- This is the generic prev Choice_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivates. It routes diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb index 695f9197..31874a5d 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,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.16 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.17 $ +-- $Date: 2011/03/08 01:16:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; @@ -82,25 +82,25 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is pragma Warnings (On); function Generic_Field_Check (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); begin Result := Field_Check (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Field_Check; function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); begin Result := Character_Check (Character'Val (Ch), Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Char_Check; -- ----------------------------------------------------------------------- diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads index af45fab4..d7ae8943 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,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.13 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.14 $ +-- $Date: 2011/03/08 01:16:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -79,14 +79,14 @@ private function C_Generic_Type return C_Field_Type; function Generic_Field_Check (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Field_Check); -- This is the generic Field_Check_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivates. It routes -- the call to the Field_Check implementation for the type. function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Char_Check); -- This is the generic Char_Check_Function for the low-level fieldtype -- representing all the User_Defined_Field_Type derivates. It routes diff --git a/Ada95/src/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb index aef5d3c8..117f1a5a 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,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/08 01:16:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -177,7 +177,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end Wrap_Builtin; function Field_Check_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := To_Argument_Access (Usr); begin @@ -191,7 +191,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end Field_Check_Router; function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := To_Argument_Access (Usr); begin @@ -205,7 +205,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end Char_Check_Router; function Next_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := To_Argument_Access (Usr); begin @@ -219,7 +219,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end Next_Router; function Prev_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Arg : constant Argument_Access := To_Argument_Access (Usr); begin diff --git a/NEWS b/NEWS index 18a5c2d3..c211ade2 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.1654 2011/03/06 01:25:25 tom Exp $ +-- $Id: NEWS,v 1.1656 2011/03/08 01:14:45 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,16 @@ 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. +20110307 + + revert changes to limit-checks from 20110122 (Debian #616711). + > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + + corrected a minor sign error in a field of Low_Level_Field_Type, to + conform to form.h. + + replaced C_Int by Curses_Bool as return type for some callbacks, see + fieldtype(3FORM). + + modify samples/sample-explain.adb to provide explicit message when + explain.txt is not found. + 20110305 + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes diff --git a/dist.mk b/dist.mk index 7dc34c1b..527c4e1f 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.801 2011/03/05 15:31:36 tom Exp $ +# $Id: dist.mk,v 1.802 2011/03/07 21:54:44 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 = 20110305 +NCURSES_PATCH = 20110307 # 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_newwin.c b/ncurses/base/lib_newwin.c index 2b120eac..72d8af84 100644 --- a/ncurses/base/lib_newwin.c +++ b/ncurses/base/lib_newwin.c @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$Id: lib_newwin.c,v 1.68 2011/01/22 20:34:15 tom Exp $") +MODULE_ID("$Id: lib_newwin.c,v 1.69 2011/03/07 21:58:17 tom Exp $") #define window_is(name) ((sp)->_##name == win) @@ -141,7 +141,7 @@ NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns, begy, begx)); - if (begy < 0 || begx < 0 || num_lines <= 0 || num_columns <= 0) + if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0) returnWin(0); if (num_lines == 0) @@ -198,7 +198,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) /* * make sure window fits inside the original one */ - if (begy < 0 || begx < 0 || orig == 0 || num_lines <= 0 || num_columns <= 0) + if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0) returnWin(0); if (begy + num_lines > orig->_maxy + 1 || begx + num_columns > orig->_maxx + 1) -- 2.44.0