From a84fd46191c61f1151a7258e1539b89c395e61f9 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 1 Nov 2014 20:48:24 +0000 Subject: [PATCH] ncurses 5.9 - patch 20141101 + improve strict compiler-warnings by adding a cast in TRACE_RETURN and making a new TRACE_RETURN1 macro for cases where the cast does not apply. --- NEWS | 7 ++++++- dist.mk | 4 ++-- form/form.priv.h | 12 ++++++------ include/term_entry.h | 6 +++--- menu/menu.priv.h | 16 ++++++++-------- ncurses/base/lib_mouse.c | 8 ++++---- ncurses/base/lib_set_term.c | 8 ++++---- ncurses/curses.priv.h | 17 +++++++++-------- ncurses/tinfo/db_iterator.c | 6 +++--- ncurses/tinfo/lib_setup.c | 4 ++-- ncurses/tinfo/write_entry.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 +- panel/panel.priv.h | 8 +++++--- 18 files changed, 65 insertions(+), 57 deletions(-) diff --git a/NEWS b/NEWS index 72d730eb..bf9b1ae7 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.2293 2014/10/25 00:20:09 tom Exp $ +-- $Id: NEWS,v 1.2295 2014/11/01 13:57:28 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,11 @@ 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. +20141101 + + improve strict compiler-warnings by adding a cast in TRACE_RETURN + and making a new TRACE_RETURN1 macro for cases where the cast does + not apply. + 20141025 + in-progress changes to integrate the win32 console driver with the msys2 configuration. diff --git a/dist.mk b/dist.mk index f544bc08..b0ce115e 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.1012 2014/10/23 23:38:02 tom Exp $ +# $Id: dist.mk,v 1.1013 2014/10/27 10:16: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 = 20141025 +NCURSES_PATCH = 20141101 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/form.priv.h b/form/form.priv.h index 59f8eb19..4d1dfe7b 100644 --- a/form/form.priv.h +++ b/form/form.priv.h @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: form.priv.h,v 0.37 2014/07/27 00:21:42 tom Exp $ */ +/* $Id: form.priv.h,v 0.38 2014/11/01 13:56:14 tom Exp $ */ #ifndef FORM_PRIV_H #define FORM_PRIV_H 1 @@ -220,11 +220,11 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *); #ifdef TRACE -#define returnField(code) TRACE_RETURN(code,field) -#define returnFieldPtr(code) TRACE_RETURN(code,field_ptr) -#define returnForm(code) TRACE_RETURN(code,form) -#define returnFieldType(code) TRACE_RETURN(code,field_type) -#define returnFormHook(code) TRACE_RETURN(code,form_hook) +#define returnField(code) TRACE_RETURN1(code,field) +#define returnFieldPtr(code) TRACE_RETURN1(code,field_ptr) +#define returnForm(code) TRACE_RETURN1(code,form) +#define returnFieldType(code) TRACE_RETURN1(code,field_type) +#define returnFormHook(code) TRACE_RETURN1(code,form_hook) extern NCURSES_EXPORT(FIELD **) _nc_retrace_field_ptr (FIELD **); extern NCURSES_EXPORT(FIELD *) _nc_retrace_field (FIELD *); diff --git a/include/term_entry.h b/include/term_entry.h index f7c32c6c..b12710d3 100644 --- a/include/term_entry.h +++ b/include/term_entry.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 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 1998-on * ****************************************************************************/ -/* $Id: term_entry.h,v 1.44 2013/05/25 20:13:38 tom Exp $ */ +/* $Id: term_entry.h,v 1.45 2014/11/01 14:47:00 tom Exp $ */ /* * term_entry.h -- interface to entry-manipulation code @@ -170,7 +170,7 @@ extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool); extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); /* write_entry.c: writing an entry to the file system */ -extern NCURSES_EXPORT(void) _nc_set_writedir (char *); +extern NCURSES_EXPORT(void) _nc_set_writedir (const char *); extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const); /* comp_parse.c: entry list handling */ diff --git a/menu/menu.priv.h b/menu/menu.priv.h index 763ca4a6..b54b1952 100644 --- a/menu/menu.priv.h +++ b/menu/menu.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 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 * @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: menu.priv.h,v 1.24 2012/03/10 23:43:41 tom Exp $ */ +/* $Id: menu.priv.h,v 1.25 2014/11/01 14:47:00 tom Exp $ */ /*************************************************************************** * Module menu.priv.h * @@ -130,12 +130,12 @@ extern NCURSES_EXPORT(int) _nc_menu_cursor_pos (const MENU* menu, const ITEM* i #ifdef TRACE -#define returnItem(code) TRACE_RETURN(code,item) -#define returnItemPtr(code) TRACE_RETURN(code,item_ptr) -#define returnItemOpts(code) TRACE_RETURN(code,item_opts) -#define returnMenu(code) TRACE_RETURN(code,menu) -#define returnMenuHook(code) TRACE_RETURN(code,menu_hook) -#define returnMenuOpts(code) TRACE_RETURN(code,menu_opts) +#define returnItem(code) TRACE_RETURN1(code,item) +#define returnItemPtr(code) TRACE_RETURN1(code,item_ptr) +#define returnItemOpts(code) TRACE_RETURN1(code,item_opts) +#define returnMenu(code) TRACE_RETURN1(code,menu) +#define returnMenuHook(code) TRACE_RETURN1(code,menu_hook) +#define returnMenuOpts(code) TRACE_RETURN1(code,menu_opts) extern NCURSES_EXPORT(ITEM *) _nc_retrace_item (ITEM *); extern NCURSES_EXPORT(ITEM **) _nc_retrace_item_ptr (ITEM **); diff --git a/ncurses/base/lib_mouse.c b/ncurses/base/lib_mouse.c index 174df4b6..60bf488c 100644 --- a/ncurses/base/lib_mouse.c +++ b/ncurses/base/lib_mouse.c @@ -84,7 +84,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_mouse.c,v 1.164 2014/10/25 08:24:23 tom Exp $") +MODULE_ID("$Id: lib_mouse.c,v 1.165 2014/11/01 12:27:59 tom Exp $") #include @@ -446,8 +446,8 @@ allow_gpm_mouse(SCREEN *sp GCC_UNUSED) #endif /* GPM does printf's without checking if stdout is a terminal */ if (NC_ISATTY(fileno(stdout))) { - char *list = getenv("NCURSES_GPM_TERMS"); - char *env = getenv("TERM"); + const char *list = getenv("NCURSES_GPM_TERMS"); + const char *env = getenv("TERM"); if (list != 0) { if (env != 0) { result = _nc_name_match(list, env, "|:"); @@ -608,7 +608,7 @@ initialize_mousetype(SCREEN *sp) int rc; if (!sp->_emxmouse_buttons[0]) { - char *s = getenv("MOUSE_BUTTONS_123"); + const char *s = getenv("MOUSE_BUTTONS_123"); sp->_emxmouse_buttons[0] = 1; if (s && strlen(s) >= 3) { diff --git a/ncurses/base/lib_set_term.c b/ncurses/base/lib_set_term.c index c1cf134b..f2870ebb 100644 --- a/ncurses/base/lib_set_term.c +++ b/ncurses/base/lib_set_term.c @@ -47,7 +47,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_set_term.c,v 1.149 2014/03/08 20:32:59 tom Exp $") +MODULE_ID("$Id: lib_set_term.c,v 1.150 2014/11/01 12:30:47 tom Exp $") #ifdef USE_TERM_DRIVER #define MaxColors InfoOf(sp).maxcolors @@ -242,8 +242,8 @@ no_mouse_wrap(SCREEN *sp GCC_UNUSED) } #if NCURSES_EXT_FUNCS && USE_COLORFGBG -static char * -extract_fgbg(char *src, int *result) +static const char * +extract_fgbg(const char *src, int *result) { char *dst = 0; long value = strtol(src, &dst, 0); @@ -442,7 +442,7 @@ NCURSES_SP_NAME(_nc_setupscreen) ( * decide later if it is worth having default attributes as well. */ if (getenv("COLORFGBG") != 0) { - char *p = getenv("COLORFGBG"); + const char *p = getenv("COLORFGBG"); TR(TRACE_CHARPUT | TRACE_MOVE, ("decoding COLORFGBG %s", p)); p = extract_fgbg(p, &(sp->_default_fg)); p = extract_fgbg(p, &(sp->_default_bg)); diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index cd2c5e0e..66d15944 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.545 2014/10/24 23:57:28 tom Exp $ + * $Id: curses.priv.h,v 1.546 2014/11/01 13:52:34 tom Exp $ * * curses.priv.h * @@ -1625,7 +1625,8 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE #define TR(n, a) if (USE_TRACEF(n)) _nc_locked_tracef a #define T(a) TR(TRACE_CALLS, a) -#define TRACE_RETURN(value,type) return _nc_retrace_##type(value) +#define TRACE_RETURN(value,type) return _nc_retrace_##type((type)(value)) +#define TRACE_RETURN1(value,dst) return _nc_retrace_##dst(value) #define TRACE_RETURN2(value,dst,src) return _nc_retrace_##dst##_##src(value) #define TRACE_RETURN_SP(value,type) return _nc_retrace_##type(SP_PARM, value) @@ -1634,18 +1635,18 @@ extern NCURSES_EXPORT(void) _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE #define returnAttr(code) TRACE_RETURN(code,attr_t) #define returnBits(code) TRACE_RETURN(code,unsigned) #define returnBool(code) TRACE_RETURN(code,bool) -#define returnCPtr(code) TRACE_RETURN(code,cptr) -#define returnCVoidPtr(code) TRACE_RETURN(code,cvoid_ptr) +#define returnCPtr(code) TRACE_RETURN1(code,cptr) +#define returnCVoidPtr(code) TRACE_RETURN1(code,cvoid_ptr) #define returnChar(code) TRACE_RETURN(code,char) #define returnChtype(code) TRACE_RETURN(code,chtype) #define returnCode(code) TRACE_RETURN(code,int) #define returnIntAttr(code) TRACE_RETURN2(code,int,attr_t) #define returnMMask(code) TRACE_RETURN_SP(code,mmask_t) -#define returnPtr(code) TRACE_RETURN(code,ptr) -#define returnSP(code) TRACE_RETURN(code,sp) +#define returnPtr(code) TRACE_RETURN1(code,ptr) +#define returnSP(code) TRACE_RETURN1(code,sp) #define returnVoid T((T_RETURN(""))); return -#define returnVoidPtr(code) TRACE_RETURN(code,void_ptr) -#define returnWin(code) TRACE_RETURN(code,win) +#define returnVoidPtr(code) TRACE_RETURN1(code,void_ptr) +#define returnWin(code) TRACE_RETURN1(code,win) extern NCURSES_EXPORT(NCURSES_BOOL) _nc_retrace_bool (int); extern NCURSES_EXPORT(NCURSES_CONST void *) _nc_retrace_cvoid_ptr (NCURSES_CONST void *); diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index a14fb216..94a40820 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 2006-2013,2014 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 * @@ -43,7 +43,7 @@ #include #endif -MODULE_ID("$Id: db_iterator.c,v 1.38 2013/12/14 21:23:20 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.39 2014/11/01 14:47:00 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -187,7 +187,7 @@ _nc_tic_dir(const char *path) HaveTicDirectory = TRUE; } else if (HaveTicDirectory == 0) { if (use_terminfo_vars()) { - char *envp; + const char *envp; if ((envp = getenv("TERMINFO")) != 0) return _nc_tic_dir(envp); } diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 52292900..0b81a5e0 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.160 2014/04/26 18:47:20 juergen Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.161 2014/11/01 12:33:16 tom Exp $") /**************************************************************************** * @@ -574,7 +574,7 @@ NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL * termp) { const char *env_name = "NCURSES_NO_UTF8_ACS"; - char *env; + const char *env; int value; int result = 0; diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index 77f90cb5..b2edd5d9 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * + * Copyright (c) 1998-2013,2014 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 TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.91 2013/12/14 21:29:42 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.92 2014/11/01 14:47:00 tom Exp $") static int total_written; @@ -185,7 +185,7 @@ make_db_root(const char *path) * Set the write directory for compiled entries. */ NCURSES_EXPORT(void) -_nc_set_writedir(char *dir) +_nc_set_writedir(const char *dir) { const char *destination; char actual[PATH_MAX]; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 1c9dab77..66ac7dd1 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141025) unstable; urgency=low +ncurses6 (5.9-20141101) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Thu, 23 Oct 2014 19:38:02 -0400 + -- Thomas E. Dickey Mon, 27 Oct 2014 06:16:13 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 1c9dab77..66ac7dd1 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141025) unstable; urgency=low +ncurses6 (5.9-20141101) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Thu, 23 Oct 2014 19:38:02 -0400 + -- Thomas E. Dickey Mon, 27 Oct 2014 06:16:13 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 393fad2a..496ff8af 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20141025) unstable; urgency=low +ncurses6 (5.9-20141101) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Thu, 23 Oct 2014 19:38:02 -0400 + -- Thomas E. Dickey Mon, 27 Oct 2014 06:16:13 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index ec82c4a4..3d4b9e63 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.67 2014/10/23 23:38:02 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.68 2014/10/27 10:16:13 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "5" !define VERSION_MINOR "9" !define VERSION_YYYY "2014" -!define VERSION_MMDD "1025" +!define VERSION_MMDD "1101" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 65488c00..a76ee6af 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: 5.9 -Release: 20141025 +Release: 20141101 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index 44cbd97b..05c9159e 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 5.9 -Release: 20141025 +Release: 20141101 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/panel/panel.priv.h b/panel/panel.priv.h index 76607fb2..1156c72d 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 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 * @@ -26,10 +26,11 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.25 2012/12/15 23:57:43 tom Exp $ */ +/* $Id: panel.priv.h,v 1.26 2014/11/01 14:48:03 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 +/* *INDENT-OFF* */ #if HAVE_CONFIG_H # include @@ -60,7 +61,7 @@ struct screen; /* forward declaration */ # define USER_PTR(ptr) _nc_my_visbuf((const char *)ptr) # endif -# define returnPanel(code) TRACE_RETURN(code,panel) +# define returnPanel(code) TRACE_RETURN1(code,panel) extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *); extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*); @@ -210,5 +211,6 @@ struct screen; /* forward declaration */ /* These may become later renamed and part of panel.h and the public API */ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); #endif +/* *INDENT-ON* */ #endif /* NCURSES_PANEL_PRIV_H */ -- 2.44.0