X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesw.cc;h=527bb7c40e4c39af6c539b7a3e3b6aaea603b999;hp=8a42c39bc48d119300a23ae6364bf851c6e9edfe;hb=aabbbcb7892fd946828a4170378b13b9d12435c6;hpb=82a087c4c47679fcfa59bb6d7bdbe587355ba3f6;ds=sidebyside diff --git a/c++/cursesw.cc b/c++/cursesw.cc index 8a42c39b..527bb7c4 100644 --- a/c++/cursesw.cc +++ b/c++/cursesw.cc @@ -42,7 +42,7 @@ #include "internal.h" #include "cursesw.h" -MODULE_ID("$Id: cursesw.cc,v 1.47 2007/03/03 21:49:24 tom Exp $") +MODULE_ID("$Id: cursesw.cc,v 1.48 2007/03/24 19:00:58 tom Exp $") #define COLORS_NEED_INITIALIZATION -1 #define COLORS_NOT_INITIALIZED 0 @@ -165,12 +165,17 @@ NCursesWindow::NCursesWindow(int nlines, int ncols, int begin_y, int begin_x) set_keyboard(); } -NCursesWindow::NCursesWindow(WINDOW* &window) +NCursesWindow::NCursesWindow(WINDOW* window) : w(0), alloced(FALSE), par(0), subwins(0), sib(0) { constructing(); - w = window; + // We used to use a reference on the "window" parameter, but we cannot do + // that with an opaque pointer (see NCURSES_OPAQUE). If the parameter was + // "::stdscr", that is first set via the "constructing() call, and is null + // up to that point. So we allow a null pointer here as meaning the "same" + // as "::stdscr". + w = window ? window : ::stdscr; set_keyboard(); }