]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.8 - patch 20110305
authorThomas E. Dickey <dickey@invisible-island.net>
Mon, 7 Mar 2011 10:49:20 +0000 (10:49 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Mon, 7 Mar 2011 10:49:20 +0000 (10:49 +0000)
+ 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

Ada95/gen/gen.c
Ada95/samples/Makefile.in
Ada95/samples/sample-explanation.adb
Ada95/src/library.gpr
INSTALL
NEWS
dist.mk
ncurses/base/lib_slk.c

index 31391864d1b0f98e1fc66ef02279bf87ee39d78c..86d3b69748476865fdba05fabda165435c5b0d9f 100644 (file)
@@ -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.");
 }
index 3d1554c721119cafbcae9e930dea61c6fe75ddb2..0179fcf435fe140518b7346ee6be2b568cbd0a77 100644 (file)
@@ -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
index 3129dfd76a742b15d7ab4fa274db2e7306d8edf3..93c497c39b80fb74f69787abcf00853576eff722 100644 (file)
@@ -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;
index 62d67702b9c8ad4828435451f266dd31f70503a7..2396e2ce234a8ea689ebc52cfef7d19bf0d73656 100644 (file)
@@ -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 282c2a365436f50f0891cd40713c2f1c7632a590..167b228075b3f53988566020d14f16eeffcc7c09 100644 (file)
--- 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 55f3cc74c33f720c94047d01d589a2eb91603d7a..18a5c2d3fe2fc26ca43429e583e2a71b28dc8db0 100644 (file)
--- 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 1929e9707de1db1f2f3abf8e5e1d799e48fc835a..7dc34c1bff65ba21202138f3db1c34d977aa6ed2 100644 (file)
--- 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)
index 7a2eecd9e56dd14df926304c52e9a815696840f3..84f17ae03705d6af7dd575f296f79f4a095ad6b2 100644 (file)
@@ -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);
     }