Mercurial > octave
changeset 25336:389757b7b6af
eliminate redundant octave:: namespace tags
* documentation-dock-widget.cc, documentation-dock-widget.h,
documentation.cc, files-dock-widget.cc, file-editor-tab.cc,
file-editor.cc, octave-cmd.cc, webinfo.cc, resource-manager.cc,
environment.cc, ft-text-renderer.cc, gl2ps-print.cc, gtk-manager.cc,
help.cc, oct-stream.cc, sighandlers.cc, symtab.cc, bp-table.cc,
comment-list.h, jit-typeinfo.cc, oct-parse.in.yy, pt-cbinop.cc,
pt-eval.cc, pt-idx.cc, pt-jit.cc, cmd-edit.cc:
Eliminate octave:: namespace tags inside octave namespace.
Style fixes.
line wrap: on
line diff
--- a/libgui/src/documentation-dock-widget.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/documentation-dock-widget.cc Wed May 02 00:30:00 2018 -0400 @@ -39,7 +39,7 @@ set_title (tr ("Documentation")); setStatusTip (tr ("See the documentation for help.")); - m_docs = new octave::documentation (this); + m_docs = new documentation (this); setWidget (m_docs); connect (p, SIGNAL (show_doc_signal (const QString&)),
--- a/libgui/src/documentation-dock-widget.h Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/documentation-dock-widget.h Wed May 02 00:30:00 2018 -0400 @@ -53,7 +53,7 @@ private: - octave::documentation *m_docs; + documentation *m_docs; }; }
--- a/libgui/src/documentation.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/documentation.cc Wed May 02 00:30:00 2018 -0400 @@ -59,8 +59,8 @@ // Get original collection QString collection = getenv ("OCTAVE_QTHELP_COLLECTION"); if (collection.isEmpty ()) - collection = QString::fromStdString (octave::config::oct_doc_dir () - + octave::sys::file_ops::dir_sep_str () + collection = QString::fromStdString (config::oct_doc_dir () + + sys::file_ops::dir_sep_str () + "octave_interpreter.qhc"); // Setup the help engine with the original collection, use a writable copy @@ -69,8 +69,8 @@ QString tmpdir = QDir::tempPath(); m_collection - = QString::fromStdString (octave::sys::tempnam (tmpdir.toStdString (), - "oct-qhelp-")); + = QString::fromStdString (sys::tempnam (tmpdir.toStdString (), + "oct-qhelp-")); if (m_help_engine->copyCollectionFile (m_collection)) m_help_engine->setCollectionFile (m_collection);
--- a/libgui/src/files-dock-widget.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/files-dock-widget.cc Wed May 02 00:30:00 2018 -0400 @@ -823,8 +823,7 @@ void files_dock_widget::popdownmenu_home (bool) { - QString dir - = QString::fromStdString (octave::sys::env::get_home_directory ()); + QString dir = QString::fromStdString (sys::env::get_home_directory ()); if (dir.isEmpty ()) dir = QDir::homePath ();
--- a/libgui/src/m-editor/file-editor-tab.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/m-editor/file-editor-tab.cc Wed May 02 00:30:00 2018 -0400 @@ -397,8 +397,8 @@ frame.protect_var (buffer_error_messages); buffer_error_messages++; - octave::bp_table& bptab - = octave::__get_bp_table__ ("handle_context_menu_break_condition"); + bp_table& bptab + = __get_bp_table__ ("handle_context_menu_break_condition"); bptab.condition_valid (new_condition.toStdString ()); valid = true; @@ -713,8 +713,7 @@ add_octave_apis (Fiskeyword ()); // add new entries interpreter& interp - = __get_interpreter__ ( - "file_editor_tab::update_lexer_settings"); + = __get_interpreter__ ("file_editor_tab::update_lexer_settings"); if (octave_builtins) add_octave_apis (F__builtins__ (interp)); // add new entries @@ -995,8 +994,7 @@ if (octave_qt_link::file_in_path (info.file, info.dir)) { - octave::bp_table& bptab - = octave::__get_bp_table__ ("octave_qt_link::file_in_path"); + bp_table& bptab = __get_bp_table__ ("octave_qt_link::file_in_path"); bptab.add_breakpoint (info.function_name, line_info, info.condition); } @@ -1009,8 +1007,7 @@ if (octave_qt_link::file_in_path (info.file, info.dir)) { - octave::bp_table& bptab - = octave::__get_bp_table__ ("remove_breakpoint_callback"); + bp_table& bptab = __get_bp_table__ ("remove_breakpoint_callback"); bptab.remove_breakpoint (info.function_name, line_info); } @@ -1020,8 +1017,7 @@ { if (octave_qt_link::file_in_path (info.file, info.dir)) { - octave::bp_table& bptab - = octave::__get_bp_table__ ("remove_all_breakpoints_callback"); + bp_table& bptab = __get_bp_table__ ("remove_all_breakpoints_callback"); bptab.remove_all_breakpoints_in_file (info.function_name, true); }
--- a/libgui/src/m-editor/file-editor.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/m-editor/file-editor.cc Wed May 02 00:30:00 2018 -0400 @@ -1490,7 +1490,7 @@ bool file_editor::is_editor_console_tabbed (void) { - octave::main_window *w = static_cast<octave::main_window *>(main_win ()); + main_window *w = static_cast<main_window *>(main_win ()); QList<QDockWidget *> w_list = w->tabifiedDockWidgets (this); QDockWidget *console = static_cast<QDockWidget *> (w->get_dock_widget_list ().at (0));
--- a/libgui/src/octave-cmd.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/octave-cmd.cc Wed May 02 00:30:00 2018 -0400 @@ -37,12 +37,12 @@ { void octave_cmd_exec::execute (void) { - std::string pending_input = octave::command_editor::get_current_line (); + std::string pending_input = command_editor::get_current_line (); - octave::command_editor::set_initial_input (pending_input); - octave::command_editor::replace_line (m_cmd.toStdString ()); - octave::command_editor::redisplay (); - octave::command_editor::accept_line (); + command_editor::set_initial_input (pending_input); + command_editor::replace_line (m_cmd.toStdString ()); + command_editor::redisplay (); + command_editor::accept_line (); } void octave_cmd_eval::execute (void) @@ -51,26 +51,26 @@ function_name.chop (m_info.suffix ().length () + 1); std::string file_path = m_info.absoluteFilePath ().toStdString (); - std::string pending_input = octave::command_editor::get_current_line (); + std::string pending_input = command_editor::get_current_line (); if (valid_identifier (function_name.toStdString ())) { // valid identifier: call as function with possibility to debug std::string path = m_info.absolutePath ().toStdString (); if (octave_qt_link::file_in_path (file_path, path)) - octave::command_editor::replace_line (function_name.toStdString ()); + command_editor::replace_line (function_name.toStdString ()); } else { // no valid identifier: use Fsource (), no debug possible Fsource (ovl (file_path)); - octave::command_editor::replace_line (""); + command_editor::replace_line (""); } - octave::command_editor::set_initial_input (pending_input); - octave::command_editor::redisplay (); + command_editor::set_initial_input (pending_input); + command_editor::redisplay (); - octave::command_editor::accept_line (); + command_editor::accept_line (); } void octave_cmd_debug::execute (void) @@ -93,7 +93,7 @@ Fdbstep (ovl (m_cmd.toStdString ())); } - octave::command_editor::interrupt (true); + command_editor::interrupt (true); } // add a command to the queue
--- a/libgui/src/qtinfo/webinfo.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/qtinfo/webinfo.cc Wed May 02 00:30:00 2018 -0400 @@ -56,7 +56,7 @@ hbox_layout->setSpacing (0); vbox_layout->addLayout (hbox_layout); - _tab_bar = new octave::tab_bar (this); + _tab_bar = new tab_bar (this); _tab_bar->setSizePolicy (QSizePolicy::Preferred,QSizePolicy::Preferred); _tab_bar->setExpanding (false); _tab_bar->setTabsClosable (true);
--- a/libgui/src/resource-manager.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libgui/src/resource-manager.cc Wed May 02 00:30:00 2018 -0400 @@ -55,11 +55,11 @@ static QString default_qt_settings_file (void) { - std::string dsf = octave::sys::env::getenv ("OCTAVE_DEFAULT_QT_SETTINGS"); + std::string dsf = sys::env::getenv ("OCTAVE_DEFAULT_QT_SETTINGS"); if (dsf.empty ()) - dsf = (octave::config::oct_etc_dir () - + octave::sys::file_ops::dir_sep_str () + dsf = (config::oct_etc_dir () + + sys::file_ops::dir_sep_str () + "default-qt-settings"); return QString::fromStdString (dsf); @@ -94,9 +94,9 @@ QString resource_manager::get_gui_translation_dir (void) { // get environment variable for the locale dir (e.g. from run-octave) - std::string dldir = octave::sys::env::getenv ("OCTAVE_LOCALE_DIR"); + std::string dldir = sys::env::getenv ("OCTAVE_LOCALE_DIR"); if (dldir.empty ()) - dldir = octave::config::oct_locale_dir (); // env-var empty, load the default location + dldir = config::oct_locale_dir (); // env-var empty, load the default location return QString::fromStdString (dldir); }
--- a/libinterp/corefcn/environment.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/environment.cc Wed May 02 00:30:00 2018 -0400 @@ -105,7 +105,7 @@ { std::string retval = "emacs"; - std::string env_editor = octave::sys::env::getenv ("EDITOR"); + std::string env_editor = sys::env::getenv ("EDITOR"); if (! env_editor.empty ()) retval = env_editor; @@ -115,9 +115,9 @@ std::string environment::init_exec_path (void) { - std::string exec_path = octave::sys::env::getenv ("OCTAVE_EXEC_PATH"); + std::string exec_path = sys::env::getenv ("OCTAVE_EXEC_PATH"); - std::string path_sep = octave::directory_path::path_sep_str (); + std::string path_sep = directory_path::path_sep_str (); if (exec_path.empty ()) exec_path = (config::local_ver_arch_lib_dir () + path_sep @@ -135,14 +135,14 @@ { std::string image_path = "."; - std::string path_sep = octave::directory_path::path_sep_str (); + std::string path_sep = directory_path::path_sep_str (); - std::string env_path = octave::sys::env::getenv ("OCTAVE_IMAGE_PATH"); + std::string env_path = sys::env::getenv ("OCTAVE_IMAGE_PATH"); if (! env_path.empty ()) image_path += path_sep + env_path; - std::string gen_path = octave::genpath (config::image_dir (), ""); + std::string gen_path = genpath (config::image_dir (), ""); if (! gen_path.empty ()) image_path += path_sep + gen_path;
--- a/libinterp/corefcn/ft-text-renderer.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/ft-text-renderer.cc Wed May 02 00:30:00 2018 -0400 @@ -226,7 +226,7 @@ if (! fonts_dir.empty ()) { - file = fonts_dir + octave::sys::file_ops::dir_sep_str () + "FreeSans"; + file = fonts_dir + sys::file_ops::dir_sep_str () + "FreeSans"; if (weight == "bold") file += "Bold"; @@ -347,7 +347,7 @@ static void ft_face_destroyed (void *object) { - octave::ft_manager::font_destroyed (reinterpret_cast<FT_Face> (object)); + ft_manager::font_destroyed (reinterpret_cast<FT_Face> (object)); } class
--- a/libinterp/corefcn/gl2ps-print.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/gl2ps-print.cc Wed May 02 00:30:00 2018 -0400 @@ -265,12 +265,12 @@ // Build an svg text element from a list of parsed strings. std::string strlist_to_svg (double x, double y, double z, Matrix box, double rotation, - std::list<octave::text_renderer::string>& lst); + std::list<text_renderer::string>& lst); // Build a list of postscript commands from a list of parsed strings. std::string strlist_to_ps (double x, double y, double z, Matrix box, double rotation, - std::list<octave::text_renderer::string>& lst); + std::list<text_renderer::string>& lst); int alignment_to_mode (int ha, int va) const; FILE *fp; @@ -781,7 +781,7 @@ std::string gl2ps_renderer::strlist_to_svg (double x, double y, double z, Matrix box, double rotation, - std::list<octave::text_renderer::string>& lst) + std::list<text_renderer::string>& lst) { if (lst.empty ()) return ""; @@ -877,7 +877,7 @@ std::string gl2ps_renderer::strlist_to_ps (double x, double y, double z, Matrix box, double rotation, - std::list<octave::text_renderer::string>& lst) + std::list<text_renderer::string>& lst) { // Translate and rotate coordinates in order to use bottom-left alignment fix_strlist_position (x, y, z, box, rotation, lst);
--- a/libinterp/corefcn/gtk-manager.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/gtk-manager.cc Wed May 02 00:30:00 2018 -0400 @@ -52,7 +52,7 @@ octave_value_list args; args(0) = dtk; - octave::feval ("graphics_toolkit", args); + feval ("graphics_toolkit", args); pl = loaded_toolkits.find (dtk);
--- a/libinterp/corefcn/help.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/help.cc Wed May 02 00:30:00 2018 -0400 @@ -551,7 +551,7 @@ { bool retval = false; - h = octave::get_help_from_file (nm, symbol_found, file); + h = get_help_from_file (nm, symbol_found, file); if (h.length () > 0) retval = true; @@ -690,8 +690,7 @@ string_vector make_name_list (void) { - octave::help_system& help_sys - = octave::__get_help_system__ ("make_name_list"); + help_system& help_sys = __get_help_system__ ("make_name_list"); return help_sys.make_name_list (); }
--- a/libinterp/corefcn/oct-stream.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/oct-stream.cc Wed May 02 00:30:00 2018 -0400 @@ -91,9 +91,9 @@ { dval = tc.double_value (); } - catch (const octave::execution_exception&) - { - octave::interpreter::recover_from_exception (); + catch (const execution_exception&) + { + interpreter::recover_from_exception (); conv_err = 1; } @@ -102,7 +102,7 @@ { if (! lo_ieee_isnan (dval)) { - int ival = octave::math::nint (dval); + int ival = math::nint (dval); if (ival == dval) retval = ival; @@ -124,7 +124,7 @@ if (lo_ieee_isnan (d)) ::error ("%s: NaN is invalid as size specification", who.c_str ()); - if (octave::math::isinf (d)) + if (math::isinf (d)) retval = -1; else { @@ -136,7 +136,7 @@ ::error ("%s: dimension too large for Octave's index type", who.c_str ()); - retval = octave::math::nint_big (d); + retval = math::nint_big (d); } return retval; @@ -169,7 +169,7 @@ { dnr = size(0); - if (octave::math::isinf (dnr)) + if (math::isinf (dnr)) ::error ("%s: invalid size specification", who.c_str ()); dnc = size(1); @@ -4573,7 +4573,7 @@ octave_idx_type& conversion_count, const std::string& who) { - if (octave::application::interactive () && file_number () == 0) + if (application::interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", who.c_str ()); @@ -4901,8 +4901,8 @@ is.clear (is.rdstate () & (~std::ios::failbit)); // FIXME: is this the right thing to do? - if (octave::application::interactive () - && ! octave::application::forced_interactive () + if (application::interactive () + && ! application::forced_interactive () && name () == "stdin") { is.clear (); @@ -5197,8 +5197,8 @@ // FIXME: is this the right thing to do? - if (octave::application::interactive () - && ! octave::application::forced_interactive () + if (application::interactive () + && ! application::forced_interactive () && name () == "stdin") { // Skip to end of line. @@ -5291,7 +5291,7 @@ const std::string& who, octave_idx_type& read_count) { - if (octave::application::interactive () && file_number () == 0) + if (application::interactive () && file_number () == 0) ::error ("%s: unable to read from stdin while running interactively", who.c_str ()); @@ -5303,7 +5303,7 @@ invalid_operation (who, "reading"); else { - octave::textscan scanner (who); + textscan scanner (who); retval = scanner.scan (*isp, fmt, ntimes, options, read_count); } @@ -5436,7 +5436,7 @@ { double dval = val(idx); - if (octave::math::x_nint (dval) != dval || dval < 0 || dval > 255) + if (math::x_nint (dval) != dval || dval < 0 || dval > 255) break; } @@ -5463,7 +5463,7 @@ { double dval = retval.double_value (); - if (octave::math::x_nint (dval) == dval && dval >= 0 && dval < 256) + if (math::x_nint (dval) == dval && dval >= 0 && dval < 256) retval = static_cast<char> (dval); } } @@ -5512,8 +5512,8 @@ double dval = val.double_value (true); - if (octave::math::x_nint (dval) == dval) - retval = octave::math::nint (dval); + if (math::x_nint (dval) == dval) + retval = math::nint (dval); else curr_state = conversion_error; @@ -5552,7 +5552,7 @@ } static size_t - do_printf_string (std::ostream& os, const octave::printf_format_elt *elt, + do_printf_string (std::ostream& os, const printf_format_elt *elt, int nsa, int sa_1, int sa_2, const std::string& arg, const std::string& who) { @@ -5607,7 +5607,7 @@ { double dval = val.double_value (true); - if (dval == octave::math::round (dval) && dval <= limit) + if (dval == math::round (dval) && dval <= limit) return true; } @@ -5634,7 +5634,7 @@ uint64_t limit = std::numeric_limits<uint64_t>::max (); - if (dval == octave::math::round (dval) && dval >= 0 && dval <= limit) + if (dval == math::round (dval) && dval >= 0 && dval <= limit) return true; } @@ -5642,7 +5642,7 @@ } static std::string - switch_to_g_format (const octave::printf_format_elt *elt) + switch_to_g_format (const printf_format_elt *elt) { std::string tfmt = elt->text; @@ -6302,7 +6302,7 @@ octave_idx_type elts_read, octave_idx_type nr, octave_idx_type nc, bool swap, bool do_float_fmt_conv, bool do_NA_conv, - octave::mach_info::float_format from_flt_fmt) + mach_info::float_format from_flt_fmt) { typedef typename DST_T::element_type dst_elt_type; @@ -6329,7 +6329,7 @@ else if (do_float_fmt_conv) do_float_format_conversion (&data[i], sizeof (SRC_T), 1, from_flt_fmt, - octave::mach_info::native_float_format ()); + mach_info::native_float_format ()); dst_elt_type tmp (data[i]); @@ -6349,7 +6349,7 @@ else if (do_float_fmt_conv) do_float_format_conversion (&data[i], sizeof (SRC_T), 1, from_flt_fmt, - octave::mach_info::native_float_format ()); + mach_info::native_float_format ()); conv_data[j] = data[i]; } @@ -6393,7 +6393,7 @@ (std::list<void *>& input_buf_list, octave_idx_type input_buf_elts, octave_idx_type elts_read, octave_idx_type nr, octave_idx_type nc, bool swap, bool do_float_fmt_conv, bool do_NA_conv, - octave::mach_info::float_format from_flt_fmt); + mach_info::float_format from_flt_fmt); #define TABLE_ELT(T, U, V, W) \ conv_fptr_table[oct_data_conv::T][oct_data_conv::U] = convert_and_copy<V, W> @@ -6776,18 +6776,18 @@ static bool convert_data (const T *data, void *conv_data, octave_idx_type n_elts, oct_data_conv::data_type output_type, - octave::mach_info::float_format flt_fmt) + mach_info::float_format flt_fmt) { bool retval = true; bool swap = false; - if (octave::mach_info::words_big_endian ()) - swap = (flt_fmt == octave::mach_info::flt_fmt_ieee_little_endian); + if (mach_info::words_big_endian ()) + swap = (flt_fmt == mach_info::flt_fmt_ieee_little_endian); else - swap = (flt_fmt == octave::mach_info::flt_fmt_ieee_big_endian); - - bool do_float_conversion = flt_fmt != octave::mach_info::float_format (); + swap = (flt_fmt == mach_info::flt_fmt_ieee_big_endian); + + bool do_float_conversion = flt_fmt != mach_info::float_format (); typedef typename ultimate_element_type<T>::type ult_elt_type;
--- a/libinterp/corefcn/sighandlers.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/sighandlers.cc Wed May 02 00:30:00 2018 -0400 @@ -186,8 +186,7 @@ static const bool have_sigusr2 = octave_get_sig_number ("SIGUSR2", &sigusr2); - octave::child_list& kids - = octave::__get_child_list__ ("respond_to_pending_signals"); + child_list& kids = __get_child_list__ ("respond_to_pending_signals"); for (int sig = 0; sig < octave_num_signals (); sig++) {
--- a/libinterp/corefcn/symtab.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/corefcn/symtab.cc Wed May 02 00:30:00 2018 -0400 @@ -97,7 +97,7 @@ bool retval = false; octave_value ov_fcn - = octave::load_fcn_from_file (ff, dir_name, dispatch_type, + = load_fcn_from_file (ff, dir_name, dispatch_type, package_name); if (ov_fcn.is_defined ()) @@ -167,7 +167,8 @@ if (! dispatch_type.empty ()) { - load_path& lp = __get_load_path__ ("out_of_date_check"); + load_path& lp + = __get_load_path__ ("out_of_date_check"); file = lp.find_method (dispatch_type, nm, dir_name, pack); @@ -210,7 +211,8 @@ if (file.empty ()) { - load_path& lp = __get_load_path__ ("out_of_date_check"); + load_path& lp + = __get_load_path__ ("out_of_date_check"); file = lp.find_fcn (nm, dir_name, pack); } } @@ -283,8 +285,8 @@ // breakpoints associated with it if (clear_breakpoints) { - octave::bp_table& bptab - = octave::__get_bp_table__ ("out_of_date_check"); + bp_table& bptab + = __get_bp_table__ ("out_of_date_check"); bptab.remove_all_breakpoints_in_file (canonical_nm, true);
--- a/libinterp/parse-tree/bp-table.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/bp-table.cc Wed May 02 00:30:00 2018 -0400 @@ -70,7 +70,7 @@ Vdebug_on_warning = false; bp_table::m_warnings_that_stop.clear (); - octave::Vdebug_on_interrupt = false; + Vdebug_on_interrupt = false; } // Process the "warn", "errs", "caught" and "intr" fields for a call of @@ -101,6 +101,7 @@ } } } + if (fail) error ("dbstop: invalid 'errs' field"); @@ -127,6 +128,7 @@ } } } + if (fail) error ("dbstop: invalid 'caught' field"); @@ -153,12 +155,13 @@ } } } + if (fail) error ("dbstop: invalid 'warn' field"); // process interrupt if (mv.isfield ("intr")) - octave::Vdebug_on_interrupt = 1; + Vdebug_on_interrupt = 1; } // Insert a breakpoint in function fcn at line within file fname, @@ -173,7 +176,7 @@ { bool found = false; - octave::tree_statement_list *cmds = fcn->body (); + tree_statement_list *cmds = fcn->body (); std::string file = fcn->fcn_file_name (); @@ -212,14 +215,14 @@ { if (cond.length () > 0) { - octave::parser parser (cond + " ;"); // ; to reject partial expr like "y==" + parser parser (cond + " ;"); // ; to reject partial expr like "y==" parser.reset (); int parse_status = parser.run (); if (parse_status) error ("dbstop: Cannot parse condition '%s'", cond.c_str ()); else { - octave::tree_statement *stmt = nullptr; + tree_statement *stmt = nullptr; if (! parser.m_stmt_list) error ("dbstop: " "condition is not empty, but has nothing to evaluate"); @@ -229,7 +232,7 @@ && (stmt = parser.m_stmt_list->front ()) && stmt->is_expression ()) { - octave::tree_expression *expr = stmt->expression (); + tree_expression *expr = stmt->expression (); if (expr->is_assignment_expression ()) error ("dbstop: condition cannot be an assignment. " "Did you mean '=='?"); @@ -239,6 +242,7 @@ } } } + return true; } @@ -412,7 +416,7 @@ } else if (condition == "interrupt") { - octave::Vdebug_on_interrupt = on_off; + Vdebug_on_interrupt = on_off; } else if (condition == "naninf") { @@ -455,7 +459,7 @@ if (stop_flag == &Vdebug_on_error) { // Matlab stops on both. - octave::Vdebug_on_interrupt = on_off; + Vdebug_on_interrupt = on_off; } } } @@ -586,8 +590,7 @@ } } - octave::tree_evaluator::debug_mode = bp_table::have_breakpoints () - || Vdebugging; + tree_evaluator::debug_mode = bp_table::have_breakpoints () || Vdebugging; return retval; } @@ -600,7 +603,7 @@ std::string file = fcn->fcn_file_name (); - octave::tree_statement_list *cmds = fcn->body (); + tree_statement_list *cmds = fcn->body (); // FIXME: move the operation on cmds to the tree_statement_list class? @@ -683,8 +686,7 @@ } } - octave::tree_evaluator::debug_mode = bp_table::have_breakpoints () - || Vdebugging; + tree_evaluator::debug_mode = bp_table::have_breakpoints () || Vdebugging; return retval; } @@ -703,7 +705,7 @@ { std::string file = dbg_fcn->fcn_file_name (); - octave::tree_statement_list *cmds = dbg_fcn->body (); + tree_statement_list *cmds = dbg_fcn->body (); if (cmds) { @@ -718,8 +720,7 @@ error ("remove_all_breakpoint_in_file: " "unable to find function %s\n", fname.c_str ()); - octave::tree_evaluator::debug_mode = bp_table::have_breakpoints () - || Vdebugging; + tree_evaluator::debug_mode = bp_table::have_breakpoints () || Vdebugging; return retval; } @@ -735,8 +736,7 @@ remove_all_breakpoints_in_file (*it); } - octave::tree_evaluator::debug_mode = bp_table::have_breakpoints () - || Vdebugging; + tree_evaluator::debug_mode = bp_table::have_breakpoints () || Vdebugging; } std::string find_bkpt_list (octave_value_list slist, std::string match) @@ -772,7 +772,7 @@ if (dbg_fcn) { - octave::tree_statement_list *cmds = dbg_fcn->body (); + tree_statement_list *cmds = dbg_fcn->body (); // FIXME: move the operation on cmds to the // tree_statement_list class? @@ -917,7 +917,7 @@ } // print dbstop if interrupt information - if (octave::Vdebug_on_interrupt) + if (Vdebug_on_interrupt) { if (to_screen) octave_stdout << "stop if interrupt\n"; @@ -939,7 +939,7 @@ if (fname.empty ()) { - octave::call_stack& cs = octave::__get_call_stack__ ("get_user_code"); + call_stack& cs = __get_call_stack__ ("get_user_code"); dbg_fcn = cs.debug_user_code (); } @@ -947,11 +947,11 @@ { std::string name = fname; - if (octave::sys::file_ops::dir_sep_char () != '/' && name[0] == '@') + if (sys::file_ops::dir_sep_char () != '/' && name[0] == '@') { auto beg = name.begin () + 2; // never have @/method auto end = name.end () - 1; // never have trailing '/' - std::replace (beg, end, '/', octave::sys::file_ops::dir_sep_char ()); + std::replace (beg, end, '/', sys::file_ops::dir_sep_char ()); } size_t name_len = name.length (); @@ -959,8 +959,7 @@ if (name_len > 2 && name.substr (name_len-2) == ".m") name = name.substr (0, name_len-2); - octave::symbol_table& symtab = - octave::__get_symbol_table__ ("get_user_code"); + symbol_table& symtab = __get_symbol_table__ ("get_user_code"); octave_value fcn = symtab.find_function (name);
--- a/libinterp/parse-tree/comment-list.h Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/comment-list.h Wed May 02 00:30:00 2018 -0400 @@ -85,14 +85,14 @@ }; class - comment_list : public octave::base_list<comment_elt> + comment_list : public base_list<comment_elt> { public: comment_list (void) { } void append (const comment_elt& elt) - { octave::base_list<comment_elt>::append (elt); } + { base_list<comment_elt>::append (elt); } void append (const std::string& s, comment_elt::comment_type t = comment_elt::unknown)
--- a/libinterp/parse-tree/jit-typeinfo.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/jit-typeinfo.cc Wed May 02 00:30:00 2018 -0400 @@ -216,7 +216,7 @@ extern "C" void octave_jit_err_nan_to_logical_conversion (void) { - octave::err_nan_to_logical_conversion (); + err_nan_to_logical_conversion (); } extern "C" void @@ -225,14 +225,14 @@ // FIXME: 0-argument form of octave::err_invalid_index removed in // cset dd6345fd8a97. Report -1 as the bad index for all // occurrences. - octave::err_invalid_index (static_cast<octave_idx_type> (-1)); + err_invalid_index (static_cast<octave_idx_type> (-1)); } extern "C" void octave_jit_gindex_range (int nd, int dim, octave_idx_type iext, octave_idx_type ext) { - octave::err_index_out_of_range (nd, dim, iext, ext); + err_index_out_of_range (nd, dim, iext, ext); } extern "C" jit_matrix @@ -397,7 +397,7 @@ static inline int xisint (double x) { - return (octave::math::x_nint (x) == x + return (math::x_nint (x) == x && ((x >= 0 && x < std::numeric_limits<int>::max ()) || (x <= 0 && x > std::numeric_limits<int>::min ()))); }
--- a/libinterp/parse-tree/oct-parse.in.yy Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/oct-parse.in.yy Wed May 02 00:30:00 2018 -0400 @@ -5428,9 +5428,9 @@ if (expr->is_identifier ()) { - octave::symbol_scope scope = tw.get_current_scope (); - - octave::symbol_record::context_id context + symbol_scope scope = tw.get_current_scope (); + + symbol_record::context_id context = scope.current_context (); tree_identifier *id
--- a/libinterp/parse-tree/pt-cbinop.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/pt-cbinop.cc Wed May 02 00:30:00 2018 -0400 @@ -36,12 +36,12 @@ // the argument and corresponding operator. static octave_value::unary_op - strip_trans_herm (octave::tree_expression_ptr_t& exp) + strip_trans_herm (tree_expression_ptr_t& exp) { if (exp->is_unary_expression ()) { - octave::tree_unary_expression *uexp = - dynamic_cast<octave::tree_unary_expression *> (exp); + tree_unary_expression *uexp = + dynamic_cast<tree_unary_expression *> (exp); octave_value::unary_op op = uexp->op_type (); @@ -58,12 +58,12 @@ } static octave_value::unary_op - strip_not (octave::tree_expression_ptr_t& exp) + strip_not (tree_expression_ptr_t& exp) { if (exp->is_unary_expression ()) { - octave::tree_unary_expression *uexp = - dynamic_cast<octave::tree_unary_expression *> (exp); + tree_unary_expression *uexp = + dynamic_cast<tree_unary_expression *> (exp); octave_value::unary_op op = uexp->op_type (); @@ -82,8 +82,7 @@ // or mul_herm. static octave_value::compound_binary_op - simplify_mul_op (octave::tree_expression_ptr_t& a, - octave::tree_expression_ptr_t& b) + simplify_mul_op (tree_expression_ptr_t& a, tree_expression_ptr_t& b) { octave_value::compound_binary_op retop = octave_value::unknown_compound_binary_op; @@ -110,8 +109,7 @@ // Possibly convert left division to trans_ldiv or herm_ldiv. static octave_value::compound_binary_op - simplify_ldiv_op (octave::tree_expression_ptr_t& a, - octave::tree_expression_ptr_t&) + simplify_ldiv_op (tree_expression_ptr_t& a, tree_expression_ptr_t&) { octave_value::compound_binary_op retop = octave_value::unknown_compound_binary_op; @@ -129,8 +127,7 @@ // Possibly contract and/or with negation. static octave_value::compound_binary_op - simplify_and_or_op (octave::tree_expression_ptr_t& a, - octave::tree_expression_ptr_t& b, + simplify_and_or_op (tree_expression_ptr_t& a, tree_expression_ptr_t& b, octave_value::binary_op op) { octave_value::compound_binary_op retop
--- a/libinterp/parse-tree/pt-eval.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/pt-eval.cc Wed May 02 00:30:00 2018 -0400 @@ -764,15 +764,15 @@ // Maybe handle 'continue N' someday... - if (octave::tree_continue_command::continuing) - octave::tree_continue_command::continuing--; - - bool quit = (octave::tree_return_command::returning - || octave::tree_break_command::breaking - || octave::tree_continue_command::continuing); - - if (octave::tree_break_command::breaking) - octave::tree_break_command::breaking--; + if (tree_continue_command::continuing) + tree_continue_command::continuing--; + + bool quit = (tree_return_command::returning + || tree_break_command::breaking + || tree_continue_command::continuing); + + if (tree_break_command::breaking) + tree_break_command::breaking--; return quit; } @@ -1156,28 +1156,27 @@ // be needed by pt-lvalue, which calls subsref?) static void - final_index_error (octave::index_exception& e, - const octave::tree_expression *expr) + final_index_error (index_exception& e, + const tree_expression *expr) { std::string extra_message; // FIXME: make this a member function for direct access to symbol // table and scope? - octave::symbol_scope scope - = octave::__require_current_scope__ ("final_index_error"); - - octave::symbol_record::context_id context = scope.current_context (); + symbol_scope scope + = __require_current_scope__ ("final_index_error"); + + symbol_record::context_id context = scope.current_context (); if (expr->is_identifier () - && dynamic_cast<const octave::tree_identifier *> (expr)->is_variable (context)) + && dynamic_cast<const tree_identifier *> (expr)->is_variable (context)) { std::string var = expr->name (); e.set_var (var); - octave::symbol_table& symtab = - octave::__get_symbol_table__ ("final_index_error"); + symbol_table& symtab = __get_symbol_table__ ("final_index_error"); octave_value fcn = symtab.find_function (var); @@ -1489,7 +1488,7 @@ beg = n; idx.clear (); } - catch (octave::index_exception& e) + catch (index_exception& e) { final_index_error (e, expr); } @@ -1508,7 +1507,7 @@ { retval = fcn->call (*this, nargout, idx); } - catch (octave::index_exception& e) + catch (index_exception& e) { final_index_error (e, expr); } @@ -2326,7 +2325,7 @@ error_with_id ("Octave:bad-alloc", "out of memory or dimension too large for Octave's index type"); } - catch (const octave::interrupt_exception&) + catch (const interrupt_exception&) { // If we are debugging, then continue with next statement. // Otherwise, jump out of here.
--- a/libinterp/parse-tree/pt-idx.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/pt-idx.cc Wed May 02 00:30:00 2018 -0400 @@ -145,8 +145,8 @@ } static inline octave_value_list - make_value_list (octave::tree_evaluator *tw, - octave::tree_argument_list *m_args, + make_value_list (tree_evaluator *tw, + tree_argument_list *m_args, const string_vector& m_arg_nm, const octave_value *object, bool rvalue = true) { @@ -199,18 +199,16 @@ // be needed by pt-lvalue, which calls subsref?) static void - final_index_error (octave::index_exception& e, - const octave::tree_expression *expr) + final_index_error (index_exception& e, const tree_expression *expr) { std::string extra_message; - octave::symbol_table& symtab - = octave::__get_symbol_table__ ("final_index_error"); + symbol_table& symtab = __get_symbol_table__ ("final_index_error"); - octave::symbol_record::context_id context = symtab.current_context (); + symbol_record::context_id context = symtab.current_context (); if (expr->is_identifier () - && dynamic_cast<const octave::tree_identifier *> (expr)->is_variable (context)) + && dynamic_cast<const tree_identifier *> (expr)->is_variable (context)) { std::string var = expr->name ();
--- a/libinterp/parse-tree/pt-jit.cc Mon Apr 30 13:42:48 2018 -0700 +++ b/libinterp/parse-tree/pt-jit.cc Wed May 02 00:30:00 2018 -0400 @@ -800,7 +800,7 @@ visit (cmd); else { - // stolen from octave::tree_evaluator::visit_statement + // stolen from tree_evaluator::visit_statement bool do_bind_ans = false; if (expr->is_identifier ()) @@ -2323,8 +2323,7 @@ bool tree_jit::enabled (void) { - octave::bp_table& bptab - = octave::__get_bp_table__ ("tree_jit::enabled"); + bp_table& bptab = __get_bp_table__ ("tree_jit::enabled"); // Ideally, we should only disable JIT if there is a breakpoint in the code // we are about to run. However, we can't figure this out in O(1) time, so