From: Thomas E. Dickey Date: Sun, 25 Aug 2013 00:03:40 +0000 (+0000) Subject: ncurses 5.9 - patch 20130824 X-Git-Tag: v6.0~92 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=dff527f594001b2aed593868bd7774c86eec813d;hp=f886673eef3bcbe8ca4472530cfd606332e30364 ncurses 5.9 - patch 20130824 + fix some gcc 4.8 -Wconversion warnings. + change format of dpkg test-scripts to quilted to work around bug introduced by Debian #700177. + discard cached keyname() values if meta() is changed after a value was cached using (report by Kurban Mallachiev). --- diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 682f7101..c105c495 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2013 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.60 2011/04/30 19:47:19 Nicolas.Boulenguez Exp $ + $Id: gen.c,v 1.61 2013/08/24 23:30:46 tom Exp $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -246,49 +246,49 @@ gen_attr_set(const char *name) */ static const name_attribute_pair nap[] = { -#if A_STANDOUT +#ifdef A_STANDOUT {"Stand_Out", A_STANDOUT}, #endif -#if A_UNDERLINE +#ifdef A_UNDERLINE {"Under_Line", A_UNDERLINE}, #endif -#if A_REVERSE +#ifdef A_REVERSE {"Reverse_Video", A_REVERSE}, #endif -#if A_BLINK +#ifdef A_BLINK {"Blink", A_BLINK}, #endif -#if A_DIM +#ifdef A_DIM {"Dim_Character", A_DIM}, #endif -#if A_BOLD +#ifdef A_BOLD {"Bold_Character", A_BOLD}, #endif -#if A_ALTCHARSET +#ifdef A_ALTCHARSET {"Alternate_Character_Set", A_ALTCHARSET}, #endif -#if A_INVIS +#ifdef A_INVIS {"Invisible_Character", A_INVIS}, #endif -#if A_PROTECT +#ifdef A_PROTECT {"Protected_Character", A_PROTECT}, #endif -#if A_HORIZONTAL +#ifdef A_HORIZONTAL {"Horizontal", A_HORIZONTAL}, #endif -#if A_LEFT +#ifdef A_LEFT {"Left", A_LEFT}, #endif -#if A_LOW +#ifdef A_LOW {"Low", A_LOW}, #endif -#if A_RIGHT +#ifdef A_RIGHT {"Right", A_RIGHT}, #endif -#if A_TOP +#ifdef A_TOP {"Top", A_TOP}, #endif -#if A_VERTICAL +#ifdef A_VERTICAL {"Vertical", A_VERTICAL}, #endif {(char *)0, 0} diff --git a/Ada95/package/debian/source/format b/Ada95/package/debian/source/format index 89ae9db8..163aaf8d 100644 --- a/Ada95/package/debian/source/format +++ b/Ada95/package/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt) diff --git a/NEWS b/NEWS index 12f93357..ac14204e 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.2089 2013/08/17 21:17:42 tom Exp $ +-- $Id: NEWS,v 1.2093 2013/08/24 22:44:49 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. +20130824 + + fix some gcc 4.8 -Wconversion warnings. + + change format of dpkg test-scripts to quilted to work around bug + introduced by Debian #700177. + + discard cached keyname() values if meta() is changed after a value + was cached using (report by Kurban Mallachiev). + 20130816 + add checks in tic to warn about terminals which lack cursor addressing, capabilities or having those, are marked as hard_copy or diff --git a/dist.mk b/dist.mk index ba3e315b..f8689c13 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.941 2013/08/17 17:15:43 tom Exp $ +# $Id: dist.mk,v 1.942 2013/08/24 12:26:13 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 = 9 -NCURSES_PATCH = 20130816 +NCURSES_PATCH = 20130824 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/fld_max.c b/form/fld_max.c index aa685083..6c7fe728 100644 --- a/form/fld_max.c +++ b/form/fld_max.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 @@ #include "form.priv.h" -MODULE_ID("$Id: fld_max.c,v 1.12 2012/06/10 00:21:24 tom Exp $") +MODULE_ID("$Id: fld_max.c,v 1.13 2013/08/24 22:59:28 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -63,7 +63,7 @@ set_max_field(FIELD *field, int maxgrow) } field->maxgrow = maxgrow; ClrStatus(field, _MAY_GROW); - if (!(field->opts & O_STATIC)) + if (!((unsigned)field->opts & O_STATIC)) { if ((maxgrow == 0) || (single_line_field && (field->dcols < maxgrow)) || diff --git a/form/frm_data.c b/form/frm_data.c index 93917d5b..a936060d 100644 --- a/form/frm_data.c +++ b/form/frm_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2013 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 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_data.c,v 1.15 2010/01/23 21:14:36 tom Exp $") +MODULE_ID("$Id: frm_data.c,v 1.16 2013/08/24 22:44:05 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -103,7 +103,7 @@ Only_Padding(WINDOW *w, int len, int pad) } } #else - cell = winch(w); + cell = (FIELD_CELL) winch(w); if (ChCharOf(cell) != ChCharOf(pad)) { result = FALSE; diff --git a/form/frm_driver.c b/form/frm_driver.c index 9131edf5..d9204334 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.104 2013/06/22 20:02:55 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.106 2013/08/25 00:02:15 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -187,7 +187,7 @@ static int FE_Delete_Previous(FORM *); /* Macro to set the attributes for a fields window */ #define Set_Field_Window_Attributes(field,win) \ -( wbkgdset((win),(chtype)((field)->pad | (field)->back)), \ +( wbkgdset((win),(chtype)((chtype)((field)->pad) | (field)->back)), \ (void) wattrset((win), (int)(field)->fore) ) /* Logic to decide whether or not a field really appears on the form */ @@ -4397,8 +4397,8 @@ set_field_buffer(FIELD *field, int buffer, const char *value) { FIELD_CELL *p; int res = E_OK; - unsigned int i; - unsigned int len; + int i; + int len; #if USE_WIDEC_SUPPORT FIELD_CELL *widevalue = 0; @@ -4409,14 +4409,14 @@ set_field_buffer(FIELD *field, int buffer, const char *value) if (!field || !value || ((buffer < 0) || (buffer > field->nbuf))) RETURN(E_BAD_ARGUMENT); - len = (unsigned)Buffer_Length(field); + len = Buffer_Length(field); if (Growable(field)) { /* for a growable field we must assume zero terminated strings, because somehow we have to detect the length of what should be copied. */ - unsigned vlen = (unsigned)strlen(value); + int vlen = (int)strlen(value); if (vlen > len) { @@ -4446,7 +4446,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) delwin(field->working); field->working = newpad(1, Buffer_Length(field) + 1); } - len = (unsigned)Buffer_Length(field); + len = Buffer_Length(field); wclear(field->working); (void)mvwaddstr(field->working, 0, 0, value); @@ -4456,7 +4456,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value) } else { - for (i = 0; i < (unsigned)field->drows; ++i) + for (i = 0; i < field->drows; ++i) { (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols, widevalue + ((int)i * field->dcols), diff --git a/form/frm_opts.c b/form/frm_opts.c index a562c459..42d6267f 100644 --- a/form/frm_opts.c +++ b/form/frm_opts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_opts.c,v 1.16 2012/06/09 20:29:33 tom Exp $") +MODULE_ID("$Id: frm_opts.c,v 1.17 2013/08/24 22:58:47 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -50,7 +50,7 @@ set_form_opts(FORM *form, Form_Options opts) T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts)); opts &= (Form_Options) ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { @@ -71,7 +71,7 @@ NCURSES_EXPORT(Form_Options) form_opts(const FORM *form) { T((T_CALLED("form_opts(%p)"), (const void *)form)); - returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS)); + returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS)); } /*--------------------------------------------------------------------------- @@ -90,7 +90,7 @@ form_opts_on(FORM *form, Form_Options opts) T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); opts &= (Form_Options) ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { @@ -115,7 +115,7 @@ form_opts_off(FORM *form, Form_Options opts) T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts)); opts &= (Form_Options) ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { diff --git a/include/curses.h.in b/include/curses.h.in index 361711ca..cf6546f6 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.233 2012/09/16 21:05:02 tom Exp $ */ +/* $Id: curses.h.in,v 1.234 2013/08/24 22:48:56 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -1037,7 +1037,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* /* attributes */ #define NCURSES_ATTR_SHIFT 8 -#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) +#define NCURSES_BITS(mask,shift) (NCURSES_CAST(chtype,(mask)) << ((shift) + NCURSES_ATTR_SHIFT)) #define A_NORMAL (@cf_cv_1UL@ - @cf_cv_1UL@) #define A_ATTRIBUTES NCURSES_BITS(~(@cf_cv_1UL@ - @cf_cv_1UL@),0) diff --git a/ncurses/base/MKkeyname.awk b/ncurses/base/MKkeyname.awk index 40eee275..79016119 100644 --- a/ncurses/base/MKkeyname.awk +++ b/ncurses/base/MKkeyname.awk @@ -1,6 +1,6 @@ -# $Id: MKkeyname.awk,v 1.47 2012/02/22 22:35:41 tom Exp $ +# $Id: MKkeyname.awk,v 1.48 2013/08/24 17:37:22 tom Exp $ ############################################################################## -# Copyright (c) 1999-2010,2012 Free Software Foundation, Inc. # +# Copyright (c) 1999-2012,2013 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"), # @@ -65,6 +65,7 @@ END { print "" print "#define SIZEOF_TABLE 256" print "#define MyTable _nc_globals.keyname_table" + print "#define MyInit _nc_globals.init_keyname" print "" print "NCURSES_EXPORT(NCURSES_CONST char *)" print "safe_keyname (SCREEN *sp, int c)" @@ -96,12 +97,26 @@ END { print " if (result == 0 && (c >= 0 && c < SIZEOF_TABLE)) {" print " if (MyTable == 0)" print " MyTable = typeCalloc(char *, SIZEOF_TABLE);" + print "" print " if (MyTable != 0) {" + print " int m_prefix = (sp == 0 || sp->_use_meta);" + print "" + print " /* if sense of meta() changed, discard cached data */" + print " if (MyInit != (m_prefix + 1)) {" + print " MyInit = m_prefix + 1;" + print " for (i = 0; i < SIZEOF_TABLE; ++i) {" + print " if (MyTable[i]) {" + print " FreeAndNull(MyTable[i]);" + print " }" + print " }" + print " }" + print "" + print " /* create and cache result as needed */" print " if (MyTable[c] == 0) {" print " int cc = c;" print " p = name;" print "#define P_LIMIT (sizeof(name) - (size_t) (p - name))" - print " if (cc >= 128 && (sp == 0 || sp->_use_meta)) {" + print " if (cc >= 128 && m_prefix) {" print " _nc_STRCPY(p, \"M-\", P_LIMIT);" print " p += 2;" print " cc -= 128;" diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 281bb4b7..3627433b 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.523 2013/01/26 21:51:56 tom Exp $ + * $Id: curses.priv.h,v 1.525 2013/08/24 22:39:52 tom Exp $ * * curses.priv.h * @@ -835,6 +835,7 @@ typedef struct { char *first_name; char **keyname_table; + int init_keyname; int slk_format; @@ -1333,8 +1334,8 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch; #define UChar(c) ((unsigned char)(c)) #define UShort(c) ((unsigned short)(c)) -#define ChCharOf(c) ((c) & (chtype)A_CHARTEXT) -#define ChAttrOf(c) ((c) & (chtype)A_ATTRIBUTES) +#define ChCharOf(c) ((chtype)(c) & (chtype)A_CHARTEXT) +#define ChAttrOf(c) ((chtype)(c) & (chtype)A_ATTRIBUTES) #ifndef MB_LEN_MAX #define MB_LEN_MAX 8 /* should be >= MB_CUR_MAX, but that may be a function */ diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index a86b2ddf..06b6f880 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2013 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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.65 2012/08/25 18:38:43 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.66 2013/08/24 17:28:24 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -133,6 +133,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { NULL, /* first_name */ NULL, /* keyname_table */ + 0, /* init_keyname */ 0, /* slk_format */ diff --git a/package/debian/changelog b/package/debian/changelog index 3d2b8c3f..ee9821f6 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130816) unstable; urgency=low +ncurses6 (5.9-20130824) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 17 Aug 2013 13:15:43 -0400 + -- Thomas E. Dickey Sat, 24 Aug 2013 08:26:13 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/debian/source/format b/package/debian/source/format index 89ae9db8..163aaf8d 100644 --- a/package/debian/source/format +++ b/package/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt) diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index ea75336d..bb0f8d27 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Release: 5.9 -Version: 20130816 +Version: 20130824 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 0b7cf27b..dfff8974 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20130816 +Version: 20130824 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/progs/tic.c b/progs/tic.c index e1eb7e09..6ee17666 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -46,7 +46,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.187 2013/08/17 21:15:15 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.188 2013/08/24 21:48:21 tom Exp $") #define STDIN_NAME "" @@ -380,11 +380,11 @@ open_tempfile(char *filename) _nc_STRCPY(filename, "/tmp/XXXXXX", PATH_MAX); #if HAVE_MKSTEMP { - int oldmask = umask(077); + int oldmask = (int) umask(077); int fd = mkstemp(filename); if (fd >= 0) result = fdopen(fd, "w"); - umask(oldmask); + umask((mode_t) oldmask); } #else if (tmpnam(filename) != 0) diff --git a/test/package/debian/source/format b/test/package/debian/source/format index 89ae9db8..163aaf8d 100644 --- a/test/package/debian/source/format +++ b/test/package/debian/source/format @@ -1 +1 @@ -3.0 (native) +3.0 (quilt)