# HG changeset patch # User John W. Eaton # Date 1558533450 0 # Node ID 84ff9953faa1923b941fbfa7c0016de50fec420a # Parent 097774bed4edf35dee2ecee841105a67c07c4442 where possible, eliminate octave:: namespace qualifier inside octave namespace Affected files: file-editor-tab.cc, file-editor.cc, main-window.cc, octave-cmd.h, octave-qt-link.cc, settings-dialog.cc, call-stack.cc, environment.cc, ft-text-renderer.cc, gl2ps-print.cc, help.cc, input.cc, interpreter-private.cc, interpreter-private.h, interpreter.cc, load-path.cc, oct-hist.cc, oct-process.cc, oct-stream.cc, pager.cc, syminfo.cc, symtab.h, sysdep.cc, text-renderer.cc, utils.cc, gzip.cc, cdef-manager.cc, ov-fcn-handle.cc, ov-java.cc, jit-typeinfo.cc, oct-parse.yy, pt-eval.cc, pt-tm-const.cc, chol.cc, gsvd.cc, oct-rand.cc, oct-rand.h, randmtzig.cc, randpoisson.cc, file-ops.cc, lo-sysdep.cc, file-info.cc, oct-glob.cc, oct-sparse.cc, and url-transfer.cc. diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/m-editor/file-editor-tab.cc Wed May 22 13:57:30 2019 +0000 @@ -2146,7 +2146,7 @@ // Wait until dbquit has actually occurred while (names.numel () > i) { - octave::sleep (0.01); + sleep (0.01); stk = cs.backtrace (curr_frame, false); names = stk.contents ("name"); } diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/m-editor/file-editor.cc Wed May 22 13:57:30 2019 +0000 @@ -1044,7 +1044,7 @@ std::string ndir = new_name.toStdString (); std::string ofile = old.fileName ().toStdString (); f_data.new_file_name = QString::fromStdString ( - octave::sys::env::make_absolute (ofile, ndir)); + sys::env::make_absolute (ofile, ndir)); } else f_data.new_file_name = new_name; diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/main-window.cc Wed May 22 13:57:30 2019 +0000 @@ -86,7 +86,7 @@ create_default_editor (QWidget *p) { #if defined (HAVE_QSCINTILLA) - return new octave::file_editor (p); + return new file_editor (p); #else octave_unused_parameter (p); @@ -2559,7 +2559,7 @@ { // INTERPRETER THREAD - octave::feval ("open", ovl (file)); + feval ("open", ovl (file)); // Update the workspace since open.m may have loaded new variables. call_stack& cs @@ -2819,7 +2819,7 @@ { return QApplication::notify (receiver, ev); } - catch (octave::execution_exception&) + catch (execution_exception&) { octave_link::post_exception (std::current_exception ()); } diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/octave-cmd.h --- a/libgui/src/octave-cmd.h Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/octave-cmd.h Wed May 22 13:57:30 2019 +0000 @@ -98,7 +98,7 @@ * the executing Ff */ octave_cmd_builtin ( - octave_value_list (*Ff) (octave::interpreter&, const octave_value_list&, int), + octave_value_list (*Ff) (interpreter&, const octave_value_list&, int), octave_value_list argin = ovl (), cmd_upd update = CMD_UPD_NO) : octave_cmd (), m_callback_fi (Ff), m_callback_f (nullptr), m_argin (argin), m_nargout (0), m_argout_receiver (nullptr), @@ -129,7 +129,7 @@ * worker thread is busy and can not execute the desired command immediately. */ octave_cmd_builtin ( - octave_value_list (*Ff) (octave::interpreter&, const octave_value_list&, int), + octave_value_list (*Ff) (interpreter&, const octave_value_list&, int), octave_value_list argin, int nargout, QObject *argout_receiver, const char *argout_handler = nullptr, cmd_upd update = CMD_UPD_NO) : octave_cmd (), m_callback_fi (Ff), m_callback_f (nullptr), @@ -160,7 +160,7 @@ protected: - octave_value_list (*m_callback_fi) (octave::interpreter&, + octave_value_list (*m_callback_fi) (interpreter&, const octave_value_list&, int); octave_value_list (*m_callback_f) (const octave_value_list&, int); diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/octave-qt-link.cc --- a/libgui/src/octave-qt-link.cc Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/octave-qt-link.cc Wed May 22 13:57:30 2019 +0000 @@ -100,7 +100,7 @@ if (! settings || settings->value ("editor/create_new_file",false).toBool ()) return true; - std::string abs_fname = octave::sys::env::make_absolute (file); + std::string abs_fname = sys::env::make_absolute (file); QStringList btn; QStringList role; diff -r 097774bed4ed -r 84ff9953faa1 libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Tue May 21 19:50:59 2019 +0000 +++ b/libgui/src/settings-dialog.cc Wed May 22 13:57:30 2019 +0000 @@ -496,7 +496,7 @@ read_lexer_settings (lexer, settings); delete lexer; - lexer = new octave::octave_txt_lexer (); + lexer = new octave_txt_lexer (); read_lexer_settings (lexer, settings); delete lexer; @@ -996,7 +996,7 @@ write_lexer_settings (lexer, settings); delete lexer; - lexer = new octave::octave_txt_lexer (); + lexer = new octave_txt_lexer (); write_lexer_settings (lexer, settings); delete lexer; @@ -1163,8 +1163,8 @@ void settings_dialog::read_varedit_colors (QSettings *settings) { - QList default_colors = octave::variable_editor::default_colors (); - QStringList class_names = octave::variable_editor::color_names (); + QList default_colors = variable_editor::default_colors (); + QStringList class_names = variable_editor::color_names (); QString class_chars = resource_manager::varedit_color_chars (); int nr_of_classes = class_chars.length (); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/call-stack.cc --- a/libinterp/corefcn/call-stack.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/call-stack.cc Wed May 22 13:57:30 2019 +0000 @@ -965,7 +965,7 @@ bool return_list, bool verbose, const std::string& msg) { - octave::symbol_info_list symbol_stats; + symbol_info_list symbol_stats; std::list symbol_names; octave_idx_type npatterns = patterns.numel (); @@ -1009,7 +1009,7 @@ bool is_global = true; bool is_persistent = false; - octave::symbol_info + symbol_info syminf (nm, value, is_formal, is_global, is_persistent); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/environment.cc --- a/libinterp/corefcn/environment.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/environment.cc Wed May 22 13:57:30 2019 +0000 @@ -50,20 +50,20 @@ // FIXME: should we really be modifying PATH in the environment? - std::string shell_path = octave::sys::env::getenv ("PATH"); + std::string shell_path = sys::env::getenv ("PATH"); if (shell_path.empty ()) - octave::sys::env::putenv ("PATH", exec_path); + sys::env::putenv ("PATH", exec_path); else { // If PATH doesn't already have exec_path, append it. // FIXME: should we search for the elements individually, and // only append those that are missing? - std::string path_sep = octave::directory_path::path_sep_str (); + std::string path_sep = directory_path::path_sep_str (); if (shell_path.find (exec_path) == std::string::npos) - octave::sys::env::putenv ("PATH", shell_path + path_sep + exec_path); + sys::env::putenv ("PATH", shell_path + path_sep + exec_path); } } diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/ft-text-renderer.cc --- a/libinterp/corefcn/ft-text-renderer.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/ft-text-renderer.cc Wed May 22 13:57:30 2019 +0000 @@ -878,7 +878,7 @@ m_strlist = std::list (); - octave::unwind_protect frame; + unwind_protect frame; frame.protect_var (m_do_strlist); frame.protect_var (m_strlist); m_do_strlist = true; diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/gl2ps-print.cc --- a/libinterp/corefcn/gl2ps-print.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/gl2ps-print.cc Wed May 22 13:57:30 2019 +0000 @@ -1400,7 +1400,7 @@ std::string cmd = stream.substr (1); - fp = octave::popen (cmd.c_str (), "w"); + fp = popen (cmd.c_str (), "w"); if (! fp) error (R"(print: failed to open pipe "%s")", stream.c_str ()); @@ -1411,7 +1411,7 @@ { // Write gl2ps output directly to file. - fp = octave::sys::fopen (stream.c_str (), "w"); + fp = sys::fopen (stream.c_str (), "w"); if (! fp) error (R"(gl2ps_print: failed to create file "%s")", stream.c_str ()); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/help.cc Wed May 22 13:57:30 2019 +0000 @@ -586,7 +586,7 @@ if (! initialized) { std::string ascii_fname - = octave::sys::get_ASCII_filename (m_built_in_docstrings_file); + = sys::get_ASCII_filename (m_built_in_docstrings_file); std::ifstream file (ascii_fname.c_str (), std::ios::in | std::ios::binary); @@ -672,7 +672,7 @@ std::streamoff len = txt_limits.second; std::string ascii_fname - = octave::sys::get_ASCII_filename (m_built_in_docstrings_file); + = sys::get_ASCII_filename (m_built_in_docstrings_file); std::ifstream file (ascii_fname.c_str (), std::ios::in | std::ios::binary); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/input.cc Wed May 22 13:57:30 2019 +0000 @@ -109,7 +109,7 @@ static std::string find_indexed_expression (const std::string& text) { - std::string line = octave::command_editor::get_line_buffer (); + std::string line = command_editor::get_line_buffer (); int pos = line.length () - text.length (); int curly_count = 0; @@ -180,14 +180,14 @@ if (pos != std::string::npos) base_name = base_name.substr (0, pos); - octave::interpreter& interp - = octave::__get_interpreter__ ("generate_struct_completions"); + interpreter& interp + = __get_interpreter__ ("generate_struct_completions"); if (interp.is_variable (base_name)) { int parse_status; - octave::unwind_protect frame; + unwind_protect frame; frame.protect_var (discard_error_messages); frame.protect_var (discard_warning_messages); @@ -206,9 +206,9 @@ && (tmp.isstruct () || tmp.isjava () || tmp.is_classdef_object ())) names = tmp.map_keys (); } - catch (const octave::execution_exception&) + catch (const execution_exception&) { - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); } } } @@ -227,7 +227,7 @@ { bool retval = (! text.empty () && (text != "." || prev_char == ')' || prev_char == '}') - && text.find_first_of (octave::sys::file_ops::dir_sep_chars ()) == std::string::npos + && text.find_first_of (sys::file_ops::dir_sep_chars ()) == std::string::npos && text.find ("..") == std::string::npos && text.rfind ('.') != std::string::npos); @@ -244,13 +244,13 @@ prefix = ""; - char prev_char = octave::command_editor::get_prev_char (text.length ()); + char prev_char = command_editor::get_prev_char (text.length ()); deemed_struct = looks_like_struct (text, prev_char); if (deemed_struct) names = generate_struct_completions (text, prefix, hint); else - names = octave::make_name_list (); + names = make_name_list (); // Sort and remove duplicates. @@ -267,7 +267,7 @@ bool retval = false; - std::string line = octave::command_editor::get_line_buffer (); + std::string line = command_editor::get_line_buffer (); for (size_t i = 0; i < dirfns_commands_length; i++) { @@ -327,7 +327,7 @@ if (! deemed_struct) { - file_name_list = octave::command_editor::generate_filename_completions (text); + file_name_list = command_editor::generate_filename_completions (text); name_list.append (file_name_list); @@ -361,21 +361,21 @@ else retval = name; - char prev_char = octave::command_editor::get_prev_char + char prev_char = command_editor::get_prev_char (text.length ()); if (matches == 1 && looks_like_struct (retval, prev_char)) { // Don't append anything, since we don't know // whether it should be '(' or '.'. - octave::command_editor::set_completion_append_character ('\0'); + command_editor::set_completion_append_character ('\0'); } else { - octave::input_system& input_sys - = octave::__get_input_system__ ("generate_completion"); + input_system& input_sys + = __get_input_system__ ("generate_completion"); - octave::command_editor::set_completion_append_character + command_editor::set_completion_append_character (input_sys.completion_append_char ()); } @@ -414,26 +414,26 @@ // If we are using readline, this allows conditional parsing of the // .inputrc file. - octave::command_editor::set_name ("Octave"); + command_editor::set_name ("Octave"); // FIXME: this needs to include a comma too, but that // causes trouble for the new struct element completion code. static const char *s = "\t\n !\"\'*+-/:;<=>(){}[\\]^`~"; - octave::command_editor::set_basic_word_break_characters (s); + command_editor::set_basic_word_break_characters (s); - octave::command_editor::set_completer_word_break_characters (s); + command_editor::set_completer_word_break_characters (s); - octave::command_editor::set_basic_quote_characters (R"(")"); + command_editor::set_basic_quote_characters (R"(")"); - octave::command_editor::set_filename_quote_characters (" \t\n\\\"'@<>=;|&()#$`?*[!:{"); + command_editor::set_filename_quote_characters (" \t\n\\\"'@<>=;|&()#$`?*[!:{"); - octave::command_editor::set_completer_quote_characters (R"('")"); + command_editor::set_completer_quote_characters (R"('")"); - octave::command_editor::set_completion_function (generate_completion); + command_editor::set_completion_function (generate_completion); - octave::command_editor::set_quoting_function (quoting_filename); + command_editor::set_quoting_function (quoting_filename); } octave_value @@ -519,8 +519,8 @@ } // Synchronize the related gui preference for editor encoding - octave::feval ("__octave_link_gui_preference__", - ovl ("editor/default_encoding", m_mfile_encoding)); + feval ("__octave_link_gui_preference__", + ovl ("editor/default_encoding", m_mfile_encoding)); return retval; } @@ -548,7 +548,7 @@ { Vlast_prompt_time.stamp (); - if (Vdrawnow_requested && octave::application::interactive ()) + if (Vdrawnow_requested && application::interactive ()) { bool eval_error = false; @@ -556,7 +556,7 @@ { Fdrawnow (); } - catch (const octave::execution_exception& e) + catch (const execution_exception& e) { eval_error = true; @@ -565,11 +565,11 @@ if (! stack_trace.empty ()) std::cerr << stack_trace; - if (octave::application::interactive ()) - octave::interpreter::recover_from_exception (); + if (application::interactive ()) + interpreter::recover_from_exception (); } - octave::flush_stdout (); + flush_stdout (); // We set Vdrawnow_requested to false even if there is an error in // drawnow so that the error doesn't reappear at every prompt. @@ -680,7 +680,7 @@ eof = false; - std::string retval = octave::command_editor::readline (s, eof); + std::string retval = command_editor::readline (s, eof); if (! eof && retval.empty ()) retval = "\n"; @@ -891,8 +891,8 @@ std::string src_str = octave_fgets (m_file, eof); - octave::input_system& input_sys - = octave::__get_input_system__ ("get_input"); + input_system& input_sys + = __get_input_system__ ("get_input"); std::string mfile_encoding = input_sys.mfile_encoding (); @@ -922,7 +922,7 @@ error ("file_reader::get_input: converting from codepage '%s' to UTF-8: %s", encoding.c_str (), std::strerror (errno)); - octave::unwind_protect frame; + unwind_protect frame; frame.add_fcn (::free, static_cast (utf8_str)); src_str = std::string (reinterpret_cast (utf8_str), length); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/interpreter-private.cc --- a/libinterp/corefcn/interpreter-private.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/interpreter-private.cc Wed May 22 13:57:30 2019 +0000 @@ -183,7 +183,7 @@ } octave_value - get_function_handle (octave::interpreter& interp, const octave_value& arg, + get_function_handle (interpreter& interp, const octave_value& arg, const std::string& parameter_name) { std::list parameter_names; @@ -192,7 +192,7 @@ } octave_value - get_function_handle (octave::interpreter& interp, const octave_value& arg, + get_function_handle (interpreter& interp, const octave_value& arg, const std::list& parameter_names) { if (arg.is_function_handle () || arg.is_inline_function ()) @@ -204,7 +204,7 @@ if (fstr.empty ()) return octave_value (); - octave::symbol_table& symtab = interp.get_symbol_table (); + symbol_table& symtab = interp.get_symbol_table (); octave_value fcn = symtab.find_function (fstr); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/interpreter-private.h --- a/libinterp/corefcn/interpreter-private.h Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/interpreter-private.h Wed May 22 13:57:30 2019 +0000 @@ -94,11 +94,11 @@ // PARAMETER_NAMES. Use of the latter form is discouraged. octave_value - get_function_handle (octave::interpreter& interp, const octave_value& arg, + get_function_handle (interpreter& interp, const octave_value& arg, const std::string& parameter_name); octave_value - get_function_handle (octave::interpreter& interp, const octave_value& arg, + get_function_handle (interpreter& interp, const octave_value& arg, const std::list& parameter_names = std::list ()); } diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/interpreter.cc Wed May 22 13:57:30 2019 +0000 @@ -1707,13 +1707,13 @@ { m_load_path.execute_pkg_add (dir); } - catch (const octave::interrupt_exception&) + catch (const interrupt_exception&) { - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); } - catch (const octave::execution_exception&) + catch (const execution_exception&) { - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); } } } diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/load-path.cc --- a/libinterp/corefcn/load-path.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/load-path.cc Wed May 22 13:57:30 2019 +0000 @@ -51,14 +51,14 @@ static void maybe_add_path_elts (std::string& path, const std::string& dir) { - std::string tpath = octave::genpath (dir); + std::string tpath = genpath (dir); if (! tpath.empty ()) { if (path.empty ()) path = tpath; else - path += octave::directory_path::path_sep_str () + tpath; + path += directory_path::path_sep_str () + tpath; } } @@ -68,7 +68,7 @@ std::list retval; size_t beg = 0; - size_t end = p.find (octave::directory_path::path_sep_char ()); + size_t end = p.find (directory_path::path_sep_char ()); size_t len = p.length (); @@ -84,7 +84,7 @@ if (beg == len) break; - end = p.find (octave::directory_path::path_sep_char (), beg); + end = p.find (directory_path::path_sep_char (), beg); } std::string elt = p.substr (beg); @@ -104,7 +104,7 @@ size_t k = dir.length (); - while (k > 1 && octave::sys::file_ops::is_dir_sep (dir[k-1])) + while (k > 1 && sys::file_ops::is_dir_sep (dir[k-1])) k--; if (k < dir.length ()) @@ -124,7 +124,7 @@ // Look in private directory corresponding to current function (if // any). - octave::symbol_scope scope = octave::__get_current_scope__ ("find_private_file"); + symbol_scope scope = __get_current_scope__ ("find_private_file"); octave_user_function *curr_fcn = scope ? scope.function () : nullptr; @@ -138,10 +138,10 @@ if (! dir_name.empty ()) { - std::string pfname = dir_name + octave::sys::file_ops::dir_sep_str () - + "private" + octave::sys::file_ops::dir_sep_str () + fname; - - octave::sys::file_stat fs (pfname); + std::string pfname = dir_name + sys::file_ops::dir_sep_str () + + "private" + sys::file_ops::dir_sep_str () + fname; + + sys::file_stat fs (pfname); if (fs.exists () && fs.is_reg ()) retval = pfname; @@ -159,7 +159,7 @@ size_t ps = path.size (); size_t pls = path_list.size (); size_t pos = path_list.find (path); - char psc = octave::directory_path::path_sep_char (); + char psc = directory_path::path_sep_char (); while (pos != std::string::npos) { if ((pos == 0 || path_list[pos-1] == psc) @@ -175,7 +175,7 @@ static void rehash_internal (void) { - octave::load_path& lp = octave::__get_load_path__ ("rehash_internal"); + load_path& lp = __get_load_path__ ("rehash_internal"); lp.update (); @@ -846,14 +846,14 @@ if (! octave_interpreter_ready) return; - octave::unwind_protect frame; - - std::string file = octave::sys::file_ops::concat (dir, script_file); - - octave::sys::file_stat fs (file); + unwind_protect frame; + + std::string file = sys::file_ops::concat (dir, script_file); + + sys::file_stat fs (file); if (fs.exists ()) - octave::source_file (file, "base"); + source_file (file, "base"); } // FIXME: maybe we should also maintain a map to speed up this method of access. @@ -1082,7 +1082,7 @@ string_vector flist; std::string msg; - if (! octave::sys::get_dirlist (d, flist, msg)) + if (! sys::get_dirlist (d, flist, msg)) warning ("load_path: %s: %s", d.c_str (), msg.c_str ()); else { diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/oct-hist.cc --- a/libinterp/corefcn/oct-hist.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/oct-hist.cc Wed May 22 13:57:30 2019 +0000 @@ -134,7 +134,7 @@ tmp.resize (len - 1); if (! tmp.empty ()) - if (octave::command_history::add (tmp)) + if (command_history::add (tmp)) octave_link::append_history (tmp); } } @@ -162,7 +162,7 @@ mk_tmp_hist_file (const octave_value_list& args, bool insert_curr, const char *warn_for) { - string_vector hlist = octave::command_history::list (); + string_vector hlist = command_history::list (); int hist_count = hlist.numel () - 1; // switch to zero-based indexing @@ -172,7 +172,7 @@ // but the actual commands performed will. if (! insert_curr) - octave::command_history::remove (hist_count); + command_history::remove (hist_count); hist_count--; // skip last entry in history list @@ -225,7 +225,7 @@ reverse = true; } - std::string name = octave::sys::tempnam ("", "oct-"); + std::string name = sys::tempnam ("", "oct-"); std::fstream file (name.c_str (), std::ios::out); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/oct-process.cc --- a/libinterp/corefcn/oct-process.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/oct-process.cc Wed May 22 13:57:30 2019 +0000 @@ -78,8 +78,8 @@ int cmd_status = cmd.close (); - if (octave::sys::wifexited (cmd_status)) - cmd_status = octave::sys::wexitstatus (cmd_status); + if (sys::wifexited (cmd_status)) + cmd_status = sys::wexitstatus (cmd_status); else cmd_status = 127; diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/oct-stream.cc Wed May 22 13:57:30 2019 +0000 @@ -65,7 +65,7 @@ { // Programming Note: There are two very different error functions used // in the stream code. When invoked with "error (...)" the member - // function from octave::stream or octave::base_stream is called. This + // function from stream or base_stream is called. This // function sets the error state on the stream AND returns control to // the caller. The caller must then return a value at the end of the // function. When invoked with "::error (...)" the exception-based @@ -4546,7 +4546,7 @@ do \ { \ if (encoding ().compare ("utf-8")) \ - tmp = octave::string::u8_from_encoding (who, tmp, encoding ()); \ + tmp = string::u8_from_encoding (who, tmp, encoding ()); \ width = tmp.length (); \ \ if (is) \ @@ -5553,15 +5553,15 @@ switch (nsa) { case 2: - retval = octave::format (os, fmt, sa_1, sa_2, arg); + retval = format (os, fmt, sa_1, sa_2, arg); break; case 1: - retval = octave::format (os, fmt, sa_1, arg); + retval = format (os, fmt, sa_1, arg); break; case 0: - retval = octave::format (os, fmt, arg); + retval = format (os, fmt, arg); break; default: diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/pager.cc --- a/libinterp/corefcn/pager.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/pager.cc Wed May 22 13:57:30 2019 +0000 @@ -58,7 +58,7 @@ if (pid > 0) { - if (octave::sys::wifexited (status) || octave::sys::wifsignaled (status)) + if (sys::wifexited (status) || sys::wifsignaled (status)) { // Avoid warning() since that will put us back in the pager, // which would be bad news. @@ -85,9 +85,9 @@ { if (s) { - int available_rows = octave::command_editor::terminal_rows () - 2; + int available_rows = command_editor::terminal_rows () - 2; - int cols = octave::command_editor::terminal_cols (); + int cols = command_editor::terminal_cols (); int count = 0; @@ -124,8 +124,7 @@ int pager_buf::sync (void) { - octave::output_system& output_sys - = octave::__get_output_system__ ("pager_buf::sync"); + output_system& output_sys = __get_output_system__ ("pager_buf::sync"); char *buf = eback (); @@ -426,7 +425,7 @@ { m_external_pager = new oprocstream (pgr.c_str ()); - octave::child_list& kids = m_interpreter.get_child_list (); + child_list& kids = m_interpreter.get_child_list (); kids.insert (m_external_pager->pid (), pager_event_handler); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/syminfo.cc --- a/libinterp/corefcn/syminfo.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/syminfo.cc Wed May 22 13:57:30 2019 +0000 @@ -46,7 +46,7 @@ auto i = params.begin (); - octave::preserve_stream_state stream_state (os); + preserve_stream_state stream_state (os); while (i != params.end ()) { @@ -244,7 +244,7 @@ { std::ostringstream param_buf; - octave::preserve_stream_state stream_state (os); + preserve_stream_state stream_state (os); for (const auto& param : params) { diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/symtab.h --- a/libinterp/corefcn/symtab.h Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/symtab.h Wed May 22 13:57:30 2019 +0000 @@ -50,6 +50,7 @@ { public: + // Make symbol_table::scope and symbol_table::fcn_info valid type names. typedef octave::symbol_scope scope; typedef octave::fcn_info fcn_info; diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/sysdep.cc Wed May 22 13:57:30 2019 +0000 @@ -139,11 +139,11 @@ { do { - std::string mod_name (octave::sys::u8_from_wstring (mod_info.szModule)); + std::string mod_name (sys::u8_from_wstring (mod_info.szModule)); if (mod_name.find ("octinterp") != std::string::npos) { - bin_dir = octave::sys::u8_from_wstring (mod_info.szExePath); + bin_dir = sys::u8_from_wstring (mod_info.szExePath); if (! bin_dir.empty () && bin_dir.back () != '\\') bin_dir.push_back ('\\'); break; @@ -160,7 +160,7 @@ size_t pos = bin_dir.rfind (R"(\bin\)"); if (pos != std::string::npos) - octave::sys::env::putenv ("OCTAVE_HOME", bin_dir.substr (0, pos)); + sys::env::putenv ("OCTAVE_HOME", bin_dir.substr (0, pos)); } } @@ -169,7 +169,7 @@ { w32_set_octave_home (); - octave::command_editor::prefer_env_winsize (true); + command_editor::prefer_env_winsize (true); } #endif @@ -272,8 +272,8 @@ bool retval = false; - std::wstring file1w = octave::sys::u8_to_wstring (file1); - std::wstring file2w = octave::sys::u8_to_wstring (file2); + std::wstring file1w = sys::u8_to_wstring (file1); + std::wstring file2w = sys::u8_to_wstring (file2); const wchar_t *f1 = file1w.c_str (); const wchar_t *f2 = file2w.c_str (); @@ -320,8 +320,8 @@ // POSIX Code - octave::sys::file_stat fs_file1 (file1); - octave::sys::file_stat fs_file2 (file2); + sys::file_stat fs_file1 (file1); + sys::file_stat fs_file2 (file2); return (fs_file1 && fs_file2 && fs_file1.ino () == fs_file2.ino () @@ -357,7 +357,7 @@ if (candidate) { // Open a handle to the file. - std::wstring wname = octave::sys::u8_to_wstring (name); + std::wstring wname = sys::u8_to_wstring (name); HANDLE h = CreateFileW (wname.c_str (), FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, @@ -426,8 +426,8 @@ int tty_fd = STDIN_FILENO; if (! octave_isatty_wrapper (tty_fd)) { - if (octave::application::interactive () - && ! octave::application::forced_interactive ()) + if (application::interactive () + && ! application::forced_interactive ()) error ("stdin is not a tty!"); } @@ -572,7 +572,7 @@ wchar_t *wcommand = u8_to_wchar (command); wchar_t *wmode = u8_to_wchar (mode); - octave::unwind_protect frame; + unwind_protect frame; frame.add_fcn (::free, static_cast (wcommand)); frame.add_fcn (::free, static_cast (wmode)); @@ -620,13 +620,13 @@ raw_mode (true, wait); // Get current handler. - octave::interrupt_handler saved_interrupt_handler - = octave::ignore_interrupts (); + interrupt_handler saved_interrupt_handler + = ignore_interrupts (); // Restore it, disabling system call restarts (if possible) so the // read can be interrupted. - octave::set_interrupt_handler (saved_interrupt_handler, false); + set_interrupt_handler (saved_interrupt_handler, false); int c = std::cin.get (); @@ -637,7 +637,7 @@ } // Restore it, enabling system call restarts (if possible). - octave::set_interrupt_handler (saved_interrupt_handler, true); + set_interrupt_handler (saved_interrupt_handler, true); raw_mode (false, true); #endif @@ -661,10 +661,10 @@ if (retval.empty () || retval == R"(\)") { - retval = octave::sys::env::getenv ("TEMP"); + retval = sys::env::getenv ("TEMP"); if (retval.empty ()) - retval = octave::sys::env::getenv ("TMP"); + retval = sys::env::getenv ("TMP"); if (retval.empty ()) retval = R"(c:\temp)"; @@ -806,18 +806,18 @@ HKEY h_subkey; result = RegOpenKeyExW (h_rootkey, - octave::sys::u8_to_wstring (subkey).c_str (), 0, + sys::u8_to_wstring (subkey).c_str (), 0, KEY_READ, &h_subkey); if (result != ERROR_SUCCESS) return result; - octave::unwind_protect frame; + unwind_protect frame; frame.add_fcn (reg_close_key_wrapper, h_subkey); DWORD length = 0; result = RegQueryValueExW (h_subkey, - octave::sys::u8_to_wstring (name).c_str (), + sys::u8_to_wstring (name).c_str (), nullptr, nullptr, nullptr, &length); if (result != ERROR_SUCCESS) return result; @@ -825,7 +825,7 @@ DWORD type = 0; OCTAVE_LOCAL_BUFFER (BYTE, data, length); result = RegQueryValueExW (h_subkey, - octave::sys::u8_to_wstring (name).c_str (), + sys::u8_to_wstring (name).c_str (), nullptr, &type, data, &length); if (result != ERROR_SUCCESS) return result; @@ -833,7 +833,7 @@ if (type == REG_DWORD) value = octave_int32 (*data); else if (type == REG_SZ || type == REG_EXPAND_SZ) - value = string_vector (octave::sys::u8_from_wstring ( + value = string_vector (sys::u8_from_wstring ( reinterpret_cast (data))); return result; @@ -849,7 +849,7 @@ fields.clear (); retval = RegOpenKeyExW (h_rootkey, - octave::sys::u8_to_wstring (subkey).c_str (), 0, + sys::u8_to_wstring (subkey).c_str (), 0, KEY_READ, &h_subkey); if (retval != ERROR_SUCCESS) return retval; @@ -865,7 +865,7 @@ nullptr, nullptr, nullptr, nullptr); if (retval != ERROR_SUCCESS) break; - fields.push_back (octave::sys::u8_from_wstring (value_name)); + fields.push_back (sys::u8_from_wstring (value_name)); value_name_size = MAX_VALUE_NAME_SIZE; idx++; } diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/text-renderer.cc --- a/libinterp/corefcn/text-renderer.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/text-renderer.cc Wed May 22 13:57:30 2019 +0000 @@ -32,13 +32,13 @@ namespace octave { - static octave::base_text_renderer * + static base_text_renderer * make_text_renderer (void) { // Allow the possibility of choosing different text rendering // implementations. - return octave::make_ft_text_renderer (); + return make_ft_text_renderer (); } text_renderer::text_renderer (void) diff -r 097774bed4ed -r 84ff9953faa1 libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/corefcn/utils.cc Wed May 22 13:57:30 2019 +0000 @@ -1106,7 +1106,7 @@ for (octave_idx_type i = 0; i < n; i++) dim(i) = v(i); - octave::check_dimensions (dim, warn_for); + check_dimensions (dim, warn_for); } void get_dimensions (const octave_value& a, const char *warn_for, @@ -1129,7 +1129,7 @@ nc = v(1); } - octave::check_dimensions (nr, nc, warn_for); + check_dimensions (nr, nc, warn_for); } void get_dimensions (const octave_value& a, const octave_value& b, @@ -1139,7 +1139,7 @@ nr = (a.isempty () ? 0 : a.idx_type_value (true)); nc = (b.isempty () ? 0 : b.idx_type_value (true)); - octave::check_dimensions (nr, nc, warn_for); + check_dimensions (nr, nc, warn_for); } octave_idx_type dims_to_numel (const dim_vector& dims, @@ -1284,11 +1284,11 @@ if (do_graphics_events) gh_manager::unlock (); - if (octave::math::isinf (seconds)) + if (math::isinf (seconds)) { // Wait for kbhit int c = -1; - octave::flush_stdout (); + flush_stdout (); struct timespec one_tenth = { 0, 100000000 }; @@ -1301,12 +1301,12 @@ if (do_graphics_events) gh_manager::process_events (); - c = octave::kbhit (false); + c = kbhit (false); } } else { - octave::sys::time now; + sys::time now; double end_time = now.double_value () + seconds; double remaining_time = seconds; @@ -1483,7 +1483,7 @@ { octave_value retval; - const octave_value_list tmp = octave::do_simple_cellfun (fun, fun_name, args, 1); + const octave_value_list tmp = do_simple_cellfun (fun, fun_name, args, 1); if (tmp.length () > 0) retval = tmp(0); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/dldfcn/gzip.cc --- a/libinterp/dldfcn/gzip.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/dldfcn/gzip.cc Wed May 22 13:57:30 2019 +0000 @@ -98,7 +98,7 @@ CFile (void) = delete; CFile (const std::string& path, const std::string& mode) - : m_fp (octave::sys::fopen (path, mode)) + : m_fp (sys::fopen (path, mode)) { if (! m_fp) throw std::runtime_error ("unable to open file"); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/octave-value/cdef-manager.cc --- a/libinterp/octave-value/cdef-manager.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/octave-value/cdef-manager.cc Wed May 22 13:57:30 2019 +0000 @@ -753,7 +753,7 @@ cdef_class cdef_manager::make_class (const std::string& name, - const std::list& super_list) + const std::list& super_list) { cdef_class cls (name, super_list); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/octave-value/ov-fcn-handle.cc Wed May 22 13:57:30 2019 +0000 @@ -1834,11 +1834,11 @@ tree_evaluator& tw = interp.get_evaluator (); - octave::symbol_scope curr_scope = tw.get_current_scope (); + symbol_scope curr_scope = tw.get_current_scope (); octave_fcn_handle *fh = new octave_fcn_handle (curr_scope, tnm); - octave::call_stack& cs = interp.get_call_stack (); + call_stack& cs = interp.get_call_stack (); std::string dispatch_class; diff -r 097774bed4ed -r 84ff9953faa1 libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/octave-value/ov-java.cc Wed May 22 13:57:30 2019 +0000 @@ -251,7 +251,7 @@ void read_java_opts (const std::string& filename) { - std::string ascii_fname = octave::sys::get_ASCII_filename (filename); + std::string ascii_fname = sys::get_ASCII_filename (filename); std::ifstream js (ascii_fname.c_str ()); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/parse-tree/jit-typeinfo.cc --- a/libinterp/parse-tree/jit-typeinfo.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/parse-tree/jit-typeinfo.cc Wed May 22 13:57:30 2019 +0000 @@ -222,7 +222,7 @@ extern "C" void octave_jit_ginvalid_index (void) { - // FIXME: 0-argument form of octave::err_invalid_index removed in + // FIXME: 0-argument form of err_invalid_index removed in // cset dd6345fd8a97. Report -1 as the bad index for all // occurrences. err_invalid_index (static_cast (-1)); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/parse-tree/oct-parse.yy Wed May 22 13:57:30 2019 +0000 @@ -4317,7 +4317,7 @@ { // NAME should be an absolute file name and the file should exist. - std::string ascii_fname = octave::sys::get_ASCII_filename (name); + std::string ascii_fname = sys::get_ASCII_filename (name); std::ifstream fs (ascii_fname.c_str (), std::ios::in); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/parse-tree/pt-eval.cc Wed May 22 13:57:30 2019 +0000 @@ -577,7 +577,7 @@ { octave_value_list retval; - octave::unwind_protect frame; + unwind_protect frame; frame.protect_var (buffer_error_messages); buffer_error_messages++; @@ -592,9 +592,9 @@ { tmp = eval_string (try_code, nargout > 0, parse_status, nargout); } - catch (const octave::execution_exception&) + catch (const execution_exception&) { - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); execution_error = true; } @@ -629,7 +629,7 @@ const std::string& try_code, int nargout) { - octave::unwind_protect frame; + unwind_protect frame; frame.add_method (m_call_stack, &call_stack::restore_frame, m_call_stack.current_frame ()); @@ -653,7 +653,7 @@ { octave_value_list retval; - octave::unwind_protect frame; + unwind_protect frame; frame.add_method (m_call_stack, &call_stack::restore_frame, m_call_stack.current_frame ()); @@ -678,9 +678,9 @@ { tmp = eval_string (try_code, nargout > 0, parse_status, nargout); } - catch (const octave::execution_exception&) + catch (const execution_exception&) { - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); execution_error = true; } @@ -1090,14 +1090,14 @@ void tree_evaluator::enter_debugger (const std::string& prompt) { - octave::unwind_protect frame; - - frame.add_fcn (octave::command_history::ignore_entries, - octave::command_history::ignoring_entries ()); - - octave::command_history::ignore_entries (false); - - frame.add_method (m_call_stack, &octave::call_stack::restore_frame, + unwind_protect frame; + + frame.add_fcn (command_history::ignore_entries, + command_history::ignoring_entries ()); + + command_history::ignore_entries (false); + + frame.add_method (m_call_stack, &call_stack::restore_frame, m_call_stack.current_frame ()); // Go up to the nearest user code frame. @@ -1367,7 +1367,7 @@ // by geting a reference to the caller or base stack frame and // calling assign on that? - octave::unwind_protect frame; + unwind_protect frame; frame.add_method (m_call_stack, &call_stack::restore_frame, m_call_stack.current_frame ()); diff -r 097774bed4ed -r 84ff9953faa1 libinterp/parse-tree/pt-tm-const.cc --- a/libinterp/parse-tree/pt-tm-const.cc Tue May 21 19:50:59 2019 +0000 +++ b/libinterp/parse-tree/pt-tm-const.cc Wed May 22 13:57:30 2019 +0000 @@ -463,8 +463,7 @@ // // We might also start with a empty octave_value using // - // ctmp = octave::type_info::lookup_type - // (tmp.begin() -> begin() -> type_name()); + // ctmp = type_info::lookup_type (tmp.begin() -> begin() -> type_name()); // // and then directly resize. However, for some types there might be // some additional setup needed, and so this should be avoided. diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/chol.cc --- a/liboctave/numeric/chol.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/chol.cc Wed May 22 13:57:30 2019 +0000 @@ -58,7 +58,7 @@ if (r_nr != r_nc) (*current_liboctave_error_handler) ("chol2inv requires square matrix"); - F77_INT n = octave::to_f77_int (r_nc); + F77_INT n = to_f77_int (r_nc); F77_INT info; Matrix tmp = r; @@ -106,7 +106,7 @@ if (r_nr != r_nc) (*current_liboctave_error_handler) ("chol2inv requires square matrix"); - F77_INT n = octave::to_f77_int (r_nc); + F77_INT n = to_f77_int (r_nc); F77_INT info; FloatMatrix tmp = r; @@ -154,7 +154,7 @@ if (r_nr != r_nc) (*current_liboctave_error_handler) ("chol2inv requires square matrix"); - F77_INT n = octave::to_f77_int (r_nc); + F77_INT n = to_f77_int (r_nc); F77_INT info; ComplexMatrix tmp = r; @@ -199,7 +199,7 @@ if (r_nr != r_nc) (*current_liboctave_error_handler) ("chol2inv requires square matrix"); - F77_INT n = octave::to_f77_int (r_nc); + F77_INT n = to_f77_int (r_nc); F77_INT info; FloatComplexMatrix tmp = r; diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/gsvd.cc --- a/liboctave/numeric/gsvd.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/gsvd.cc Wed May 22 13:57:30 2019 +0000 @@ -55,7 +55,7 @@ if (gsvd_initialized) return; - octave::dynamic_library libs (""); + dynamic_library libs (""); if (! libs) { // FIXME: Should we throw an error if we cannot check the libraries? diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/oct-rand.cc --- a/liboctave/numeric/oct-rand.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/oct-rand.cc Wed May 22 13:57:30 2019 +0000 @@ -295,7 +295,7 @@ if (use_old_generators) F77_FUNC (dgenunf, DGENUNF) (0.0, 1.0, retval); else - retval = octave::rand_uniform (); + retval = rand_uniform (); return retval; } @@ -308,7 +308,7 @@ if (use_old_generators) F77_FUNC (dgennor, DGENNOR) (0.0, 1.0, retval); else - retval = octave::rand_normal (); + retval = rand_normal (); return retval; } @@ -321,7 +321,7 @@ if (use_old_generators) F77_FUNC (dgenexp, DGENEXP) (1.0, retval); else - retval = octave::rand_exponential (); + retval = rand_exponential (); return retval; } @@ -343,7 +343,7 @@ } } else - retval = octave::rand_poisson (a); + retval = rand_poisson (a); return retval; } @@ -361,7 +361,7 @@ F77_FUNC (dgengam, DGENGAM) (1.0, a, retval); } else - retval = octave::rand_gamma (a); + retval = rand_gamma (a); return retval; } @@ -374,7 +374,7 @@ if (use_old_generators) F77_FUNC (fgenunf, FGENUNF) (0.0f, 1.0f, retval); else - retval = octave::rand_uniform (); + retval = rand_uniform (); return retval; } @@ -387,7 +387,7 @@ if (use_old_generators) F77_FUNC (fgennor, FGENNOR) (0.0f, 1.0f, retval); else - retval = octave::rand_normal (); + retval = rand_normal (); return retval; } @@ -400,7 +400,7 @@ if (use_old_generators) F77_FUNC (fgenexp, FGENEXP) (1.0f, retval); else - retval = octave::rand_exponential (); + retval = rand_exponential (); return retval; } @@ -424,7 +424,7 @@ else { // Keep poisson distribution in double precision for accuracy - retval = octave::rand_poisson (a); + retval = rand_poisson (a); } return retval; @@ -443,7 +443,7 @@ F77_FUNC (fgengam, FGENGAM) (1.0f, a, retval); } else - retval = octave::rand_gamma (a); + retval = rand_gamma (a); return retval; } @@ -729,21 +729,21 @@ if (use_old_generators) std::generate_n (v, len, [](void) { float x; F77_FUNC (fgenunf, FGENUNF) (0.0f, 1.0f, x); return x; }); else - octave::rand_uniform (len, v); + rand_uniform (len, v); break; case normal_dist: if (use_old_generators) std::generate_n (v, len, [](void) { float x; F77_FUNC (fgennor, FGENNOR) (0.0f, 1.0f, x); return x; }); else - octave::rand_normal (len, v); + rand_normal (len, v); break; case expon_dist: if (use_old_generators) std::generate_n (v, len, [](void) { float x; F77_FUNC (fgenexp, FGENEXP) (1.0f, x); return x; }); else - octave::rand_exponential (len, v); + rand_exponential (len, v); break; case poisson_dist: @@ -760,7 +760,7 @@ } } else - octave::rand_poisson (a, len, v); + rand_poisson (a, len, v); break; case gamma_dist: @@ -772,7 +772,7 @@ std::generate_n (v, len, [a](void) { float x; F77_FUNC (fgengam, FGENGAM) (1.0f, a, x); return x; }); } else - octave::rand_gamma (a, len, v); + rand_gamma (a, len, v); break; default: diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/oct-rand.h --- a/liboctave/numeric/oct-rand.h Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/oct-rand.h Wed May 22 13:57:30 2019 +0000 @@ -53,8 +53,8 @@ // Return the current seed. static double seed (void) { - return instance_ok () ? instance->do_seed () - : octave::numeric_limits::NaN (); + return (instance_ok () + ? instance->do_seed () : numeric_limits::NaN ()); } // Set the seed. @@ -139,15 +139,15 @@ // Return the next number from the sequence. static double scalar (double a = 1.0) { - return instance_ok () ? instance->do_scalar (a) - : octave::numeric_limits::NaN (); + return (instance_ok () + ? instance->do_scalar (a) : numeric_limits::NaN ()); } // Return the next number from the sequence. static float float_scalar (float a = 1.0) { - return instance_ok () ? instance->do_scalar (a) - : octave::numeric_limits::NaN (); + return (instance_ok () + ? instance->do_scalar (a) : numeric_limits::NaN ()); } // Return an array of numbers from the sequence. @@ -173,8 +173,8 @@ // filled in column major order. static FloatNDArray float_nd_array (const dim_vector& dims, float a = 1.0) { - return instance_ok () ? instance->do_float_nd_array (dims, a) - : FloatNDArray (); + return (instance_ok () + ? instance->do_float_nd_array (dims, a) : FloatNDArray ()); } private: diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/randmtzig.cc --- a/liboctave/numeric/randmtzig.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/randmtzig.cc Wed May 22 13:57:30 2019 +0000 @@ -273,7 +273,7 @@ /* If there isn't enough entropy, gather some from various sources */ - octave::sys::time now; + sys::time now; if (n < MT_N) entropy[n++] = now.unix_time (); /* Current time in seconds */ diff -r 097774bed4ed -r 84ff9953faa1 liboctave/numeric/randpoisson.cc --- a/liboctave/numeric/randpoisson.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/randpoisson.cc Wed May 22 13:57:30 2019 +0000 @@ -178,7 +178,7 @@ { /* generate uniform number U -- U(0, p6) */ /* case distinction corresponding to U */ - if ((U = octave::rand_uniform () * p6) < p2) + if ((U = rand_uniform () * p6) < p2) { /* centre left */ /* immediate acceptance region @@ -190,7 +190,7 @@ /* computation of candidate X < k2, and its counterpart Y > k2 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = std::floor (dl * octave::rand_uniform ()) + 1.0; + Dk = std::floor (dl * rand_uniform ()) + 1.0; if (W <= f2 - Dk * (f2 - f2/r2)) { /* quick accept of */ return (k2 - Dk); /* X = k2 - Dk */ @@ -217,7 +217,7 @@ /* computation of candidate X > k4, and its counterpart Y < k4 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = std::floor (dr * octave::rand_uniform ()) + 1.0; + Dk = std::floor (dr * rand_uniform ()) + 1.0; if (W <= f4 - Dk * (f4 - f4*r4)) { /* quick accept of */ return (k4 + Dk); /* X = k4 + Dk */ @@ -235,7 +235,7 @@ } else { - W = octave::rand_uniform (); + W = rand_uniform (); if (U < p5) { /* expon. tail left */ Dk = std::floor (1.0 - std::log (W)/ll); @@ -299,7 +299,7 @@ while (i-- > 0) { - double u = octave::rand_uniform (); + double u = rand_uniform (); /* If u > 0.458 we know we can jump to floor(lambda) before * comparing (this observation is based on Stadlober's winrand @@ -358,12 +358,12 @@ { do { - y = tan (M_PI*octave::rand_uniform ()); + y = tan (M_PI*rand_uniform ()); em = sq * y + lambda; } while (em < 0.0); em = std::floor (em); t = 0.9*(1.0+y*y)*exp (em*alxm-flogfak (em)-g); - } while (octave::rand_uniform () > t); + } while (rand_uniform () > t); p[i] = em; } } diff -r 097774bed4ed -r 84ff9953faa1 liboctave/system/file-ops.cc --- a/liboctave/system/file-ops.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/system/file-ops.cc Wed May 22 13:57:30 2019 +0000 @@ -75,7 +75,7 @@ if (s_len == 0 || s[0] == '~') return 0; - string_vector prefixes = octave::sys::file_ops::tilde_additional_prefixes; + string_vector prefixes = sys::file_ops::tilde_additional_prefixes; if (! prefixes.empty ()) { @@ -105,13 +105,13 @@ { size_t s_len = s.length (); - string_vector suffixes = octave::sys::file_ops::tilde_additional_suffixes; + string_vector suffixes = sys::file_ops::tilde_additional_suffixes; size_t i = 0; for ( ; i < s_len; i++) { - if (octave::sys::file_ops::is_dir_sep (s[i])) + if (sys::file_ops::is_dir_sep (s[i])) break; if (! suffixes.empty ()) @@ -138,7 +138,7 @@ size_t len = 1; - while (len < f_len && ! octave::sys::file_ops::is_dir_sep (fname[len])) + while (len < f_len && ! sys::file_ops::is_dir_sep (fname[len])) len++; return fname.substr (1, len); @@ -159,8 +159,8 @@ // of $HOME or the home directory of the current user, regardless of // any preexpansion hook. - if (f_len == 1 || octave::sys::file_ops::is_dir_sep (filename[1])) - return octave::sys::env::get_home_directory () + filename.substr (1); + if (f_len == 1 || sys::file_ops::is_dir_sep (filename[1])) + return sys::env::get_home_directory () + filename.substr (1); std::string username = isolate_tilde_prefix (filename); @@ -168,10 +168,10 @@ std::string dirname; - if (octave::sys::file_ops::tilde_expansion_preexpansion_hook) + if (sys::file_ops::tilde_expansion_preexpansion_hook) { std::string expansion - = octave::sys::file_ops::tilde_expansion_preexpansion_hook (username); + = sys::file_ops::tilde_expansion_preexpansion_hook (username); if (! expansion.empty ()) return expansion + filename.substr (user_len+1); @@ -180,17 +180,17 @@ // No preexpansion hook, or the preexpansion hook failed. Look in the // password database. - octave::sys::password pw = octave::sys::password::getpwnam (username); + sys::password pw = sys::password::getpwnam (username); if (! pw) { // If the calling program has a special syntax for expanding tildes, // and we couldn't find a standard expansion, then let them try. - if (octave::sys::file_ops::tilde_expansion_failure_hook) + if (sys::file_ops::tilde_expansion_failure_hook) { std::string expansion - = octave::sys::file_ops::tilde_expansion_failure_hook (username); + = sys::file_ops::tilde_expansion_failure_hook (username); if (! expansion.empty ()) dirname = expansion + filename.substr (user_len+1); diff -r 097774bed4ed -r 84ff9953faa1 liboctave/system/lo-sysdep.cc --- a/liboctave/system/lo-sysdep.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/system/lo-sysdep.cc Wed May 22 13:57:30 2019 +0000 @@ -179,7 +179,7 @@ #if defined (OCTAVE_USE_WINDOWS_API) wchar_t *wnew_item = u8_to_wchar (new_item); - octave::unwind_protect frame; + unwind_protect frame; frame.add_fcn (std::free, static_cast (new_item)); if (_wputenv (wnew_item) < 0) (*current_liboctave_error_handler) ("putenv (%s) failed", new_item); @@ -374,7 +374,7 @@ if (test_dir.empty ()) { std::string msg; - int status = octave::sys::mkdir (oct_ascii_dir, 0777, msg); + int status = sys::mkdir (oct_ascii_dir, 0777, msg); if (status < 0) return orig_file_name; @@ -386,12 +386,12 @@ // Create file from hash of full filename. std::string filename_hash = (oct_ascii_dir + file_ops::dir_sep_str () - + octave::crypto::hash ("SHA1", orig_file_name)); + + crypto::hash ("SHA1", orig_file_name)); std::string abs_filename_hash = canonicalize_file_name (filename_hash); if (! abs_filename_hash.empty ()) - octave::sys::unlink (filename_hash); + sys::unlink (filename_hash); wchar_t w_filename_hash[filename_hash.length ()+1] = {0}; diff -r 097774bed4ed -r 84ff9953faa1 liboctave/util/file-info.cc --- a/liboctave/util/file-info.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/util/file-info.cc Wed May 22 13:57:30 2019 +0000 @@ -81,7 +81,7 @@ size_t sz = fs.size (); - std::string ascii_fname = octave::sys::get_ASCII_filename (fname); + std::string ascii_fname = sys::get_ASCII_filename (fname); std::ifstream file (ascii_fname.c_str (), std::ios::in | std::ios::binary); diff -r 097774bed4ed -r 84ff9953faa1 liboctave/util/oct-glob.cc --- a/liboctave/util/oct-glob.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/util/oct-glob.cc Wed May 22 13:57:30 2019 +0000 @@ -44,7 +44,7 @@ static bool single_match_exists (const std::string& file) { - octave::sys::file_stat s (file); + sys::file_stat s (file); return s.exists (); } diff -r 097774bed4ed -r 84ff9953faa1 liboctave/util/oct-sparse.cc --- a/liboctave/util/oct-sparse.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/util/oct-sparse.cc Wed May 22 13:57:30 2019 +0000 @@ -39,7 +39,7 @@ // FIXME: maybe it would be better to make this a configure check and // disable suitesparse if it fails? - if (sizeof (octave::suitesparse_integer) != sizeof (octave_idx_type)) + if (sizeof (suitesparse_integer) != sizeof (octave_idx_type)) (*current_liboctave_error_handler) ("size of suitesparse integer does not match octave_idx_type!"); } diff -r 097774bed4ed -r 84ff9953faa1 liboctave/util/url-transfer.cc --- a/liboctave/util/url-transfer.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/util/url-transfer.cc Wed May 22 13:57:30 2019 +0000 @@ -203,8 +203,7 @@ else { // FIXME: Does ascii mode need to be flagged here? - std::string ascii_fname - = octave::sys::get_ASCII_filename (realfile); + std::string ascii_fname = sys::get_ASCII_filename (realfile); std::ifstream ifile (ascii_fname.c_str (), std::ios::in | std::ios::binary);