Mercurial > octave
changeset 23796:4f12819a634f
Use C++11 nullptr rather than 0 in code (bug #51565).
* mk-opts.pl, BlockArray.cpp, KeyboardTranslator.cpp, Screen.cpp,
TerminalCharacterDecoder.cpp, TerminalView.cpp, Vt102Emulation.cpp, dialog.cc,
find-files-dialog.cc, file-editor-tab.cc, main-window.cc, ls-hdf5.cc,
oct-procbuf.h, oct-stream.cc, oct-tex-lexer.in.ll, zfstream.cc, ov-builtin.h,
ov-fcn-handle.cc, ov-typeinfo.h, ov-usr-fcn.h, options-usage.h, lex.ll,
oct-parse.in.yy, pt-loop.h, Array.cc, CSparse.cc, Sparse.h, dSparse.cc,
fCMatrix.cc, idx-vector.cc, idx-vector.h, sparse-chol.cc, cmd-edit.cc,
oct-sort.cc, main.in.cc:
Use C++11 nullptr rather than 0 in code (bug #51565).
line wrap: on
line diff
--- a/build-aux/mk-opts.pl Tue Jul 25 14:54:10 2017 -0700 +++ b/build-aux/mk-opts.pl Wed Jul 26 16:26:31 2017 -0700 @@ -582,7 +582,7 @@ if ($empty) { - print " { 0,\n"; + print " { nullptr,\n"; } else { @@ -595,7 +595,7 @@ { if ($empty or $k > $n) { - print " 0,"; + print " nullptr,"; } else {
--- a/libgui/qterminal/libqterminal/unix/BlockArray.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/BlockArray.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -40,9 +40,9 @@ : size(0), current(size_t(-1)), index(size_t(-1)), - lastmap(0), + lastmap(nullptr), lastmap_index(size_t(-1)), - lastblock(0), ion(-1), + lastblock(nullptr), ion(-1), length(0) { // lastmap_index = index = current = size_t(-1); @@ -128,9 +128,9 @@ assert(j < size); unmap(); - Block *block = (Block*)mmap(0, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize); + Block *block = (Block*)mmap(nullptr, blocksize, PROT_READ, MAP_PRIVATE, ion, j * blocksize); - if (block == (Block*)-1) { perror("mmap"); return 0; } + if (block == (Block*)-1) { perror("mmap"); return nullptr; } lastmap = block; lastmap_index = i;
--- a/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/KeyboardTranslator.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -653,7 +653,7 @@ if ( replacement == 'x' ) { - result.replace(i,1,"\\x"+QByteArray::number(QByteArray(1,ch).toInt(0, 16))); + result.replace(i,1,"\\x"+QByteArray::number(QByteArray(1,ch).toInt(nullptr, 16))); } else if ( replacement != 0 ) { result.remove(i,1);
--- a/libgui/qterminal/libqterminal/unix/Screen.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/Screen.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -74,7 +74,7 @@ cuX(0), cuY(0), cu_re(0), tmargin(0), bmargin(0), - tabstops(0), + tabstops(nullptr), sel_begin(0), sel_TL(0), sel_BR(0), sel_busy(false), columnmode(false),
--- a/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/TerminalCharacterDecoder.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -47,7 +47,7 @@ } void PlainTextDecoder::end() { - _output = 0; + _output = nullptr; } void PlainTextDecoder::decodeLine(const Character* const characters, int count, LineProperty /*properties*/ )
--- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -237,9 +237,9 @@ TerminalView::TerminalView(QWidget *parent) :QWidget(parent) - ,_screenWindow(0) + ,_screenWindow(nullptr) ,_allowBell(true) - ,_gridLayout(0) + ,_gridLayout(nullptr) ,_fontHeight(1) ,_fontWidth(1) ,_fontAscent(1) @@ -249,7 +249,7 @@ ,_usedColumns(1) ,_contentHeight(1) ,_contentWidth(1) - ,_image(0) + ,_image(nullptr) ,_randomSeed(0) ,_resizing(false) ,_terminalSizeHint(false) @@ -269,9 +269,9 @@ ,_tripleClickMode(SelectWholeLine) ,_isFixedSize(false) ,_possibleTripleClick(false) - ,_resizeWidget(0) - ,_resizeTimer(0) - ,_outputSuspendedLabel(0) + ,_resizeWidget(nullptr) + ,_resizeTimer(nullptr) + ,_outputSuspendedLabel(nullptr) ,_lineSpacing(0) ,_colorsInverted(false) ,_blendColor(qRgba(0,0,0,0xff))
--- a/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp Wed Jul 26 16:26:31 2017 -0700 @@ -1213,8 +1213,8 @@ { KeyboardTranslator::Entry entry = _keyTranslator->findEntry( Qt::Key_Backspace, - 0, - 0); + nullptr, + nullptr); if ( entry.text().count() > 0 ) return entry.text()[0]; else
--- a/libgui/src/dialog.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/src/dialog.cc Wed Jul 26 16:26:31 2017 -0700 @@ -134,7 +134,7 @@ const QString& defbutton, const QStringList& role) : QMessageBox (QMessageBox::NoIcon, title.isEmpty () ? " " : title, - message, 0, nullptr) + message, nullptr, nullptr) { // Create a NonModal message. setWindowModality (Qt::NonModal);
--- a/libgui/src/find-files-dialog.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/src/find-files-dialog.cc Wed Jul 26 16:26:31 2017 -0700 @@ -52,7 +52,7 @@ setWindowTitle (tr ("Find Files")); setWindowIcon (resource_manager::icon ("edit-find")); - _dir_iterator = 0; + _dir_iterator = nullptr; _timer = new QTimer (this); connect (_timer, SIGNAL (timeout ()), this, SLOT (look_for_files ()));
--- a/libgui/src/m-editor/file-editor-tab.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/src/m-editor/file-editor-tab.cc Wed Jul 26 16:26:31 2017 -0700 @@ -487,7 +487,7 @@ bool retval = true; if (_edit_area->isModified ()) { - int ans = QMessageBox::question (0, tr ("Octave Editor"), + int ans = QMessageBox::question (nullptr, tr ("Octave Editor"), tr ("Cannot add breakpoint to modified file.\n" "Save and add breakpoint, or cancel?"), QMessageBox::Save | QMessageBox::Cancel, QMessageBox::Save); @@ -752,7 +752,7 @@ } // disconnect slot for saving prepared info if already connected - disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), 0, 0); + disconnect (_lexer_apis, SIGNAL (apiPreparationFinished ()), nullptr, nullptr); // check whether path for prepared info exists or can be created if (QDir ("/").mkpath (prep_apis_path)) { @@ -1853,7 +1853,7 @@ { if (names(i).string_value () == base_name) { - int ans = QMessageBox::question (0, tr ("Debug or Save"), + int ans = QMessageBox::question (nullptr, tr ("Debug or Save"), tr ("This file is currently being executed.\n" "Quit debugging and save?"), QMessageBox::Save | QMessageBox::Cancel); @@ -1931,7 +1931,7 @@ tr ("Octave Editor"), tr ("Could not open file %1 for write:\n%2."). arg (file_to_save).arg (file.errorString ()), - QMessageBox::Ok, 0); + QMessageBox::Ok, nullptr); show_dialog (msgBox, false); return; @@ -2143,7 +2143,7 @@ if ((file.suffix () == "m") && (! valid_identifier (base_name.toStdString ()))) { - int ans = QMessageBox::question (0, tr ("Octave Editor"), + int ans = QMessageBox::question (nullptr, tr ("Octave Editor"), tr ("\"%1\"\n" "is not a valid identifier.\n\n" "If you keep this filename, you will not be able to\n" @@ -2163,7 +2163,7 @@ { if (! codec->canEncode (_edit_area->text ())) { - int ans = QMessageBox::warning (0, + int ans = QMessageBox::warning (nullptr, tr ("Octave Editor"), tr ("The current editor contents can not be encoded\n" "with the selected codec %1.\n" @@ -2285,7 +2285,7 @@ "%1\n" "has been deleted or renamed. Do you want to save it now?%2"). arg (_file_name).arg (modified), - QMessageBox::Save | QMessageBox::Close, 0); + QMessageBox::Save | QMessageBox::Close, nullptr); _edit_area->setReadOnly (true); @@ -2378,7 +2378,7 @@ else { _edit_area->setMarginLineNumbers (2, false); - disconnect (_edit_area, SIGNAL (linesChanged ()), 0, 0); + disconnect (_edit_area, SIGNAL (linesChanged ()), nullptr, nullptr); } _smart_indent = settings->value ("editor/auto_indent",true).toBool ();
--- a/libgui/src/main-window.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libgui/src/main-window.cc Wed Jul 26 16:26:31 2017 -0700 @@ -183,7 +183,7 @@ bool connect_to_web = true; QDateTime last_checked; int serial = 0; - _active_dock = 0; + _active_dock = nullptr; if (settings) {
--- a/libinterp/corefcn/ls-hdf5.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/corefcn/ls-hdf5.cc Wed Jul 26 16:26:31 2017 -0700 @@ -235,10 +235,10 @@ #if defined (HAVE_HDF5_18) H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); - H5Eset_auto (octave_H5E_DEFAULT, 0, nullptr); + H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else H5Eget_auto (&err_func, &err_func_data); - H5Eset_auto (0, nullptr); + H5Eset_auto (nullptr, nullptr); #endif hid_t attr_id = H5Aopen_name (loc_id, attr_name); @@ -283,10 +283,10 @@ #if defined (HAVE_HDF5_18) H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); - H5Eset_auto (octave_H5E_DEFAULT, 0, nullptr); + H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else H5Eget_auto (&err_func, &err_func_data); - H5Eset_auto (0, nullptr); + H5Eset_auto (nullptr, nullptr); #endif hid_t attr_id = H5Aopen_name (loc_id, attr_name);
--- a/libinterp/corefcn/oct-procbuf.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/corefcn/oct-procbuf.h Wed Jul 26 16:26:31 2017 -0700 @@ -38,11 +38,11 @@ public: octave_procbuf (void) - : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1), + : c_file_ptr_buf (nullptr), wstatus (-1), open_p (false), proc_pid (-1), next (nullptr) { } octave_procbuf (const char *command, int mode) - : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1), + : c_file_ptr_buf (nullptr), wstatus (-1), open_p (false), proc_pid (-1), next (nullptr) { open (command, mode); } // No copying!
--- a/libinterp/corefcn/oct-stream.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/corefcn/oct-stream.cc Wed Jul 26 16:26:31 2017 -0700 @@ -318,7 +318,7 @@ const scanf_format_elt * next (bool cycle = true) { static scanf_format_elt dummy - (0, 0, false, scanf_format_elt::null, '\0', ""); + (nullptr, 0, false, scanf_format_elt::null, '\0', ""); curr_idx++;
--- a/libinterp/corefcn/oct-tex-lexer.in.ll Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/corefcn/oct-tex-lexer.in.ll Wed Jul 26 16:26:31 2017 -0700 @@ -35,6 +35,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" #endif // Define away the deprecated register storage class specifier to avoid @@ -220,7 +221,7 @@ { octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state), scanner); - buffer_state = 0; + buffer_state = nullptr; } buffer_state = octave_tex__scan_bytes (s.data (), s.length (), scanner); @@ -236,12 +237,12 @@ { octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state), scanner); - buffer_state = 0; + buffer_state = nullptr; } if (scanner) { octave_tex_lex_destroy (scanner); - scanner = 0; + scanner = nullptr; } }
--- a/libinterp/corefcn/zfstream.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/corefcn/zfstream.cc Wed Jul 26 16:26:31 2017 -0700 @@ -416,7 +416,7 @@ buffer = new char_type [buffer_size]; this->setg (buffer, buffer, buffer); // "Unbuffered" means no put buffer - this->setp (0, 0); + this->setp (nullptr, nullptr); } } else @@ -440,8 +440,8 @@ buffer_size = 0; delete[] buffer; buffer = nullptr; - this->setg (0, 0, 0); - this->setp (0, 0); + this->setg (nullptr, nullptr, nullptr); + this->setp (nullptr, nullptr); } else { @@ -450,7 +450,7 @@ if (buffer) this->setp (buffer, buffer + buffer_size - 1); else - this->setp (0, 0); + this->setp (nullptr, nullptr); } }
--- a/libinterp/octave-value/ov-builtin.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/octave-value/ov-builtin.h Wed Jul 26 16:26:31 2017 -0700 @@ -50,7 +50,7 @@ { public: - octave_builtin (void) : octave_function (), f (0), file (), jtype (nullptr) { } + octave_builtin (void) : octave_function (), f (nullptr), file (), jtype (nullptr) { } typedef octave_value_list (*meth) (octave::interpreter&, const octave_value_list&, int); @@ -59,19 +59,19 @@ octave_builtin (fcn ff, const std::string& nm = "", const std::string& ds = "") - : octave_function (nm, ds), f (ff), m (0), file (), jtype (nullptr) { } + : octave_function (nm, ds), f (ff), m (nullptr), file (), jtype (nullptr) { } octave_builtin (meth mm, const std::string& nm = "", const std::string& ds = "") - : octave_function (nm, ds), f (0), m (mm), file (), jtype (nullptr) { } + : octave_function (nm, ds), f (nullptr), m (mm), file (), jtype (nullptr) { } octave_builtin (fcn ff, const std::string& nm, const std::string& fnm, const std::string& ds) - : octave_function (nm, ds), f (ff), m (0), file (fnm), jtype (nullptr) { } + : octave_function (nm, ds), f (ff), m (nullptr), file (fnm), jtype (nullptr) { } octave_builtin (meth mm, const std::string& nm, const std::string& fnm, const std::string& ds) - : octave_function (nm, ds), f (0), m (mm), file (fnm), jtype (nullptr) { } + : octave_function (nm, ds), f (nullptr), m (mm), file (fnm), jtype (nullptr) { } // No copying!
--- a/libinterp/octave-value/ov-fcn-handle.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/octave-value/ov-fcn-handle.cc Wed Jul 26 16:26:31 2017 -0700 @@ -1123,10 +1123,10 @@ // reporting function: #if defined (HAVE_HDF5_18) H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); - H5Eset_auto (octave_H5E_DEFAULT, 0, nullptr); + H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else H5Eget_auto (&err_func, &err_func_data); - H5Eset_auto (0, nullptr); + H5Eset_auto (nullptr, nullptr); #endif hid_t attr_id = H5Aopen_name (group_hid, "SYMBOL_TABLE"); @@ -1239,10 +1239,10 @@ // reporting function: #if defined (HAVE_HDF5_18) H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); - H5Eset_auto (octave_H5E_DEFAULT, 0, nullptr); + H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else H5Eget_auto (&err_func, &err_func_data); - H5Eset_auto (0, nullptr); + H5Eset_auto (nullptr, nullptr); #endif hid_t attr_id = H5Aopen_name (group_hid, "OCTAVEROOT");
--- a/libinterp/octave-value/ov-typeinfo.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/octave-value/ov-typeinfo.h Wed Jul 26 16:26:31 2017 -0700 @@ -193,16 +193,16 @@ octave_value_typeinfo (void) : num_types (0), types (dim_vector (init_tab_sz, 1), ""), vals (dim_vector (init_tab_sz, 1)), - unary_class_ops (dim_vector (octave_value::num_unary_ops, 1), 0), - unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), 0), - non_const_unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), 0), - binary_class_ops (dim_vector (octave_value::num_binary_ops, 1), 0), - binary_ops (dim_vector (octave_value::num_binary_ops, init_tab_sz, init_tab_sz), 0), - compound_binary_class_ops (dim_vector (octave_value::num_compound_binary_ops, 1), 0), - compound_binary_ops (dim_vector (octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), 0), - cat_ops (dim_vector (init_tab_sz, init_tab_sz), 0), - assign_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz, init_tab_sz), 0), - assignany_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz), 0), + unary_class_ops (dim_vector (octave_value::num_unary_ops, 1), nullptr), + unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), + non_const_unary_ops (dim_vector (octave_value::num_unary_ops, init_tab_sz), nullptr), + binary_class_ops (dim_vector (octave_value::num_binary_ops, 1), nullptr), + binary_ops (dim_vector (octave_value::num_binary_ops, init_tab_sz, init_tab_sz), nullptr), + compound_binary_class_ops (dim_vector (octave_value::num_compound_binary_ops, 1), nullptr), + compound_binary_ops (dim_vector (octave_value::num_compound_binary_ops, init_tab_sz, init_tab_sz), nullptr), + cat_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr), + assign_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz, init_tab_sz), nullptr), + assignany_ops (dim_vector (octave_value::num_assign_ops, init_tab_sz), nullptr), pref_assign_conv (dim_vector (init_tab_sz, init_tab_sz), -1), widening_ops (dim_vector (init_tab_sz, init_tab_sz), nullptr) { }
--- a/libinterp/octave-value/ov-usr-fcn.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/octave-value/ov-usr-fcn.h Wed Jul 26 16:26:31 2017 -0700 @@ -62,7 +62,7 @@ octave_user_code (const std::string& nm, const std::string& ds = "") - : octave_function (nm, ds), curr_unwind_protect_frame (0), + : octave_function (nm, ds), curr_unwind_protect_frame (nullptr), m_file_info (nullptr) { }
--- a/libinterp/options-usage.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/options-usage.h Wed Jul 26 16:26:31 2017 -0700 @@ -46,6 +46,13 @@ // to prevent getopt from permuting arguments! static const char *short_opts = "+HWVdfhip:qvx"; + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +// Disable warning temporarily +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" +#endif + // Long options. See the comments in getopt.h for the meanings of the // fields in this structure. #define BUILT_IN_DOCSTRINGS_FILE_OPTION 1 @@ -104,6 +111,11 @@ { 0, 0, 0, 0 } }; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +// Restore prevailing warning state for remainder of the file. +#pragma GCC diagnostic pop +#endif + // Usage message with extra help. static void
--- a/libinterp/parse-tree/lex.ll Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/parse-tree/lex.ll Wed Jul 26 16:26:31 2017 -0700 @@ -46,6 +46,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" #pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif // Define away the deprecated register storage class specifier to avoid @@ -1973,7 +1975,7 @@ // keywords. Likewise for "enumeration", "events", "methods", and // "properties". - return (octave_kw_hash::in_word_set (s.c_str (), s.length ()) != 0 + return (octave_kw_hash::in_word_set (s.c_str (), s.length ()) != nullptr && ! (s == "set" || s == "get" || s == "enumeration" || s == "events" || s == "methods" || s == "properties")); @@ -2121,7 +2123,7 @@ { size_t sz = size (); - return sz > 1 ? frame_stack[1] : (sz == 1 ? frame_stack[0] : 0); + return sz > 1 ? frame_stack[1] : (sz == 1 ? frame_stack[0] : nullptr); } lexical_feedback::~lexical_feedback (void) @@ -2553,7 +2555,7 @@ // May be reset to true for some token types. at_beginning_of_statement = false; - token *tok_val = 0; + token *tok_val = nullptr; switch (kw->kw_id) {
--- a/libinterp/parse-tree/oct-parse.in.yy Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/parse-tree/oct-parse.in.yy Wed Jul 26 16:26:31 2017 -0700 @@ -382,20 +382,20 @@ input : simple_list '\n' { - $$ = 0; + $$ = nullptr; parser.m_stmt_list = $1; YYACCEPT; } | simple_list END_OF_INPUT { - $$ = 0; + $$ = nullptr; lexer.end_of_input = true; parser.m_stmt_list = $1; YYACCEPT; } | parse_error { - $$ = 0; + $$ = nullptr; YYABORT; } ; @@ -404,7 +404,7 @@ { YYUSE ($1); - $$ = 0; + $$ = nullptr; } | simple_list1 opt_sep_no_nl { $$ = parser.set_stmt_print_flag ($1, $2, false); } @@ -542,7 +542,7 @@ ; matrix_rows : cell_or_matrix_row - { $$ = $1 ? new octave::tree_matrix ($1) : 0; } + { $$ = $1 ? new octave::tree_matrix ($1) : nullptr; } | matrix_rows ';' cell_or_matrix_row { if ($1) @@ -553,7 +553,7 @@ $$ = $1; } else - $$ = $3 ? new octave::tree_matrix ($3) : 0; + $$ = $3 ? new octave::tree_matrix ($3) : nullptr; } ; @@ -562,7 +562,7 @@ ; cell_rows : cell_or_matrix_row - { $$ = $1 ? new octave::tree_cell ($1) : 0; } + { $$ = $1 ? new octave::tree_cell ($1) : nullptr; } | cell_rows ';' cell_or_matrix_row { if ($1) @@ -573,7 +573,7 @@ $$ = $1; } else - $$ = $3 ? new octave::tree_cell ($3) : 0; + $$ = $3 ? new octave::tree_cell ($3) : nullptr; } ; @@ -582,9 +582,9 @@ cell_or_matrix_row : // empty - { $$ = 0; } + { $$ = nullptr; } | ',' - { $$ = 0; } + { $$ = nullptr; } | arg_list { $$ = $1; } | arg_list ',' @@ -685,7 +685,7 @@ { $$ = parser.make_postfix_op (MINUS_MINUS, $1, $2); } | oper_expr '(' ')' { - $$ = parser.make_index_expression ($1, 0, '('); + $$ = parser.make_index_expression ($1, nullptr, '('); if (! $$) { // make_index_expression deleted $1. @@ -703,7 +703,7 @@ } | oper_expr '{' '}' { - $$ = parser.make_index_expression ($1, 0, '{'); + $$ = parser.make_index_expression ($1, nullptr, '{'); if (! $$) { // make_index_expression deleted $1. @@ -771,7 +771,7 @@ { $$ = parser.make_postfix_op (MINUS_MINUS, $1, $2); } | power_expr '(' ')' { - $$ = parser.make_index_expression ($1, 0, '('); + $$ = parser.make_index_expression ($1, nullptr, '('); if (! $$) { // make_index_expression deleted $1. @@ -789,7 +789,7 @@ } | power_expr '{' '}' { - $$ = parser.make_index_expression ($1, 0, '{'); + $$ = parser.make_index_expression ($1, nullptr, '{'); if (! $$) { // make_index_expression deleted $1. @@ -1159,8 +1159,8 @@ YYUSE ($4); YYUSE ($7); - if (! ($$ = parser.make_for_command (FOR, $1, $3, $5, 0, - $8, $9, $2))) + if (! ($$ = parser.make_for_command (FOR, $1, $3, $5, + nullptr, $8, $9, $2))) { // make_for_command deleted $3, $5, and $8. YYABORT; @@ -1171,8 +1171,8 @@ YYUSE ($5); YYUSE ($8); - if (! ($$ = parser.make_for_command (FOR, $1, $4, $6, 0, - $9, $10, $2))) + if (! ($$ = parser.make_for_command (FOR, $1, $4, $6, + nullptr, $9, $10, $2))) { // make_for_command deleted $4, $6, and $9. YYABORT; @@ -1184,7 +1184,7 @@ YYUSE ($7); if (! ($$ = parser.make_for_command (PARFOR, $1, $3, $5, - 0, $8, $9, $2))) + nullptr, $8, $9, $2))) { // make_for_command deleted $3, $5, and $8. YYABORT; @@ -1253,7 +1253,8 @@ { YYUSE ($3); - if (! ($$ = parser.make_try_command ($1, $4, 0, 0, $5, $2, 0))) + if (! ($$ = parser.make_try_command ($1, $4, 0, nullptr, + $5, $2, nullptr))) { // make_try_command deleted $4. YYABORT; @@ -1320,7 +1321,7 @@ ; opt_param_list : // empty - { $$ = 0; } + { $$ = nullptr; } | param_list { $$ = $1; } ; @@ -1334,14 +1335,14 @@ } | param_list_beg error { - $$ = 0; + $$ = nullptr; parser.bison_error ("invalid parameter list"); YYABORT; } ; param_list1 : // empty - { $$ = 0; } + { $$ = nullptr; } | param_list2 { $1->mark_as_formal_parameters (); @@ -1461,7 +1462,7 @@ parser.make_script ($3, end_of_script); } - $$ = 0; + $$ = nullptr; } | INPUT_FILE opt_nl classdef parsing_local_fcns opt_sep opt_fcn_list END_OF_INPUT { @@ -1472,7 +1473,7 @@ if (lexer.reading_classdef_file) parser.m_classdef_object = $3; - $$ = 0; + $$ = nullptr; } ; @@ -1586,7 +1587,7 @@ { YYUSE ($5); - $$ = parser.make_function ($1, 0, $3, $4, $6, $7, $2); + $$ = parser.make_function ($1, nullptr, $3, $4, $6, $7, $2); } | function_beg stash_comment return_list '=' fcn_name opt_param_list opt_sep opt_list function_end @@ -1611,7 +1612,7 @@ } // Create invalid parent scope. - lexer.symtab_context.push (0); + lexer.symtab_context.push (nullptr); lexer.parsing_classdef = true; $$ = $1; } @@ -1636,7 +1637,8 @@ lexer.parsing_classdef = false; - if (! ($$ = parser.make_classdef ($1, $3, $4, $5, 0, $7, $2))) + if (! ($$ = parser.make_classdef ($1, $3, $4, $5, nullptr, + $7, $2))) { // make_classdef deleted $3, $4, and $5. YYABORT; @@ -1645,7 +1647,7 @@ ; opt_attr_list : // empty - { $$ = 0; } + { $$ = nullptr; } | '(' attr_list ')' { $$ = $2; } ; @@ -1678,7 +1680,7 @@ opt_superclass_list : // empty - { $$ = 0; } + { $$ = nullptr; } | superclass_list { $$ = $1; } ; @@ -1764,7 +1766,7 @@ YYUSE ($4); if (! ($$ = parser.make_classdef_properties_block - ($1, $3, 0, $5, $2))) + ($1, $3, nullptr, $5, $2))) { // make_classdef_properties_block delete $3. YYABORT; @@ -1812,7 +1814,7 @@ YYUSE ($4); if (! ($$ = parser.make_classdef_methods_block - ($1, $3, 0, $5, $2))) + ($1, $3, nullptr, $5, $2))) { // make_classdef_methods_block deleted $3. YYABORT; @@ -1823,7 +1825,7 @@ method_decl1 : identifier { - if (! ($$ = parser.start_classdef_external_method ($1, 0))) + if (! ($$ = parser.start_classdef_external_method ($1, nullptr))) YYABORT; } | identifier param_list @@ -1834,7 +1836,7 @@ ; method_decl : stash_comment method_decl1 - { $$ = parser.finish_classdef_external_method ($2, 0, $1); } + { $$ = parser.finish_classdef_external_method ($2, nullptr, $1); } | stash_comment return_list '=' { YYUSE ($3); @@ -1935,7 +1937,7 @@ YYUSE ($4); if (! ($$ = parser.make_classdef_enum_block - ($1, $3, 0, $5, $2))) + ($1, $3, nullptr, $5, $2))) { // make_classdef_enum_block deleted $3. YYABORT; @@ -2120,7 +2122,7 @@ symbol_table::scope * base_parser::parent_scope_info::parent_scope (void) const { - return size () > 1 ? m_info[size()-2].first : 0; + return size () > 1 ? m_info[size()-2].first : nullptr; } std::string @@ -2139,10 +2141,11 @@ : m_endfunction_found (false), m_autoloading (false), m_fcn_file_from_relative_lookup (false), m_parsing_subfunctions (false), m_parsing_local_functions (false), - m_max_fcn_depth (0), m_curr_fcn_depth (0), m_primary_fcn_scope (0), + m_max_fcn_depth (0), m_curr_fcn_depth (0), m_primary_fcn_scope (nullptr), m_curr_class_name (), m_curr_package_name (), m_function_scopes (), - m_primary_fcn_ptr (0), m_subfunction_names (), m_classdef_object (0), - m_stmt_list (0), m_lexer (lxr), m_parser_state (yypstate_new ()) + m_primary_fcn_ptr (nullptr), m_subfunction_names (), + m_classdef_object (nullptr), m_stmt_list (nullptr), m_lexer (lxr), + m_parser_state (yypstate_new ()) { } base_parser::~base_parser (void) @@ -2172,15 +2175,17 @@ m_parsing_local_functions = false; m_max_fcn_depth = 0; m_curr_fcn_depth = 0; - m_primary_fcn_scope = 0; + m_primary_fcn_scope = nullptr; m_curr_class_name = ""; m_curr_package_name = ""; m_function_scopes.clear (); - m_primary_fcn_ptr = 0; + m_primary_fcn_ptr = nullptr; m_subfunction_names.clear (); + // FIXME: What about m_classdef_object? Shouldn't this be required? + // m_classdef_object = nullptr; delete m_stmt_list; - m_stmt_list = 0; + m_stmt_list = nullptr; m_lexer.reset (); @@ -2331,7 +2336,7 @@ int l = tok_val->line (); int c = tok_val->column (); - tree_constant *retval = 0; + tree_constant *retval = nullptr; switch (op) { @@ -2703,7 +2708,7 @@ comment_list *lc, comment_list *mc) { - tree_command *retval = 0; + tree_command *retval = nullptr; if (end_token_ok (end_tok, token::unwind_protect_end)) { @@ -2737,7 +2742,7 @@ comment_list *lc, comment_list *mc) { - tree_command *retval = 0; + tree_command *retval = nullptr; if (end_token_ok (end_tok, token::try_catch_end)) { @@ -2746,7 +2751,7 @@ int l = try_tok->line (); int c = try_tok->column (); - tree_identifier *id = 0; + tree_identifier *id = nullptr; if (! catch_sep && cleanup_stmts && ! cleanup_stmts->empty ()) { @@ -2762,7 +2767,7 @@ cleanup_stmts->pop_front (); - stmt->set_expression (0); + stmt->set_expression (nullptr); delete stmt; } } @@ -2848,7 +2853,7 @@ token *end_tok, comment_list *lc) { - tree_command *retval = 0; + tree_command *retval = nullptr; bool parfor = tok_id == PARFOR; @@ -2912,7 +2917,7 @@ if (! m_lexer.looping) { bison_error ("break must appear in a loop in the same file as loop command"); - return 0; + return nullptr; } else return new tree_break_command (l, c); @@ -2961,7 +2966,7 @@ token *end_tok, comment_list *lc) { - tree_if_command *retval = 0; + tree_if_command *retval = nullptr; if (end_token_ok (end_tok, token::if_end)) { @@ -3018,7 +3023,7 @@ token *end_tok, comment_list *lc) { - tree_switch_command *retval = 0; + tree_switch_command *retval = nullptr; if (end_token_ok (end_tok, token::switch_end)) { @@ -3147,7 +3152,7 @@ bison_error ("computed multiple assignment not allowed", l, c); - return 0; + return nullptr; } if (lhs->is_simple_assign_lhs ()) @@ -3167,7 +3172,7 @@ bison_error ("invalid assignment to keyword \"" + kw + "\"", l, c); - return 0; + return nullptr; } delete lhs; @@ -3188,7 +3193,7 @@ bison_error ("invalid assignment to keyword \"" + kw + "\"", l, c); - return 0; + return nullptr; } } @@ -3236,7 +3241,7 @@ tree_statement *end_fcn_stmt, comment_list *lc) { - tree_function_def *retval = 0; + tree_function_def *retval = nullptr; int l = fcn_tok->line (); int c = fcn_tok->column (); @@ -3280,7 +3285,7 @@ octave_user_function *fcn = new octave_user_function (m_lexer.symtab_context.curr_scope (), - param_list, 0, body); + param_list, nullptr, body); if (fcn) { @@ -3399,7 +3404,7 @@ comment_list *lc, int l, int c) { - tree_function_def *retval = 0; + tree_function_def *retval = nullptr; if (ret_list) ret_list->mark_as_formal_parameters (); @@ -3543,7 +3548,7 @@ tree_classdef_body *body, token *end_tok, comment_list *lc) { - tree_classdef *retval = 0; + tree_classdef *retval = nullptr; m_lexer.symtab_context.pop (); @@ -3602,7 +3607,7 @@ token *end_tok, comment_list *lc) { - tree_classdef_properties_block *retval = 0; + tree_classdef_properties_block *retval = nullptr; if (end_token_ok (end_tok, token::properties_end)) { @@ -3634,7 +3639,7 @@ token *end_tok, comment_list *lc) { - tree_classdef_methods_block *retval = 0; + tree_classdef_methods_block *retval = nullptr; if (end_token_ok (end_tok, token::methods_end)) { @@ -3666,7 +3671,7 @@ token *end_tok, comment_list *lc) { - tree_classdef_events_block *retval = 0; + tree_classdef_events_block *retval = nullptr; if (end_token_ok (end_tok, token::events_end)) { @@ -3698,7 +3703,7 @@ token *end_tok, comment_list *lc) { - tree_classdef_enum_block *retval = 0; + tree_classdef_enum_block *retval = nullptr; if (end_token_ok (end_tok, token::enumeration_end)) { @@ -3727,7 +3732,7 @@ base_parser::start_classdef_external_method (tree_identifier *id, tree_parameter_list *pl) { - octave_user_function* retval = 0; + octave_user_function* retval = nullptr; // External methods are only allowed within @-folders. In this case, // m_curr_class_name will be non-empty. @@ -3749,7 +3754,7 @@ // Create a dummy function that is used until the real method // is loaded. - retval = new octave_user_function (0, pl); + retval = new octave_user_function (nullptr, pl); retval->stash_function_name (mname); @@ -3796,7 +3801,7 @@ tree_argument_list *args, char type) { - tree_index_expression *retval = 0; + tree_index_expression *retval = nullptr; if (args && args->has_magic_tilde ()) { @@ -3835,7 +3840,7 @@ base_parser::make_indirect_ref (tree_expression *expr, const std::string& elt) { - tree_index_expression *retval = 0; + tree_index_expression *retval = nullptr; int l = expr->line (); int c = expr->column (); @@ -3865,7 +3870,7 @@ base_parser::make_indirect_ref (tree_expression *expr, tree_expression *elt) { - tree_index_expression *retval = 0; + tree_index_expression *retval = nullptr; int l = expr->line (); int c = expr->column (); @@ -3895,7 +3900,7 @@ base_parser::make_decl_command (int tok, token *tok_val, tree_decl_init_list *lst) { - tree_decl_command *retval = 0; + tree_decl_command *retval = nullptr; int l = tok_val->line (); int c = tok_val->column (); @@ -4022,7 +4027,7 @@ tree_argument_list * base_parser::validate_matrix_for_assignment (tree_expression *e) { - tree_argument_list *retval = 0; + tree_argument_list *retval = nullptr; if (e->is_constant ()) { @@ -4042,7 +4047,7 @@ { bool is_simple_assign = true; - tree_argument_list *tmp = 0; + tree_argument_list *tmp = nullptr; if (e->is_matrix ()) { @@ -4403,7 +4408,7 @@ octave::unwind_protect frame; - octave_function *fcn_ptr = 0; + octave_function *fcn_ptr = nullptr; // Open function file and parse. @@ -4416,7 +4421,7 @@ octave::command_history::ignore_entries (); - FILE *ffile = 0; + FILE *ffile = nullptr; if (! full_file.empty ()) ffile = std::fopen (full_file.c_str (), "rb"); @@ -4469,7 +4474,7 @@ delete (parser.m_classdef_object); - parser.m_classdef_object = 0; + parser.m_classdef_object = nullptr; } else if (fcn_ptr) { @@ -5289,7 +5294,7 @@ { if (parser.m_stmt_list) { - tree_statement *stmt = 0; + tree_statement *stmt = nullptr; tree_evaluator& tw = __get_evaluator__ ("eval_string"); @@ -5369,7 +5374,7 @@ if (*lst) { delete *lst; - *lst = 0; + *lst = nullptr; } } }
--- a/libinterp/parse-tree/pt-loop.h Tue Jul 25 14:54:10 2017 -0700 +++ b/libinterp/parse-tree/pt-loop.h Wed Jul 26 16:26:31 2017 -0700 @@ -173,8 +173,9 @@ public: tree_simple_for_command (int l = -1, int c = -1) - : tree_command (l, c), parallel (false), lhs (0), expr (0), - maxproc (0), list (nullptr), lead_comm (nullptr), trail_comm (nullptr) + : tree_command (l, c), parallel (false), lhs (nullptr), expr (nullptr), + maxproc (nullptr), list (nullptr), lead_comm (nullptr), + trail_comm (nullptr) #if defined (HAVE_LLVM) , compiled (nullptr) #endif
--- a/liboctave/array/Array.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/Array.cc Wed Jul 26 16:26:31 2017 -0700 @@ -2025,7 +2025,7 @@ else if (mode == DESCENDING) return octave_sort<T>::descending_compare; else - return 0; + return nullptr; } template <typename T> @@ -2487,7 +2487,7 @@ Array<T>::compare_fcn_type \ safe_comparator (sortmode, const Array<T>&, bool) \ { \ - return 0; \ + return nullptr; \ } \ template <> Array<octave_idx_type> \ Array<T>::sort_rows_idx (sortmode) const \
--- a/liboctave/array/CSparse.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/CSparse.cc Wed Jul 26 16:26:31 2017 -0700 @@ -1116,7 +1116,7 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, 1, control); + nullptr, 1, control); void *Symbolic; Matrix Info (1, UMFPACK_INFO); @@ -1125,7 +1125,7 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, 0, &Symbolic, control, info); + nullptr, nullptr, &Symbolic, control, info); if (status < 0) { @@ -1146,7 +1146,7 @@ = UMFPACK_ZNAME (numeric) (octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, Symbolic, &Numeric, control, info); + nullptr, Symbolic, &Numeric, control, info); UMFPACK_ZNAME (free_symbolic) (&Symbolic); rcond = Info (UMFPACK_RCOND); @@ -1167,7 +1167,7 @@ double c10[2], e10; - status = UMFPACK_ZNAME (get_determinant) (c10, 0, &e10, + status = UMFPACK_ZNAME (get_determinant) (c10, nullptr, &e10, Numeric, info); if (status < 0) @@ -5554,7 +5554,7 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, 1, control); + nullptr, 1, control); void *Symbolic; Info = Matrix (1, UMFPACK_INFO); @@ -5563,7 +5563,7 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, 0, &Symbolic, control, info); + nullptr, nullptr, &Symbolic, control, info); if (status < 0) { @@ -5584,7 +5584,7 @@ status = UMFPACK_ZNAME (numeric) (octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, Symbolic, &Numeric, control, info); + nullptr, Symbolic, &Numeric, control, info); UMFPACK_ZNAME (free_symbolic) (&Symbolic); if (calc_cond) @@ -5704,7 +5704,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -5835,9 +5835,9 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, + nullptr, reinterpret_cast<double *> (&Xx[iidx]), - 0, + nullptr, &Bx[iidx], Bz, Numeric, control, info); #else @@ -5956,7 +5956,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -5980,7 +5980,7 @@ B->nzmax = b.nnz (); B->packed = true; B->sorted = true; - B->nz = 0; + B->nz = nullptr; #if defined (OCTAVE_ENABLE_64) B->itype = CHOLMOD_LONG; #else @@ -6115,9 +6115,9 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, + nullptr, reinterpret_cast<double *> (Xx), - 0, + nullptr, Bx, Bz, Numeric, control, info); #else @@ -6257,7 +6257,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -6382,11 +6382,11 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, + nullptr, reinterpret_cast<double *> (&Xx[iidx]), - 0, + nullptr, reinterpret_cast<const double *> (&Bx[iidx]), - 0, Numeric, control, info); + nullptr, Numeric, control, info); if (status < 0) { @@ -6488,7 +6488,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -6512,7 +6512,7 @@ B->nzmax = b.nnz (); B->packed = true; B->sorted = true; - B->nz = 0; + B->nz = nullptr; #if defined (OCTAVE_ENABLE_64) B->itype = CHOLMOD_LONG; #else @@ -6638,11 +6638,11 @@ octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), reinterpret_cast<const double *> (Ax), - 0, + nullptr, reinterpret_cast<double *> (Xx), - 0, + nullptr, reinterpret_cast<double *> (Bx), - 0, Numeric, control, info); + nullptr, Numeric, control, info); if (status < 0) { @@ -6721,7 +6721,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6729,14 +6729,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix SparseComplexMatrix::solve (MatrixType& mattype, const Matrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6786,7 +6786,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6794,14 +6794,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix SparseComplexMatrix::solve (MatrixType& mattype, const SparseMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6851,7 +6851,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6859,14 +6859,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix SparseComplexMatrix::solve (MatrixType& mattype, const ComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6917,7 +6917,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6925,14 +6925,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix SparseComplexMatrix::solve (MatrixType& mattype, const SparseComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6996,7 +6996,7 @@ SparseComplexMatrix::solve (MatrixType& mattype, const ColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7015,7 +7015,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7023,14 +7023,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector SparseComplexMatrix::solve (MatrixType& mattype, const ComplexColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7048,21 +7048,21 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix SparseComplexMatrix::solve (const Matrix& b, octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix SparseComplexMatrix::solve (const Matrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix @@ -7079,7 +7079,7 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix @@ -7087,14 +7087,14 @@ octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix SparseComplexMatrix::solve (const SparseMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix @@ -7111,14 +7111,14 @@ octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix SparseComplexMatrix::solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix @@ -7135,7 +7135,7 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix @@ -7143,14 +7143,14 @@ octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix SparseComplexMatrix::solve (const SparseComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix @@ -7180,7 +7180,7 @@ SparseComplexMatrix::solve (const ColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector @@ -7198,7 +7198,7 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector @@ -7206,14 +7206,14 @@ octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector SparseComplexMatrix::solve (const ComplexColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector
--- a/liboctave/array/Sparse.h Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/Sparse.h Wed Jul 26 16:26:31 2017 -0700 @@ -68,13 +68,13 @@ octave::refcount<int> count; SparseRep (void) - : d (0), r (0), c (new octave_idx_type [1] {}), nzmx (0), nrows (0), - ncols (0), count (1) + : d (nullptr), r (nullptr), c (new octave_idx_type [1] {}), + nzmx (0), nrows (0), ncols (0), count (1) { } SparseRep (octave_idx_type n) - : d (0), r (0), c (new octave_idx_type [n+1] {}), nzmx (0), nrows (n), - ncols (n), count (1) + : d (nullptr), r (nullptr), c (new octave_idx_type [n+1] {}), + nzmx (0), nrows (n), ncols (n), count (1) { } SparseRep (octave_idx_type nr, octave_idx_type nc, octave_idx_type nz = 0)
--- a/liboctave/array/dSparse.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/dSparse.cc Wed Jul 26 16:26:31 2017 -0700 @@ -1062,7 +1062,7 @@ int status = UMFPACK_DNAME (qsymbolic) (nr, nc, octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), - Ax, 0, &Symbolic, control, info); + Ax, nullptr, &Symbolic, control, info); if (status < 0) { @@ -5614,7 +5614,7 @@ int status = UMFPACK_DNAME (qsymbolic) (nr, nc, octave::to_suitesparse_intptr (Ap), octave::to_suitesparse_intptr (Ai), - Ax, 0, &Symbolic, control, info); + Ax, nullptr, &Symbolic, control, info); if (status < 0) { @@ -5755,7 +5755,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -5980,7 +5980,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -6004,7 +6004,7 @@ B->nzmax = b.nnz (); B->packed = true; B->sorted = true; - B->nz = 0; + B->nz = nullptr; #if defined (OCTAVE_ENABLE_64) B->itype = CHOLMOD_LONG; #else @@ -6251,7 +6251,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -6496,7 +6496,7 @@ A->nzmax = nnz (); A->packed = true; A->sorted = true; - A->nz = 0; + A->nz = nullptr; #if defined (OCTAVE_ENABLE_64) A->itype = CHOLMOD_LONG; #else @@ -6520,7 +6520,7 @@ B->nzmax = b.nnz (); B->packed = true; B->sorted = true; - B->nz = 0; + B->nz = nullptr; #if defined (OCTAVE_ENABLE_64) B->itype = CHOLMOD_LONG; #else @@ -6721,7 +6721,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } Matrix @@ -6729,14 +6729,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } Matrix SparseMatrix::solve (MatrixType& mattype, const Matrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } Matrix @@ -6786,7 +6786,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseMatrix @@ -6794,14 +6794,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseMatrix SparseMatrix::solve (MatrixType& mattype, const SparseMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseMatrix @@ -6851,7 +6851,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6859,14 +6859,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix SparseMatrix::solve (MatrixType& mattype, const ComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexMatrix @@ -6916,7 +6916,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6924,14 +6924,14 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix SparseMatrix::solve (MatrixType& mattype, const SparseComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } SparseComplexMatrix @@ -6995,7 +6995,7 @@ SparseMatrix::solve (MatrixType& mattype, const ColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ColumnVector @@ -7013,7 +7013,7 @@ { octave_idx_type info; double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7021,7 +7021,7 @@ octave_idx_type& info) const { double rcond; - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7029,7 +7029,7 @@ octave_idx_type& info, double& rcond) const { - return solve (mattype, b, info, rcond, 0); + return solve (mattype, b, info, rcond, nullptr); } ComplexColumnVector @@ -7047,21 +7047,21 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } Matrix SparseMatrix::solve (const Matrix& b, octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } Matrix SparseMatrix::solve (const Matrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } Matrix @@ -7077,7 +7077,7 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseMatrix @@ -7085,14 +7085,14 @@ octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseMatrix SparseMatrix::solve (const SparseMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseMatrix @@ -7107,14 +7107,14 @@ SparseMatrix::solve (const ComplexMatrix& b, octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix SparseMatrix::solve (const ComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexMatrix @@ -7131,21 +7131,21 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix SparseMatrix::solve (const SparseComplexMatrix& b, octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix SparseMatrix::solve (const SparseComplexMatrix& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } SparseComplexMatrix @@ -7175,7 +7175,7 @@ SparseMatrix::solve (const ColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ColumnVector @@ -7193,21 +7193,21 @@ { octave_idx_type info; double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector SparseMatrix::solve (const ComplexColumnVector& b, octave_idx_type& info) const { double rcond; - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector SparseMatrix::solve (const ComplexColumnVector& b, octave_idx_type& info, double& rcond) const { - return solve (b, info, rcond, 0); + return solve (b, info, rcond, nullptr); } ComplexColumnVector
--- a/liboctave/array/fCMatrix.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/fCMatrix.cc Wed Jul 26 16:26:31 2017 -0700 @@ -2082,7 +2082,7 @@ { octave_idx_type info; float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix @@ -2090,14 +2090,14 @@ octave_idx_type& info) const { float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix FloatComplexMatrix::solve (MatrixType& mattype, const FloatMatrix& b, octave_idx_type& info, float& rcon) const { - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix @@ -2117,7 +2117,7 @@ { octave_idx_type info; float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix @@ -2125,14 +2125,14 @@ octave_idx_type& info) const { float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix FloatComplexMatrix::solve (MatrixType& mattype, const FloatComplexMatrix& b, octave_idx_type& info, float& rcon) const { - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexMatrix @@ -2181,7 +2181,7 @@ { octave_idx_type info; float rcon; - return solve (mattype, FloatComplexColumnVector (b), info, rcon, 0); + return solve (mattype, FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector @@ -2189,14 +2189,14 @@ octave_idx_type& info) const { float rcon; - return solve (mattype, FloatComplexColumnVector (b), info, rcon, 0); + return solve (mattype, FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector FloatComplexMatrix::solve (MatrixType& mattype, const FloatColumnVector& b, octave_idx_type& info, float& rcon) const { - return solve (mattype, FloatComplexColumnVector (b), info, rcon, 0); + return solve (mattype, FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector @@ -2215,7 +2215,7 @@ { octave_idx_type info; float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexColumnVector @@ -2224,7 +2224,7 @@ octave_idx_type& info) const { float rcon; - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexColumnVector @@ -2232,7 +2232,7 @@ const FloatComplexColumnVector& b, octave_idx_type& info, float& rcon) const { - return solve (mattype, b, info, rcon, 0); + return solve (mattype, b, info, rcon, nullptr); } FloatComplexColumnVector @@ -2253,21 +2253,21 @@ { octave_idx_type info; float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix FloatComplexMatrix::solve (const FloatMatrix& b, octave_idx_type& info) const { float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix FloatComplexMatrix::solve (const FloatMatrix& b, octave_idx_type& info, float& rcon) const { - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix @@ -2285,7 +2285,7 @@ { octave_idx_type info; float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix @@ -2293,14 +2293,14 @@ octave_idx_type& info) const { float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix FloatComplexMatrix::solve (const FloatComplexMatrix& b, octave_idx_type& info, float& rcon) const { - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexMatrix @@ -2318,7 +2318,7 @@ { octave_idx_type info; float rcon; - return solve (FloatComplexColumnVector (b), info, rcon, 0); + return solve (FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector @@ -2326,7 +2326,7 @@ octave_idx_type& info) const { float rcon; - return solve (FloatComplexColumnVector (b), info, rcon, 0); + return solve (FloatComplexColumnVector (b), info, rcon, nullptr); } FloatComplexColumnVector @@ -2350,7 +2350,7 @@ { octave_idx_type info; float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexColumnVector @@ -2358,7 +2358,7 @@ octave_idx_type& info) const { float rcon; - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexColumnVector @@ -2366,7 +2366,7 @@ octave_idx_type& info, float& rcon) const { - return solve (b, info, rcon, 0); + return solve (b, info, rcon, nullptr); } FloatComplexColumnVector
--- a/liboctave/array/idx-vector.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/idx-vector.cc Wed Jul 26 16:26:31 2017 -0700 @@ -315,7 +315,7 @@ template <typename T> idx_vector::idx_vector_rep::idx_vector_rep (const Array<T>& nda) - : idx_base_rep (), data (0), len (nda.numel ()), ext (0), + : idx_base_rep (), data (nullptr), len (nda.numel ()), ext (0), aowner (nullptr), orig_dims (nda.dims ()) { if (len != 0) @@ -372,8 +372,8 @@ } idx_vector::idx_vector_rep::idx_vector_rep (bool b) - : idx_base_rep (), data (0), len (b ? 1 : 0), ext (0), aowner (nullptr), - orig_dims (len, len) + : idx_base_rep (), data (nullptr), len (b ? 1 : 0), ext (0), + aowner (nullptr), orig_dims (len, len) { if (len != 0) { @@ -386,7 +386,8 @@ idx_vector::idx_vector_rep::idx_vector_rep (const Array<bool>& bnda, octave_idx_type nnz) - : idx_base_rep (), data (0), len (nnz), ext (0), aowner (nullptr), orig_dims () + : idx_base_rep (), data (nullptr), len (nnz), ext (0), aowner (nullptr), + orig_dims () { if (nnz < 0) len = bnda.nnz (); @@ -413,8 +414,8 @@ } idx_vector::idx_vector_rep::idx_vector_rep (const Sparse<bool>& bnda) - : idx_base_rep (), data (0), len (bnda.nnz ()), ext (0), aowner (nullptr), - orig_dims () + : idx_base_rep (), data (nullptr), len (bnda.nnz ()), ext (0), + aowner (nullptr), orig_dims () { const dim_vector dv = bnda.dims (); @@ -640,7 +641,7 @@ } idx_vector::idx_mask_rep::idx_mask_rep (bool b) - : idx_base_rep (), data (0), len (b ? 1 : 0), ext (0), + : idx_base_rep (), data (nullptr), len (b ? 1 : 0), ext (0), lsti (-1), lste (-1), aowner (nullptr), orig_dims (len, len) { if (len != 0) @@ -654,7 +655,7 @@ idx_vector::idx_mask_rep::idx_mask_rep (const Array<bool>& bnda, octave_idx_type nnz) - : idx_base_rep (), data (0), len (nnz), ext (bnda.numel ()), + : idx_base_rep (), data (nullptr), len (nnz), ext (bnda.numel ()), lsti (-1), lste (-1), aowner (nullptr), orig_dims () { if (nnz < 0)
--- a/liboctave/array/idx-vector.h Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/array/idx-vector.h Wed Jul 26 16:26:31 2017 -0700 @@ -282,7 +282,7 @@ public: idx_vector_rep (void) - : data (0), len (0), ext (0), aowner (nullptr), orig_dims () + : data (nullptr), len (0), ext (0), aowner (nullptr), orig_dims () { } // Direct constructor.
--- a/liboctave/numeric/sparse-chol.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/numeric/sparse-chol.cc Wed Jul 26 16:26:31 2017 -0700 @@ -269,7 +269,7 @@ ac->nzmax = a.nnz (); ac->packed = true; ac->sorted = true; - ac->nz = 0; + ac->nz = nullptr; #if defined (OCTAVE_ENABLE_64) ac->itype = CHOLMOD_LONG; #else
--- a/liboctave/util/cmd-edit.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/util/cmd-edit.cc Wed Jul 26 16:26:31 2017 -0700 @@ -1377,7 +1377,7 @@ command_editor::get_completion_function (void) { return (instance_ok ()) - ? instance->do_get_completion_function () : 0; + ? instance->do_get_completion_function () : nullptr; } command_editor::quoting_fcn
--- a/liboctave/util/oct-sort.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/liboctave/util/oct-sort.cc Wed Jul 26 16:26:31 2017 -0700 @@ -141,7 +141,7 @@ else if (mode == DESCENDING) compare = descending_compare; else - compare = 0; + compare = nullptr; } template <typename T>
--- a/src/main.in.cc Tue Jul 25 14:54:10 2017 -0700 +++ b/src/main.in.cc Wed Jul 26 16:26:31 2017 -0700 @@ -186,7 +186,7 @@ strsave (const char *s) { if (! s) - return 0; + return nullptr; int len = strlen (s); char *tmp = new char [len+1]; @@ -290,7 +290,7 @@ new_argv[k++] = argv[i]; } - new_argv[k] = 0; + new_argv[k] = nullptr; if (no_display) {