aboutsummaryrefslogtreecommitdiff
path: root/c++
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
commitf0179cb6083cc92e5947ae56e6a0a5c5328aead0 (patch)
treebcee0ba9c2149b71f0bfc036df1e61e3105bf980 /c++
parentcea297eb34d2361e79529034397465068ae34ecd (diff)
downloadsrc-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.tar.gz
src-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.zip
Vendor import ncurses 6.1-20200118vendor/ncurses/6.1-20200118
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=357645 svn path=/vendor/ncurses/6.1-20200118/; revision=357646; tag=vendor/ncurses/6.1-20200118
Diffstat (limited to 'c++')
-rw-r--r--c++/Makefile.in31
-rw-r--r--c++/cursesapp.cc6
-rw-r--r--c++/cursesapp.h6
-rw-r--r--c++/cursesf.cc8
-rw-r--r--c++/cursesf.h26
-rw-r--r--c++/cursesm.cc12
-rw-r--r--c++/cursesm.h26
-rw-r--r--c++/cursesmain.cc6
-rw-r--r--c++/cursesp.cc6
-rw-r--r--c++/cursesp.h17
-rw-r--r--c++/cursesw.cc6
-rw-r--r--c++/cursesw.h24
-rw-r--r--c++/cursslk.cc6
-rw-r--r--c++/cursslk.h6
-rw-r--r--c++/demo.cc18
-rw-r--r--c++/etip.h.in31
-rw-r--r--c++/internal.h8
17 files changed, 134 insertions, 109 deletions
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 72ad0eb00615..c791283ea41c 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.106 2013/08/04 20:20:45 tom Exp $
+# $Id: Makefile.in,v 1.118 2018/08/12 00:06:34 tom Exp $
##############################################################################
-# Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2017,2018 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"), #
@@ -34,7 +34,7 @@
# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:
-SHELL = /bin/sh
+SHELL = @SHELL@
VPATH = @srcdir@
CF_MFLAGS = @cf_cv_makeflags@
@@ -44,6 +44,7 @@ o = .@OBJEXT@
MODEL = ../@DFT_OBJ_SUBDIR@
DESTDIR = @DESTDIR@
+top_srcdir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -54,7 +55,10 @@ includesubdir = @includesubdir@
INCLUDEDIR = $(DESTDIR)$(includedir)$(includesubdir)
+PACKAGE = @PACKAGE@
+
LIBTOOL = @LIBTOOL_CXX@
+LIBTOOL_OPTS = @LIBTOOL_OPTS@ @LIBTOOL_OPTS_CXX@
LIBTOOL_CLEAN = @LIB_CLEAN@
LIBTOOL_COMPILE = @LIB_COMPILE@
LIBTOOL_LINK = @LIB_LINK@
@@ -63,9 +67,10 @@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
LIBTOOL_VERSION = @LIBTOOL_VERSION@
LT_UNDEF = @LT_UNDEF@
-INSTALL = @INSTALL@
-INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
+INSTALL = @INSTALL@
+INSTALL_LIB = $(INSTALL) @INSTALL_LIB@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_OPT_P = @INSTALL_OPT_P@
AR = @AR@
ARFLAGS = @ARFLAGS@
@@ -83,7 +88,7 @@ CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@
CXXLIBS = @CXXLIBS@
INCDIR = ../include
-CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@
+CPPFLAGS = -DHAVE_CONFIG_H -I../c++ @CPPFLAGS@
CTAGS = @CTAGS@
ETAGS = @ETAGS@
@@ -108,17 +113,17 @@ LOCAL_LIBDIR = @top_builddir@/lib
LINK = @LINK_PROGS@ $(LIBTOOL_LINK) @CXXLDFLAGS@
SHLIB_DIRS = -L../lib
-SHLIB_LIST = $(SHLIB_DIRS) -lform@LIB_SUFFIX@ -lmenu@LIB_SUFFIX@ -lpanel@LIB_SUFFIX@ -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
+SHLIB_LIST = $(SHLIB_DIRS) -lform@USE_LIB_SUFFIX@ -lmenu@USE_LIB_SUFFIX@ -lpanel@USE_LIB_SUFFIX@ -lncurses@USE_LIB_SUFFIX@ @SHLIB_LIST@
LIBROOT = ncurses++
-LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la
-LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a
+LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@USE_LIB_SUFFIX@.la
+LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@USE_LIB_SUFFIX@.a
LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
LIBRARIES = @Libs_To_Make@
-LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@
+LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@USE_LIB_SUFFIX@
RPATH_LIST = @RPATH_LIST@
MK_SHARED_LIB = @MK_SHARED_LIB@
@@ -168,10 +173,10 @@ mostlyclean ::
-rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace
clean :: mostlyclean
- -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
+ -$(SHELL) -c "if test -n '$x' ; then $(MAKE) clean x=''; fi"
-rm -rf $(MODEL)/SunWS_cache
-$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) $(LIBRARIES) $(OBJS_DEMO)
- -rm -rf .libs
+ -rm -rf .libs *.dSYM
distclean :: clean
-rm -f Makefile
@@ -238,7 +243,7 @@ demo$x: $(OBJS_DEMO) \
etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh
cp $(srcdir)/etip.h.in $@
- sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
+ $(SHELL) $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
###############################################################################
# The remainder of this file is automatically generated during configuration
diff --git a/c++/cursesapp.cc b/c++/cursesapp.cc
index ddab6fdf9b9d..e1ffa7a47efe 100644
--- a/c++/cursesapp.cc
+++ b/c++/cursesapp.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2019 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,7 +35,7 @@
#include "internal.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursesapp.cc,v 1.15 2008/08/16 17:15:35 tom Exp $")
+MODULE_ID("$Id: cursesapp.cc,v 1.16 2019/07/28 19:55:27 tom Exp $")
void
NCursesApplication::init(bool bColors)
@@ -68,7 +68,7 @@ NCursesApplication* NCursesApplication::theApp = 0;
NCursesWindow* NCursesApplication::titleWindow = 0;
NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0;
-NCursesApplication::~NCursesApplication()
+NCursesApplication::~NCursesApplication() THROWS(NCursesException)
{
Soft_Label_Key_Set* S;
diff --git a/c++/cursesapp.h b/c++/cursesapp.h
index e3cbc04cc674..a3d0aaf3c360 100644
--- a/c++/cursesapp.h
+++ b/c++/cursesapp.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2019 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: cursesapp.h,v 1.12 2011/09/17 22:12:10 tom Exp $
+// $Id: cursesapp.h,v 1.13 2019/07/28 19:55:27 tom Exp $
#ifndef NCURSES_CURSESAPP_H_incl
#define NCURSES_CURSESAPP_H_incl
@@ -106,7 +106,7 @@ protected:
}
public:
- virtual ~NCursesApplication();
+ virtual ~NCursesApplication() THROWS(NCursesException);
// Get a pointer to the current application object
static NCursesApplication* getApplication() {
diff --git a/c++/cursesf.cc b/c++/cursesf.cc
index 7956054769f4..4a7ad838c367 100644
--- a/c++/cursesf.cc
+++ b/c++/cursesf.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2019 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,9 +35,9 @@
#include "cursesf.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursesf.cc,v 1.22 2011/09/17 22:12:10 tom Exp $")
+MODULE_ID("$Id: cursesf.cc,v 1.23 2019/07/28 19:55:27 tom Exp $")
-NCursesFormField::~NCursesFormField ()
+NCursesFormField::~NCursesFormField () THROWS(NCursesException)
{
if (field)
OnError(::free_field (field));
@@ -149,7 +149,7 @@ NCursesForm::InitForm(NCursesFormField* nfields[],
setDefaultAttributes();
}
-NCursesForm::~NCursesForm()
+NCursesForm::~NCursesForm() THROWS(NCursesException)
{
UserHook* hook = reinterpret_cast<UserHook*>(::form_userptr(form));
delete hook;
diff --git a/c++/cursesf.h b/c++/cursesf.h
index ef7054137205..19bdc8eba46d 100644
--- a/c++/cursesf.h
+++ b/c++/cursesf.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2019,2020 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: cursesf.h,v 1.31 2012/12/29 21:49:58 tom Exp $
+// $Id: cursesf.h,v 1.34 2020/01/18 17:02:13 tom Exp $
#ifndef NCURSES_CURSESF_H_incl
#define NCURSES_CURSESF_H_incl 1
@@ -47,7 +47,7 @@ extern "C" {
}
//
// -------------------------------------------------------------------------
-// The abstract base class for buitin and user defined Fieldtypes.
+// The abstract base class for builtin and user defined Fieldtypes.
// -------------------------------------------------------------------------
//
class NCURSES_IMPEXP NCursesFormField; // forward declaration
@@ -151,7 +151,7 @@ public:
{
}
- virtual ~NCursesFormField ();
+ virtual ~NCursesFormField () THROWS(NCursesException);
// Duplicate the field at a new position
inline NCursesFormField* dup(int first_row, int first_col)
@@ -470,7 +470,7 @@ public:
{
}
- virtual ~NCursesForm();
+ virtual ~NCursesForm() THROWS(NCursesException);
// Set the default attributes for the form
virtual void setDefaultAttributes();
@@ -645,7 +645,7 @@ public:
OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData)));
}
- virtual ~NCursesUserField() {};
+ virtual ~NCursesUserField() THROWS(NCursesException) {};
inline const T* UserData (void) const {
return reinterpret_cast<const T*>(::field_userptr (field));
@@ -673,7 +673,8 @@ protected:
const T* p_UserData = STATIC_CAST(T*)(0))
: NCursesForm(nlines,ncols,begin_y,begin_x) {
if (form)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>
+ (p_UserData)));
}
public:
@@ -683,7 +684,7 @@ public:
bool autoDelete_Fields=FALSE)
: NCursesForm (Fields, with_frame, autoDelete_Fields) {
if (form)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
};
NCursesUserForm (NCursesFormField* Fields[],
@@ -697,19 +698,20 @@ public:
: NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
with_frame, autoDelete_Fields) {
if (form)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>
+ (p_UserData)));
};
- virtual ~NCursesUserForm() {
+ virtual ~NCursesUserForm() THROWS(NCursesException) {
};
- inline T* UserData (void) const {
+ inline T* UserData (void) {
return reinterpret_cast<T*>(get_user ());
};
inline virtual void setUserData (const T* p_UserData) {
if (form)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
}
};
diff --git a/c++/cursesm.cc b/c++/cursesm.cc
index 222de46cd22e..64a38ffcea0b 100644
--- a/c++/cursesm.cc
+++ b/c++/cursesm.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2005,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2017,2019 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,9 +35,9 @@
#include "cursesm.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursesm.cc,v 1.23 2011/09/17 22:11:32 tom Exp $")
+MODULE_ID("$Id: cursesm.cc,v 1.25 2019/07/28 19:55:27 tom Exp $")
-NCursesMenuItem::~NCursesMenuItem()
+NCursesMenuItem::~NCursesMenuItem() THROWS(NCursesException)
{
if (item)
OnError(::free_item(item));
@@ -49,7 +49,7 @@ NCursesMenuItem::action()
return FALSE;
}
-NCursesMenuCallbackItem::~NCursesMenuCallbackItem()
+NCursesMenuCallbackItem::~NCursesMenuCallbackItem() THROWS(NCursesException)
{
}
@@ -175,13 +175,13 @@ NCursesMenu::setDefaultAttributes()
}
}
-NCursesMenu::~NCursesMenu()
+NCursesMenu::~NCursesMenu() THROWS(NCursesException)
{
UserHook* hook = reinterpret_cast<UserHook*>(::menu_userptr(menu));
delete hook;
if (b_sub_owner) {
- delete sub;
::set_menu_sub(menu, static_cast<WINDOW *>(0));
+ delete sub;
}
if (menu) {
ITEM** itms = ::menu_items(menu);
diff --git a/c++/cursesm.h b/c++/cursesm.h
index 259d107fb447..e207ceb1eb96 100644
--- a/c++/cursesm.h
+++ b/c++/cursesm.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2019,2020 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: cursesm.h,v 1.29 2012/12/29 21:48:33 tom Exp $
+// $Id: cursesm.h,v 1.32 2020/01/18 17:02:13 tom Exp $
#ifndef NCURSES_CURSESM_H_incl
#define NCURSES_CURSESM_H_incl 1
@@ -85,7 +85,7 @@ public:
(void) rhs;
}
- virtual ~NCursesMenuItem ();
+ virtual ~NCursesMenuItem () THROWS(NCursesException);
// Release the items memory
inline const char* name () const {
@@ -179,7 +179,7 @@ public:
{
}
- virtual ~NCursesMenuCallbackItem();
+ virtual ~NCursesMenuCallbackItem() THROWS(NCursesException);
bool action();
};
@@ -332,7 +332,7 @@ public:
{
}
- virtual ~NCursesMenu ();
+ virtual ~NCursesMenu () THROWS(NCursesException);
// Retrieve the menus subwindow
inline NCursesWindow& subWindow() const {
@@ -358,7 +358,7 @@ public:
flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu));
}
- // Get the numer of rows and columns for this menu
+ // Get the number of rows and columns for this menu
inline void scale (int& mrows, int& mcols) const {
OnError (::scale_menu (menu, &mrows, &mcols));
}
@@ -606,7 +606,7 @@ public:
OnError (::set_item_userptr (item, const_cast<void *>(reinterpret_cast<const void*>(p_UserData))));
}
- virtual ~NCursesUserItem() {}
+ virtual ~NCursesUserItem() THROWS(NCursesException) {}
inline const T* UserData (void) const {
return reinterpret_cast<const T*>(::item_userptr (item));
@@ -632,7 +632,7 @@ protected:
const T* p_UserData = STATIC_CAST(T*)(0))
: NCursesMenu(nlines,ncols,begin_y,begin_x) {
if (menu)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
}
public:
@@ -642,7 +642,7 @@ public:
bool autoDelete_Items=FALSE)
: NCursesMenu (Items, with_frame, autoDelete_Items) {
if (menu)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
};
NCursesUserMenu (NCursesMenuItem* Items[],
@@ -654,19 +654,19 @@ public:
bool with_frame=FALSE)
: NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
if (menu)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
};
- virtual ~NCursesUserMenu() {
+ virtual ~NCursesUserMenu() THROWS(NCursesException) {
};
- inline T* UserData (void) const {
+ inline T* UserData (void) {
return reinterpret_cast<T*>(get_user ());
};
inline virtual void setUserData (const T* p_UserData) {
if (menu)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
}
};
diff --git a/c++/cursesmain.cc b/c++/cursesmain.cc
index e87099504bdd..a376e5452528 100644
--- a/c++/cursesmain.cc
+++ b/c++/cursesmain.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2007,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2013,2019 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 @@
#define CPP_HAS_TRY_CATCH 0
#endif
-MODULE_ID("$Id: cursesmain.cc,v 1.15 2013/09/28 20:56:47 tom Exp $")
+MODULE_ID("$Id: cursesmain.cc,v 1.16 2019/12/14 22:48:23 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
@@ -87,7 +87,7 @@ int main(int argc, char* argv[])
#endif
#if NO_LEAKS
delete A;
- _nc_free_and_exit(res);
+ exit_curses(res);
#else
return(res);
#endif
diff --git a/c++/cursesp.cc b/c++/cursesp.cc
index 9c4eab6954ec..83b7cc906f91 100644
--- a/c++/cursesp.cc
+++ b/c++/cursesp.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2019 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 *
@@ -34,7 +34,7 @@
#include "internal.h"
#include "cursesp.h"
-MODULE_ID("$Id: cursesp.cc,v 1.25 2005/08/06 22:12:36 tom Exp $")
+MODULE_ID("$Id: cursesp.cc,v 1.26 2019/07/28 19:55:27 tom Exp $")
NCursesPanel* NCursesPanel::dummy = static_cast<NCursesPanel*>(0);
@@ -51,7 +51,7 @@ void NCursesPanel::init()
::set_panel_userptr(p, reinterpret_cast<void *>(hook));
}
-NCursesPanel::~NCursesPanel()
+NCursesPanel::~NCursesPanel() THROWS(NCursesException)
{
UserHook* hook = UserPointer();
assert(hook != 0 && hook->m_back==this && hook->m_owner==p);
diff --git a/c++/cursesp.h b/c++/cursesp.h
index 699ec284fcfd..82b373bf793c 100644
--- a/c++/cursesp.h
+++ b/c++/cursesp.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2008,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,2019 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 *
@@ -34,7 +34,7 @@
#ifndef NCURSES_CURSESP_H_incl
#define NCURSES_CURSESP_H_incl 1
-// $Id: cursesp.h,v 1.30 2012/12/29 21:50:55 tom Exp $
+// $Id: cursesp.h,v 1.32 2019/07/28 19:55:27 tom Exp $
#include <cursesw.h>
@@ -131,7 +131,7 @@ public:
{
}
- virtual ~NCursesPanel();
+ virtual ~NCursesPanel() THROWS(NCursesException);
// basic manipulation
inline void hide()
@@ -236,7 +236,8 @@ public:
: NCursesPanel (nlines, ncols, begin_y, begin_x)
{
if (p)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>
+ (p_UserData)));
};
// This creates an user panel of the requested size with associated
// user data pointed to by p_UserData.
@@ -244,14 +245,14 @@ public:
NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel()
{
if (p)
- set_user(const_cast<void *>(p_UserData));
+ set_user(const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
};
// This creates an user panel associated with the ::stdscr and user data
// pointed to by p_UserData.
- virtual ~NCursesUserPanel() {};
+ virtual ~NCursesUserPanel() THROWS(NCursesException) {};
- T* UserData (void) const
+ T* UserData (void)
{
return reinterpret_cast<T*>(get_user ());
};
@@ -260,7 +261,7 @@ public:
virtual void setUserData (const T* p_UserData)
{
if (p)
- set_user (const_cast<void *>(p_UserData));
+ set_user (const_cast<void *>(reinterpret_cast<const void*>(p_UserData)));
}
// Associate the user panel with the user data pointed to by p_UserData.
};
diff --git a/c++/cursesw.cc b/c++/cursesw.cc
index 16438770d47a..42e5bda98b54 100644
--- a/c++/cursesw.cc
+++ b/c++/cursesw.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 2007-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2014,2019 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 "internal.h"
#include "cursesw.h"
-MODULE_ID("$Id: cursesw.cc,v 1.54 2014/02/01 22:10:42 tom Exp $")
+MODULE_ID("$Id: cursesw.cc,v 1.55 2019/07/28 19:55:27 tom Exp $")
#define COLORS_NEED_INITIALIZATION -1
#define COLORS_NOT_INITIALIZED 0
@@ -344,7 +344,7 @@ NCursesWindow::kill_subwindows()
}
-NCursesWindow::~NCursesWindow()
+NCursesWindow::~NCursesWindow() THROWS(NCursesException)
{
kill_subwindows();
diff --git a/c++/cursesw.h b/c++/cursesw.h
index ca07b04237f5..a2ffe68cba6d 100644
--- a/c++/cursesw.h
+++ b/c++/cursesw.h
@@ -1,7 +1,7 @@
// * This makes emacs happy -*-Mode: C++;-*-
// vile:cppmode
/****************************************************************************
- * Copyright (c) 1998-2011,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2019,2020 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 *
@@ -31,14 +31,14 @@
#ifndef NCURSES_CURSESW_H_incl
#define NCURSES_CURSESW_H_incl 1
-// $Id: cursesw.h,v 1.50 2014/02/01 22:17:37 tom Exp $
-
-#include <etip.h>
+// $Id: cursesw.h,v 1.55 2020/01/18 17:02:13 tom Exp $
extern "C" {
# include <curses.h>
}
+#include <etip.h>
+
/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro.
Undefine it here, because NCursesWindow uses lines as a method. */
#undef lines
@@ -324,6 +324,12 @@ inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); }
#define intrflush UNDEF(intrflush)
#endif
+#ifdef is_linetouched
+inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); }
+#undef is_linetouched
+#define is_linetouched UNDEF(is_linetouched)
+#endif
+
#ifdef leaveok
inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); }
#undef leaveok
@@ -831,7 +837,7 @@ public:
{
}
- virtual ~NCursesWindow();
+ virtual ~NCursesWindow() THROWS(NCursesException);
NCursesWindow Clone();
// Make an exact copy of the window.
@@ -1241,7 +1247,7 @@ public:
// on the value of the changed flag.
bool is_linetouched(int line) const {
- return (::is_linetouched(w, line) ? TRUE:FALSE); }
+ return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); }
// Return TRUE if line is marked as changed, FALSE otherwise
bool is_wintouched() const {
@@ -1249,7 +1255,7 @@ public:
// Return TRUE if window is marked as changed, FALSE otherwise
int leaveok(bool bf) { return ::leaveok(w, bf); }
- // If bf is TRUE, curses will leave the cursor after an update whereever
+ // If bf is TRUE, curses will leave the cursor after an update wherever
// it is after the update.
int redrawln(int from, int n) { return ::wredrawln(w, from, n); }
@@ -1479,7 +1485,7 @@ public:
{
}
- virtual ~NCursesPad() {}
+ virtual ~NCursesPad() THROWS(NCursesException) {}
int echochar(const chtype ch) { return ::pechochar(w, ch); }
// Put the attributed character onto the pad and immediately do a
@@ -1540,7 +1546,7 @@ public:
}
// Construct the FramedPad with the given Window win as viewport.
- virtual ~NCursesFramedPad() {
+ virtual ~NCursesFramedPad() THROWS(NCursesException) {
delete getSubWindow();
}
diff --git a/c++/cursslk.cc b/c++/cursslk.cc
index 23785dfca828..ef393632de4e 100644
--- a/c++/cursslk.cc
+++ b/c++/cursslk.cc
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2005,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2019 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,7 +35,7 @@
#include "cursslk.h"
#include "cursesapp.h"
-MODULE_ID("$Id: cursslk.cc,v 1.16 2012/02/23 10:41:56 tom Exp $")
+MODULE_ID("$Id: cursslk.cc,v 1.17 2019/07/28 19:55:27 tom Exp $")
Soft_Label_Key_Set::Soft_Label_Key&
Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text)
@@ -88,7 +88,7 @@ Soft_Label_Key_Set::Soft_Label_Key_Set(Soft_Label_Key_Set::Label_Layout fmt)
init();
}
-Soft_Label_Key_Set::~Soft_Label_Key_Set() {
+Soft_Label_Key_Set::~Soft_Label_Key_Set() THROWS(NCursesException) {
if (!::isendwin())
clear();
delete[] slk_array;
diff --git a/c++/cursslk.h b/c++/cursslk.h
index 091695eef27a..c110a61cab4e 100644
--- a/c++/cursslk.h
+++ b/c++/cursslk.h
@@ -1,6 +1,6 @@
// * this is for making emacs happy: -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2019 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $
+// $Id: cursslk.h,v 1.14 2019/07/28 19:55:27 tom Exp $
#ifndef NCURSES_CURSSLK_H_incl
#define NCURSES_CURSSLK_H_incl
@@ -161,7 +161,7 @@ public:
init(); // allocate a new slk_array[]
}
- virtual ~Soft_Label_Key_Set();
+ virtual ~Soft_Label_Key_Set() THROWS(NCursesException);
// Get Label# i. Label counting starts with 1!
NCURSES_IMPEXP Soft_Label_Key& operator[](int i);
diff --git a/c++/demo.cc b/c++/demo.cc
index 8bcfb146420e..37e50c761fb7 100644
--- a/c++/demo.cc
+++ b/c++/demo.cc
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2018,2019 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,7 +35,7 @@
* Demo code for NCursesMenu and NCursesForm written by
* Juergen Pfeifer
*
- * $Id: demo.cc,v 1.41 2012/02/23 10:41:56 tom Exp $
+ * $Id: demo.cc,v 1.44 2019/07/28 19:55:27 tom Exp $
*/
#include "internal.h"
@@ -43,11 +43,11 @@
#include "cursesm.h"
#include "cursesf.h"
-#ifdef __MINGW32__
+#ifdef _WIN32
#undef KEY_EVENT
#endif
-#ifndef __MINGW32__
+#ifndef _WIN32
extern "C" unsigned int sleep(unsigned int);
#endif
@@ -176,7 +176,7 @@ public:
: NCursesUserItem<T>(p_name, static_cast<const char*>(0), p_UserData)
{}
- virtual ~MyAction() {}
+ virtual ~MyAction() THROWS(NCursesException) {}
bool action() {
SillyDemo a;
@@ -295,7 +295,7 @@ public:
{
}
- ~TestForm() {
+ ~TestForm() THROWS(NCursesException) {
delete mft;
delete ift;
delete eft;
@@ -320,7 +320,7 @@ public:
for(int i=1; i <= S->labels(); i++) {
char buf[8];
assert(i < 100);
- ::_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf)) "Frm%02d", i);
+ ::_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf)) "Frm%02d", i % 100);
(*S)[i] = buf; // Text
(*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification
}
@@ -473,7 +473,7 @@ public:
{
}
- ~MyMenu()
+ ~MyMenu() THROWS(NCursesException)
{
P->hide();
delete P;
@@ -540,7 +540,7 @@ void TestApplication::init_labels(Soft_Label_Key_Set& S) const
for(int i=1; i <= S.labels(); i++) {
char buf[8];
assert(i < 100);
- ::_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf)) "Key%02d", i);
+ ::_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf)) "Key%02d", i % 100);
S[i] = buf; // Text
S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification
}
diff --git a/c++/etip.h.in b/c++/etip.h.in
index 9f642ee6d000..222d0666698c 100644
--- a/c++/etip.h.in
+++ b/c++/etip.h.in
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2017,2018 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: etip.h.in,v 1.39 2012/12/29 21:50:44 tom Exp $
+// $Id: etip.h.in,v 1.42 2018/05/26 14:47:47 tom Exp $
#ifndef NCURSES_ETIP_H_incl
#define NCURSES_ETIP_H_incl 1
@@ -113,7 +113,7 @@
# include <generic.h>
#endif
-#include <ncurses_dll.h>
+#include <curses.h>
extern "C" {
#if HAVE_VALUES_H
@@ -330,7 +330,7 @@ public:
}
};
-#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC))
+#if !((defined(__GNUG__) && defined(__EXCEPTIONS) && (__GNUG__ < 7)) || defined(__SUNPRO_CC))
# if HAVE_IOSTREAM
# include <iostream>
# if IOSTREAM_NAMESPACE
@@ -347,15 +347,20 @@ inline void THROW(const NCursesException *e) {
#if defined(__GNUG__) && defined(__EXCEPTIONS)
# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8))
(*lib_error_handler)(e ? e->classname() : "", e ? e->message : "");
-#else
-#define CPP_HAS_TRY_CATCH 1
-#endif
+# elif (__GNUG__ >= 7)
+ // g++ 7.0 warns about deprecation, but lacks the predefined symbols
+ ::endwin();
+ std::cerr << "Found a problem - goodbye" << std::endl;
+ exit(EXIT_FAILURE);
+# else
+# define CPP_HAS_TRY_CATCH 1
+# endif
#elif defined(__SUNPRO_CC)
# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5)
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
-#else
-#define CPP_HAS_TRY_CATCH 1
-#endif
+# else
+# define CPP_HAS_TRY_CATCH 1
+# endif
#else
if (e)
cerr << e->message << endl;
@@ -372,9 +377,15 @@ inline void THROW(const NCursesException *e) {
throw *e;
#define NCURSES_CPP_TRY try
#define NCURSES_CPP_CATCH(e) catch(e)
+#if defined(__cpp_noexcept_function_type) && (__cpp_noexcept_function_type >= 201510)
+// C++17 deprecates the usage of throw().
+#define THROWS(s) /* nothing */
+#define THROW2(s,t) /* nothing */
+#else
#define THROWS(s) throw(s)
#define THROW2(s,t) throw(s,t)
#endif
+#endif
}
#endif /* NCURSES_ETIP_H_incl */
diff --git a/c++/internal.h b/c++/internal.h
index 1f6b4a676e52..70744a516376 100644
--- a/c++/internal.h
+++ b/c++/internal.h
@@ -1,6 +1,6 @@
// * This makes emacs happy -*-Mode: C++;-*-
/****************************************************************************
- * Copyright (c) 1998-2008,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2012,2018 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 *
@@ -31,7 +31,7 @@
* Author: Juergen Pfeifer, 1997 *
****************************************************************************/
-// $Id: internal.h,v 1.18 2012/02/23 10:41:56 tom Exp $
+// $Id: internal.h,v 1.19 2018/06/24 00:10:14 tom Exp $
#ifndef NCURSES_CPLUS_INTERNAL_H
#define NCURSES_CPLUS_INTERNAL_H 1
@@ -41,10 +41,10 @@
#if USE_RCS_IDS
#define MODULE_ID(id) static const char Ident[] = id;
#else
-#define MODULE_ID(id) /*nothing*/
+#define MODULE_ID(id) /*nothing */
#endif
-#ifdef __MINGW32__
+#ifdef _WIN32
#include <nc_mingw.h>
#undef KEY_EVENT
#endif