diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-11-28 17:45:32 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-11-28 17:45:32 +0000 |
commit | 6a1dbf2ca7f6d392c63cfb7febcbfd18a8330bb7 (patch) | |
tree | de7172d517ed14abbe28ca52abe6b00124a4a099 | |
parent | c059a4d97895978b75eac3daae8186641e901e68 (diff) |
update to ncurses-5.0-19991127
-rw-r--r-- | lib/libcurses++/cursesapp.cc | 8 | ||||
-rw-r--r-- | lib/libcurses++/cursesf.cc | 20 | ||||
-rw-r--r-- | lib/libcurses++/cursesf.h | 10 | ||||
-rw-r--r-- | lib/libcurses++/cursesm.cc | 6 | ||||
-rw-r--r-- | lib/libcurses++/cursesm.h | 14 | ||||
-rw-r--r-- | lib/libcurses++/cursesp.cc | 6 | ||||
-rw-r--r-- | lib/libcurses++/cursesp.h | 38 | ||||
-rw-r--r-- | lib/libcurses++/cursespad.cc | 6 | ||||
-rw-r--r-- | lib/libcurses++/cursesw.cc | 35 | ||||
-rw-r--r-- | lib/libcurses++/cursesw.h | 44 | ||||
-rw-r--r-- | lib/libcurses++/demo.cc | 4 | ||||
-rw-r--r-- | lib/libcurses++/etip.h | 33 |
12 files changed, 142 insertions, 82 deletions
diff --git a/lib/libcurses++/cursesapp.cc b/lib/libcurses++/cursesapp.cc index ed56fe094e3..ced2f8e8a21 100644 --- a/lib/libcurses++/cursesapp.cc +++ b/lib/libcurses++/cursesapp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 "cursesapp.h" #include "internal.h" -MODULE_ID("$From: cursesapp.cc,v 1.4 1999/05/16 17:31:11 juergen Exp $") +MODULE_ID("$From: cursesapp.cc,v 1.6 1999/10/30 23:59:37 tom Exp $") void NCursesApplication::init(bool bColors) { @@ -85,7 +85,7 @@ int NCursesApplication::rinit(NCursesWindow& w) { void NCursesApplication::push(Soft_Label_Key_Set& S) { SLK_Link* L = new SLK_Link; - assert(L); + assert(L != 0); L->prev = slk_stack; L->SLKs = &S; slk_stack = L; @@ -121,7 +121,7 @@ int NCursesApplication::operator()(void) { Soft_Label_Key_Set::Label_Layout fmt = useSLKs(); if (fmt!=Soft_Label_Key_Set::None) { S = new Soft_Label_Key_Set(fmt); - assert(S); + assert(S != 0); init_labels(*S); } diff --git a/lib/libcurses++/cursesf.cc b/lib/libcurses++/cursesf.cc index db4d47788c7..1a88dbcab64 100644 --- a/lib/libcurses++/cursesf.cc +++ b/lib/libcurses++/cursesf.cc @@ -35,7 +35,7 @@ #include "cursesapp.h" #include "internal.h" -MODULE_ID("$From: cursesf.cc,v 1.9 1999/05/16 17:29:36 juergen Exp $") +MODULE_ID("$From: cursesf.cc,v 1.10 1999/10/30 23:49:28 tom Exp $") NCursesFormField::~NCursesFormField () { if (field) @@ -49,7 +49,7 @@ FIELD** NCursesForm::mapFields(NCursesFormField* nfields[]) { int fieldCount = 0,lcv; - assert(nfields); + assert(nfields != 0); for (lcv=0; nfields[lcv]->field; ++lcv) ++fieldCount; @@ -350,18 +350,18 @@ NCursesForm::virtualize(int c) { // bool UserDefinedFieldType::fcheck(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->field_check(*F); } bool UserDefinedFieldType::ccheck(int c, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType* udf = (UserDefinedFieldType*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->char_check(c); } @@ -379,19 +379,19 @@ FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = bool UserDefinedFieldType_With_Choice::next_choice(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType_With_Choice* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->next(*F); } bool UserDefinedFieldType_With_Choice::prev_choice(FIELD *f, const void *u) { NCursesFormField* F = (NCursesFormField*)u; - assert(F); + assert(F != 0); UserDefinedFieldType_With_Choice* udf = (UserDefinedFieldType_With_Choice*)(F->fieldtype()); - assert(udf); + assert(udf != 0); return udf->previous(*F); } diff --git a/lib/libcurses++/cursesf.h b/lib/libcurses++/cursesf.h index b5a3f27c315..ad977523cda 100644 --- a/lib/libcurses++/cursesf.h +++ b/lib/libcurses++/cursesf.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $From: cursesf.h,v 1.10 1999/05/16 17:31:42 juergen Exp $ +// $From: cursesf.h,v 1.11 1999/10/30 23:59:37 tom Exp $ #ifndef _CURSESF_H #define _CURSESF_H @@ -310,7 +310,7 @@ private: // Get the backward pointer to the C++ object from a FORM static inline NCursesForm* getHook(const FORM *f) { UserHook* hook = (UserHook*)::form_userptr(f); - assert(hook && hook->m_owner==f); + assert(hook != 0 && hook->m_owner==f); return (NCursesForm*)(hook->m_back); } @@ -329,13 +329,13 @@ protected: // internal routines inline void set_user(void *user) { UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr && uptr->m_back==this && uptr->m_owner==form); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); uptr->m_user = user; } inline void *get_user() { UserHook* uptr = (UserHook*)::form_userptr (form); - assert (uptr && uptr->m_back==this && uptr->m_owner==form); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); return uptr->m_user; } diff --git a/lib/libcurses++/cursesm.cc b/lib/libcurses++/cursesm.cc index eed888a43f8..5818c265ce3 100644 --- a/lib/libcurses++/cursesm.cc +++ b/lib/libcurses++/cursesm.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 "cursesapp.h" #include "internal.h" -MODULE_ID("$From: cursesm.cc,v 1.11 1999/07/31 09:45:23 juergen Exp $") +MODULE_ID("$From: cursesm.cc,v 1.12 1999/10/30 23:59:37 tom Exp $") NCursesMenuItem::~NCursesMenuItem() { if (item) @@ -304,7 +304,7 @@ NCursesMenu::operator()(void) { if (drvCmnd == CMD_ACTION) { if (options() & O_ONEVALUE) { NCursesMenuItem* itm = current_item(); - assert(itm); + assert(itm != 0); if (itm->options() & O_SELECTABLE) { b_action = itm->action(); diff --git a/lib/libcurses++/cursesm.h b/lib/libcurses++/cursesm.h index a24f5089693..91dc0149a29 100644 --- a/lib/libcurses++/cursesm.h +++ b/lib/libcurses++/cursesm.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $From: cursesm.h,v 1.12 1999/05/16 17:30:27 juergen Exp $ +// $From: cursesm.h,v 1.13 1999/10/30 23:59:37 tom Exp $ #ifndef _CURSESM_H #define _CURSESM_H @@ -137,10 +137,10 @@ typedef bool ITEMCALLBACK(NCursesMenuItem&); // function pointer for items. class NCursesMenuCallbackItem : public NCursesMenuItem { private: - const ITEMCALLBACK* p_fct; + ITEMCALLBACK* p_fct; public: - NCursesMenuCallbackItem(const ITEMCALLBACK* fct = NULL, + NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, const char* p_name = NULL, const char* p_descript = NULL ) : NCursesMenuItem (p_name, p_descript), @@ -179,7 +179,7 @@ private: // Get the backward pointer to the C++ object from a MENU static inline NCursesMenu* getHook(const MENU *m) { UserHook* hook = (UserHook*)::menu_userptr(m); - assert(hook && hook->m_owner==m); + assert(hook != 0 && hook->m_owner==m); return (NCursesMenu*)(hook->m_back); } @@ -198,13 +198,13 @@ protected: // internal routines inline void set_user(void *user) { UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr && uptr->m_back==this && uptr->m_owner==menu); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); uptr->m_user = user; } inline void *get_user() { UserHook* uptr = (UserHook*)::menu_userptr (menu); - assert (uptr && uptr->m_back==this && uptr->m_owner==menu); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); return uptr->m_user; } diff --git a/lib/libcurses++/cursesp.cc b/lib/libcurses++/cursesp.cc index cc78e32f3d2..2c5f5421056 100644 --- a/lib/libcurses++/cursesp.cc +++ b/lib/libcurses++/cursesp.cc @@ -1,6 +1,6 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 "cursesp.h" #include "internal.h" -MODULE_ID("$From: cursesp.cc,v 1.14 1999/05/16 17:30:51 juergen Exp $") +MODULE_ID("$From: cursesp.cc,v 1.15 1999/10/30 23:59:37 tom Exp $") NCursesPanel* NCursesPanel::dummy = (NCursesPanel*)0; @@ -52,7 +52,7 @@ void NCursesPanel::init() { NCursesPanel::~NCursesPanel() { UserHook* hook = (UserHook*)::panel_userptr(p); - assert(hook && hook->m_back==this && hook->m_owner==p); + assert(hook != 0 && hook->m_back==this && hook->m_owner==p); delete hook; ::del_panel(p); ::update_panels(); diff --git a/lib/libcurses++/cursesp.h b/lib/libcurses++/cursesp.h index e7a5c88c804..7c4350ccd03 100644 --- a/lib/libcurses++/cursesp.h +++ b/lib/libcurses++/cursesp.h @@ -1,8 +1,40 @@ // * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998,1999 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"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1997 * + ****************************************************************************/ + #ifndef _CURSESP_H #define _CURSESP_H -// $From: cursesp.h,v 1.11 1999/07/31 09:46:05 juergen Exp $ +// $From: cursesp.h,v 1.12 1999/10/31 00:00:02 tom Exp $ #include <cursesw.h> @@ -29,14 +61,14 @@ private: protected: void set_user(void *user) { UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr && uptr->m_back==this && uptr->m_owner==p); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); uptr->m_user = user; } // Set the user pointer of the panel. void *get_user() { UserHook* uptr = (UserHook*)::panel_userptr (p); - assert (uptr && uptr->m_back==this && uptr->m_owner==p); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); return uptr->m_user; } diff --git a/lib/libcurses++/cursespad.cc b/lib/libcurses++/cursespad.cc index 7667ade50be..ecd5719b989 100644 --- a/lib/libcurses++/cursespad.cc +++ b/lib/libcurses++/cursespad.cc @@ -35,7 +35,7 @@ #include "cursesw.h" #include "internal.h" -MODULE_ID("$From: cursespad.cc,v 1.1 1999/07/31 09:47:21 juergen Exp $") +MODULE_ID("$From: cursespad.cc,v 1.2 1999/09/11 23:25:54 tom Exp $") NCursesPad::NCursesPad(int lines, int cols) : NCursesWindow(), @@ -188,8 +188,8 @@ int NCursesPad::noutrefresh() { } void NCursesPad::setWindow(NCursesWindow& view, - int v_grid = 1, - int h_grid = 1) + int v_grid NCURSES_PARAM_INIT(1), + int h_grid NCURSES_PARAM_INIT(1)) { viewWin = &view; min_row = min_col = 0; diff --git a/lib/libcurses++/cursesw.cc b/lib/libcurses++/cursesw.cc index 98ad2844588..49662eaaf97 100644 --- a/lib/libcurses++/cursesw.cc +++ b/lib/libcurses++/cursesw.cc @@ -19,13 +19,13 @@ modified by Ulrich Drepper (drepper@karlsruhe.gmd.de) and Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) - modified by Juergen Pfeifer (juergen.pfeifer@gmx.net) + modified by Juergen Pfeifer (juergen.pfeifer@gmx.net) */ #include "cursesw.h" #include "internal.h" -MODULE_ID("$From: cursesw.cc,v 1.13 1999/07/31 09:46:30 juergen Exp $") +MODULE_ID("$From: cursesw.cc,v 1.16 1999/11/13 23:42:17 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -51,7 +51,7 @@ NCursesWindow::scanw(const char* fmt, ...) char buf[BUFSIZ]; int result = wgetstr(w, buf); if (result == OK) { - strstreambuf ss(buf, BUFSIZ); + strstreambuf ss(buf, sizeof(buf)); result = ss.vscan(fmt, (_IO_va_list)args); } va_end(args); @@ -73,7 +73,7 @@ NCursesWindow::scanw(int y, int x, const char* fmt, ...) if (result == OK) { result = wgetstr(w, buf); if (result == OK) { - strstreambuf ss(buf, BUFSIZ); + strstreambuf ss(buf, sizeof(buf)); result = ss.vscan(fmt, (_IO_va_list)args); } } @@ -144,7 +144,7 @@ NCursesWindow::initialize() { NCursesWindow::NCursesWindow() { if (!b_initialized) initialize(); - + w = (WINDOW *)0; init(); alloced = FALSE; @@ -172,7 +172,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window) { if (!b_initialized) initialize(); - + w = window; init(); alloced = FALSE; @@ -183,7 +183,7 @@ NCursesWindow::NCursesWindow(WINDOW* &window) NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c, int begin_y, int begin_x, char absrel) { - if (absrel == 'a') { // absolute origin + if (absrel == 'a') { // absolute origin begin_y -= win.begy(); begin_x -= win.begx(); } @@ -205,7 +205,8 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, int l, int c, count++; } -NCursesWindow::NCursesWindow(NCursesWindow& win, bool do_box = TRUE) +NCursesWindow::NCursesWindow(NCursesWindow& win, + bool do_box NCURSES_PARAM_INIT(TRUE)) { w = :: derwin(win.w,win.height()-2,win.width()-2,1,1); if (w == 0) { @@ -224,7 +225,7 @@ NCursesWindow::NCursesWindow(NCursesWindow& win, bool do_box = TRUE) win.touchwin(); } } - + NCursesWindow NCursesWindow::Clone() { WINDOW *d = ::dupwin(w); NCursesWindow W(d); @@ -343,7 +344,7 @@ int NCursesWindow::colorInitialized = COLORS_NOT_INITIALIZED; void NCursesWindow::useColors(void) { - if (colorInitialized == COLORS_NOT_INITIALIZED) { + if (colorInitialized == COLORS_NOT_INITIALIZED) { if (b_initialized) { if (::has_colors()) { ::start_color(); @@ -358,12 +359,12 @@ NCursesWindow::useColors(void) } short -NCursesWindow::getcolor(int getback) const +NCursesWindow::getcolor(int getback) const { short fore, back; if (colorInitialized==COLORS_ARE_REALLY_THERE) { - if (pair_content(PAIR_NUMBER(w->_attrs), &fore, &back)) + if (pair_content((short)PAIR_NUMBER(w->_attrs), &fore, &back)) err_handler("Can't get color pair"); } else { @@ -383,7 +384,7 @@ int NCursesWindow::NumberOfColors() } short -NCursesWindow::getcolor() const +NCursesWindow::getcolor() const { if (colorInitialized==COLORS_ARE_REALLY_THERE) return PAIR_NUMBER(w->_attrs); @@ -404,7 +405,7 @@ int NCursesWindow::setpalette(short fore, short back) { if (colorInitialized==COLORS_ARE_REALLY_THERE) - return setpalette(fore, back, PAIR_NUMBER(w->_attrs)); + return setpalette(fore, back, (short)PAIR_NUMBER(w->_attrs)); else return OK; } @@ -416,16 +417,18 @@ NCursesWindow::setcolor(short pair) if (colorInitialized==COLORS_ARE_REALLY_THERE) { if ((pair < 1) || (pair > COLOR_PAIRS)) err_handler("Can't set color pair"); - + attroff(A_COLOR); attrset(COLOR_PAIR(pair)); } return OK; } +#ifdef HAVE_HAS_KEY extern "C" int _nc_has_mouse(void); bool NCursesWindow::has_mouse() const { - return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse()) + return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse()) ? TRUE : FALSE); } +#endif diff --git a/lib/libcurses++/cursesw.h b/lib/libcurses++/cursesw.h index dcf863d8fa3..d42e4e8597c 100644 --- a/lib/libcurses++/cursesw.h +++ b/lib/libcurses++/cursesw.h @@ -2,7 +2,7 @@ #ifndef _CURSESW_H #define _CURSESW_H -// $From: cursesw.h,v 1.16 1999/07/31 09:46:43 juergen Exp $ +// $From: cursesw.h,v 1.18 1999/10/23 15:16:53 tom Exp $ #include <etip.h> #include <stdio.h> @@ -933,7 +933,7 @@ public: // position. int insch(int y, int x, chtype ch) { - return ::mvwinsch(w,y,x,ch); } + return ::mvwinsch(w,y,x,(char)ch); } // Move cursor to requested position and then insert the attributed // character before that position. @@ -958,10 +958,10 @@ public: int attron (chtype at) { return ::wattron (w, at); } // Switch on the window attributes; - int attroff(chtype at) { return ::wattroff(w, at); } + int attroff(chtype at) { return ::wattroff(w, (int) at); } // Switch off the window attributes; - int attrset(chtype at) { return ::wattrset(w, at); } + int attrset(chtype at) { return ::wattrset(w, (int) at); } // Set the window attributes; int color_set(short color_pair_number, void* opts=NULL) { @@ -1232,6 +1232,21 @@ public: useColors(); } }; +// These enum definitions really belong inside the NCursesPad class, but only +// recent compilers support that feature. + + typedef enum { + REQ_PAD_REFRESH = KEY_MAX + 1, + REQ_PAD_UP, + REQ_PAD_DOWN, + REQ_PAD_LEFT, + REQ_PAD_RIGHT, + REQ_PAD_EXIT + } Pad_Request; + + const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code + const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code + // ------------------------------------------------------------------------- // Pad Support. We allow an association of a pad with a "real" window // through which the pad may be viewed. @@ -1248,21 +1263,9 @@ protected: NCursesWindow* Win(void) const { // Get the window into which the pad should be copied (if any) - return (viewSub?viewSub:(viewWin?viewWin:NULL)); + return (viewSub?viewSub:(viewWin?viewWin:0)); } - typedef enum { - REQ_PAD_REFRESH = KEY_MAX + 1, - REQ_PAD_UP, - REQ_PAD_DOWN, - REQ_PAD_LEFT, - REQ_PAD_RIGHT, - REQ_PAD_EXIT - } Pad_Request; - - static const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code - static const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code - NCursesWindow* getWindow(void) const { return viewWin; } @@ -1341,9 +1344,6 @@ public: // will be framed (by a box() command) and the interior of the box is the // viewport subwindow. On the frame we display scrollbar sliders. class NCursesFramedPad : public NCursesPad { -private: - static const char* const msg = "Operation not allowed"; - protected: virtual void OnOperation(int pad_req); @@ -1361,12 +1361,12 @@ public: } void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { - err_handler(msg); + err_handler("Operation not allowed"); } // Disable this call; the viewport is already defined void setSubWindow(NCursesWindow& sub) { - err_handler(msg); + err_handler("Operation not allowed"); } // Disable this call; the viewport subwindow is already defined diff --git a/lib/libcurses++/demo.cc b/lib/libcurses++/demo.cc index 89f9601f988..cbd91a85e18 100644 --- a/lib/libcurses++/demo.cc +++ b/lib/libcurses++/demo.cc @@ -6,7 +6,7 @@ * Demo code for NCursesMenu and NCursesForm written by * Juergen Pfeifer <juergen.pfeifer@gmx.net> * - * $From: demo.cc,v 1.17 1999/07/31 09:47:17 juergen Exp $ + * $From: demo.cc,v 1.18 1999/09/11 18:57:54 tom Exp $ */ #include "cursesapp.h" @@ -333,7 +333,7 @@ private: NCursesPanel* P; NCursesMenuItem** I; UserData *u; - static const int n_items = 7; + #define n_items 7 public: MyMenu () diff --git a/lib/libcurses++/etip.h b/lib/libcurses++/etip.h index 2d824719db7..cce248dbac6 100644 --- a/lib/libcurses++/etip.h +++ b/lib/libcurses++/etip.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright (c) 1998,1999 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 <juergen.pfeifer@gmx.net> 1997 * ****************************************************************************/ -// $From: etip.h.in,v 1.10 1999/05/16 17:29:47 juergen Exp $ +// $From: etip.h.in,v 1.13 1999/09/12 02:01:59 tom Exp $ #ifndef _ETIP_H #define _ETIP_H @@ -41,6 +41,14 @@ # define HAVE_BUILTIN_H 0 #endif +#ifndef HAVE_GXX_BUILTIN_H +#define HAVE_GXX_BUILTIN_H 0 +#endif + +#ifndef HAVE_GPP_BUILTIN_H +#define HAVE_GPP_BUILTIN_H 0 +#endif + #ifndef HAVE_TYPEINFO # define HAVE_TYPEINFO 1 #endif @@ -57,6 +65,10 @@ #define ETIP_NEEDS_MATH_EXCEPTION 0 #endif +#ifndef CPP_HAS_PARAM_INIT +#define CPP_HAS_PARAM_INIT 0 +#endif + #ifdef __GNUG__ # if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) # if HAVE_TYPEINFO @@ -66,7 +78,7 @@ #endif #if defined(__GNUG__) -# if HAVE_BUILTIN_H +# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H # if ETIP_NEEDS_MATH_H # if ETIP_NEEDS_MATH_EXCEPTION # undef exception @@ -76,7 +88,13 @@ # endif # undef exception # define exception builtin_exception -# include <builtin.h> +# if HAVE_GPP_BUILTIN_H +# include <gpp/builtin.h> +# elif HAVE_GXX_BUILTIN_H +# include <g++/builtin.h> +# else +# include <builtin.h> +# endif # undef exception # endif #elif defined (__SUNPRO_CC) @@ -96,6 +114,13 @@ extern "C" { #include <errno.h> } +// Language features +#if CPP_HAS_PARAM_INIT +#define NCURSES_PARAM_INIT(value) = value +#else +#define NCURSES_PARAM_INIT(value) /*nothing*/ +#endif + // Forward Declarations class NCursesPanel; class NCursesMenu; |