X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesp.h;h=9b63d6d671bfd6be7ad516a991c31a8f1db311f6;hp=adb54455a1472ea2e6898b0af1c99f00369adb38;hb=8b06e371ed1bce3dd6f37138e6becb5e1a562fe0;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/c++/cursesp.h b/c++/cursesp.h index adb54455..9b63d6d6 100644 --- a/c++/cursesp.h +++ b/c++/cursesp.h @@ -1,6 +1,6 @@ // * This makes emacs happy -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 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.26 2005/08/13 18:09:21 tom Exp $ +// $Id: cursesp.h,v 1.29 2008/08/16 17:20:23 tom Exp $ #include @@ -71,19 +71,22 @@ protected: void set_user(void *user) { UserHook* uptr = UserPointer(); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); - uptr->m_user = user; + if (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 = UserPointer(); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==p); - return uptr->m_user; + void *result = 0; + if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) + result = uptr->m_user; + return result; } - void OnError (int err) const THROWS((NCursesPanelException)) + void OnError (int err) const THROWS(NCursesPanelException) { if (err==ERR) THROW(new NCursesPanelException (this, err));