Mercurial > octave
diff libinterp/corefcn/load-path.cc @ 23696:08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
* octave-gui.cc, dynamic-ld.h, ft-text-renderer.cc, gl-render.cc,
gl-render.h, gl2ps-print.cc, input.cc, input.h, interpreter.cc,
load-path.cc, load-path.h, oct-stream.cc, sighandlers.cc, symtab.cc,
symtab.h, __ode15__.cc, gzip.cc, octave.cc, lex.ll, oct-parse.in.yy,
parse.h, pt-arg-list.cc, pt-arg-list.h, pt-array-list.h,
pt-classdef.h, pt-decl.h, pt-eval.cc, pt-eval.h, pt-exp.h,
pt-fcn-handle.cc, pt-idx.cc, pt-misc.h, pt-select.h, pt-stmt.h,
pt-tm-const.cc, pt-tm-const.h, pt.cc, aepbalance.cc, chol.cc,
gepbalance.cc, gsvd.cc, hess.cc, lo-mappers.h, lo-specfun.cc, lu.cc,
qr.cc, qrp.cc, schur.cc, sparse-chol.cc, sparse-lu.cc, sparse-qr.cc,
svd.cc, child-list.cc, dir-ops.cc, file-ops.cc, file-stat.cc,
file-stat.h, lo-sysdep.cc, oct-env.cc, oct-syscalls.cc, cmd-edit.cc,
cmd-hist.cc, oct-glob.cc, oct-locbuf.cc, oct-mutex.cc, oct-mutex.h,
oct-shlib.cc, oct-shlib.h, pathsearch.cc, url-transfer.cc,
url-transfer.h: Remove octave:: namespace tag from symbols used
inside octave namespace.
* oct-conf-post.in.h (OCTAVE_USE_DEPRECATED_FUNCTIONS): Don't define.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 26 Jun 2017 09:05:37 -0400 |
parents | b9378eff6d13 |
children | 06579337237b |
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc Mon Jun 26 09:02:21 2017 -0400 +++ b/libinterp/corefcn/load-path.cc Mon Jun 26 09:05:37 2017 -0400 @@ -226,7 +226,7 @@ std::string tpath = load_path::m_command_line_path; if (tpath.empty ()) - tpath = octave::sys::env::getenv ("OCTAVE_PATH"); + tpath = sys::env::getenv ("OCTAVE_PATH"); std::string xpath; @@ -235,7 +235,7 @@ xpath = tpath; if (! sys_path.empty ()) - xpath += octave::directory_path::path_sep_str () + sys_path; + xpath += directory_path::path_sep_str () + sys_path; } else xpath = sys_path; @@ -279,7 +279,7 @@ // Temporarily disable add hook. - octave::unwind_protect frame; + unwind_protect frame; frame.protect_var (add_hook); add_hook = 0; @@ -334,7 +334,7 @@ } else { - std::string dir = octave::sys::file_ops::tilde_expand (dir_arg); + std::string dir = sys::file_ops::tilde_expand (dir_arg); dir = strip_trailing_separators (dir); @@ -429,10 +429,10 @@ { std::string retval; - if (octave::sys::env::absolute_pathname (file) - || octave::sys::env::rooted_relative_pathname (file)) + if (sys::env::absolute_pathname (file) + || sys::env::rooted_relative_pathname (file)) { - octave::sys::file_stat fs (file); + sys::file_stat fs (file); return fs.exists () ? file : retval; } @@ -444,16 +444,16 @@ return tfile; } - if (file.find_first_of (octave::sys::file_ops::dir_sep_chars ()) + if (file.find_first_of (sys::file_ops::dir_sep_chars ()) != std::string::npos) { // Given name has a directory separator, so append it to each // element of the load path in turn. for (const auto& di : dir_info_list) { - std::string tfile = octave::sys::file_ops::concat (di.dir_name, file); - - octave::sys::file_stat fs (tfile); + std::string tfile = sys::file_ops::concat (di.dir_name, file); + + sys::file_stat fs (tfile); if (fs.exists ()) return tfile; @@ -471,7 +471,7 @@ for (octave_idx_type i = 0; i < len; i++) { if (all_files[i] == file) - return octave::sys::file_ops::concat (di.dir_name, file); + return sys::file_ops::concat (di.dir_name, file); } } } @@ -484,11 +484,11 @@ { std::string retval; - if (dir.find_first_of (octave::sys::file_ops::dir_sep_chars ()) != std::string::npos - && (octave::sys::env::absolute_pathname (dir) - || octave::sys::env::rooted_relative_pathname (dir))) + if (dir.find_first_of (sys::file_ops::dir_sep_chars ()) != std::string::npos + && (sys::env::absolute_pathname (dir) + || sys::env::rooted_relative_pathname (dir))) { - octave::sys::file_stat fs (dir); + sys::file_stat fs (dir); if (fs.exists () && fs.is_dir ()) return dir; @@ -497,12 +497,12 @@ { for (const auto& di : dir_info_list) { - std::string dname = octave::sys::env::make_absolute (di.dir_name); + std::string dname = sys::env::make_absolute (di.dir_name); size_t dname_len = dname.length (); if (dname.substr (dname_len - 1) - == octave::sys::file_ops::dir_sep_str ()) + == sys::file_ops::dir_sep_str ()) { dname = dname.substr (0, dname_len - 1); dname_len--; @@ -511,10 +511,10 @@ size_t dir_len = dir.length (); if (dname_len > dir_len - && octave::sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) + && sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) && dir == dname.substr (dname_len - dir_len)) { - octave::sys::file_stat fs (di.dir_name); + sys::file_stat fs (di.dir_name); if (fs.exists () && fs.is_dir ()) return di.dir_name; @@ -530,11 +530,11 @@ { std::list<std::string> retlist; - if (dir.find_first_of (octave::sys::file_ops::dir_sep_chars ()) != std::string::npos - && (octave::sys::env::absolute_pathname (dir) - || octave::sys::env::rooted_relative_pathname (dir))) + if (dir.find_first_of (sys::file_ops::dir_sep_chars ()) != std::string::npos + && (sys::env::absolute_pathname (dir) + || sys::env::rooted_relative_pathname (dir))) { - octave::sys::file_stat fs (dir); + sys::file_stat fs (dir); if (fs.exists () && fs.is_dir ()) retlist.push_back (dir); @@ -543,12 +543,12 @@ { for (const auto& di : dir_info_list) { - std::string dname = octave::sys::env::make_absolute (di.dir_name); + std::string dname = sys::env::make_absolute (di.dir_name); size_t dname_len = dname.length (); if (dname.substr (dname_len - 1) - == octave::sys::file_ops::dir_sep_str ()) + == sys::file_ops::dir_sep_str ()) { dname = dname.substr (0, dname_len - 1); dname_len--; @@ -557,10 +557,10 @@ size_t dir_len = dir.length (); if (dname_len > dir_len - && octave::sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) + && sys::file_ops::is_dir_sep (dname[dname_len - dir_len - 1]) && dir == dname.substr (dname_len - dir_len)) { - octave::sys::file_stat fs (di.dir_name); + sys::file_stat fs (di.dir_name); if (fs.exists () && fs.is_dir ()) retlist.push_back (di.dir_name); @@ -588,13 +588,13 @@ { std::string file = flist[i]; - if (file.find_first_of (octave::sys::file_ops::dir_sep_chars ()) + if (file.find_first_of (sys::file_ops::dir_sep_chars ()) != std::string::npos) { - if (octave::sys::env::absolute_pathname (file) - || octave::sys::env::rooted_relative_pathname (file)) + if (sys::env::absolute_pathname (file) + || sys::env::rooted_relative_pathname (file)) { - octave::sys::file_stat fs (file); + sys::file_stat fs (file); if (fs.exists ()) return file; @@ -604,9 +604,9 @@ for (const auto& di : dir_info_list) { std::string tfile; - tfile = octave::sys::file_ops::concat (di.dir_name, file); - - octave::sys::file_stat fs (tfile); + tfile = sys::file_ops::concat (di.dir_name, file); + + sys::file_stat fs (tfile); if (fs.exists ()) return tfile; @@ -643,7 +643,7 @@ done: if (! dir_name.empty ()) - retval = octave::sys::file_ops::concat (dir_name, file_name); + retval = sys::file_ops::concat (dir_name, file_name); return retval; } @@ -665,13 +665,13 @@ { std::string file = flist[i]; - if (file.find_first_of (octave::sys::file_ops::dir_sep_chars ()) + if (file.find_first_of (sys::file_ops::dir_sep_chars ()) != std::string::npos) { - if (octave::sys::env::absolute_pathname (file) - || octave::sys::env::rooted_relative_pathname (file)) + if (sys::env::absolute_pathname (file) + || sys::env::rooted_relative_pathname (file)) { - octave::sys::file_stat fs (file); + sys::file_stat fs (file); if (fs.exists ()) retlist.push_back (file); @@ -681,9 +681,9 @@ for (const auto& di : dir_info_list) { std::string tfile; - tfile = octave::sys::file_ops::concat (di.dir_name, file); - - octave::sys::file_stat fs (tfile); + tfile = sys::file_ops::concat (di.dir_name, file); + + sys::file_stat fs (tfile); if (fs.exists ()) retlist.push_back (tfile); @@ -707,7 +707,7 @@ for (octave_idx_type j = 0; j < rel_flen; j++) { if (all_files[i] == rel_flist[j]) - retlist.push_back (octave::sys::file_ops::concat (di.dir_name, + retlist.push_back (sys::file_ops::concat (di.dir_name, rel_flist[j])); } } @@ -789,7 +789,7 @@ xpath = xdirs[0]; for (octave_idx_type i = 1; i < len; i++) - xpath += octave::directory_path::path_sep_str () + xdirs[i]; + xpath += directory_path::path_sep_str () + xdirs[i]; return xpath; } @@ -850,7 +850,7 @@ load_path::const_dir_info_list_iterator load_path::find_dir_info (const std::string& dir_arg) const { - std::string dir = octave::sys::file_ops::tilde_expand (dir_arg); + std::string dir = sys::file_ops::tilde_expand (dir_arg); const_dir_info_list_iterator retval = dir_info_list.begin (); @@ -868,7 +868,7 @@ load_path::dir_info_list_iterator load_path::find_dir_info (const std::string& dir_arg) { - std::string dir = octave::sys::file_ops::tilde_expand (dir_arg); + std::string dir = sys::file_ops::tilde_expand (dir_arg); dir_info_list_iterator retval = dir_info_list.begin (); @@ -936,7 +936,7 @@ warning_with_id ("Octave:recursive-path-search", "trailing '//' is no longer special in search path elements"); - std::string dir = octave::sys::file_ops::tilde_expand (dir_arg); + std::string dir = sys::file_ops::tilde_expand (dir_arg); dir = strip_trailing_separators (dir); @@ -946,7 +946,7 @@ move (i, at_end); else { - octave::sys::file_stat fs (dir); + sys::file_stat fs (dir); if (fs) { @@ -1068,7 +1068,7 @@ { load_path::dir_info::fcn_file_map_type retval; - octave::sys::dir_entry dir (d); + sys::dir_entry dir (d); if (dir) { @@ -1116,7 +1116,7 @@ void load_path::dir_info::update (void) { - octave::sys::file_stat fs (dir_name); + sys::file_stat fs (dir_name); if (! fs) { @@ -1129,7 +1129,7 @@ { try { - std::string abs_name = octave::sys::env::make_absolute (dir_name); + std::string abs_name = sys::env::make_absolute (dir_name); const_abs_dir_cache_iterator p = abs_dir_cache.find (abs_name); @@ -1165,11 +1165,11 @@ initialize (); } } - catch (const octave::execution_exception&) + catch (const execution_exception&) { // Skip updating if we don't know where we are, // but don't treat it as an error. - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); } } // Absolute path, check timestamp to see whether it requires re-caching @@ -1202,11 +1202,11 @@ void load_path::dir_info::initialize (void) { - is_relative = ! octave::sys::env::absolute_pathname (dir_name); - - dir_time_last_checked = octave::sys::time (static_cast<time_t> (0)); - - octave::sys::file_stat fs (dir_name); + is_relative = ! sys::env::absolute_pathname (dir_name); + + dir_time_last_checked = sys::time (static_cast<time_t> (0)); + + sys::file_stat fs (dir_name); if (fs) { @@ -1214,13 +1214,13 @@ package_dir_map.clear (); dir_mtime = fs.mtime (); - dir_time_last_checked = octave::sys::time (); + dir_time_last_checked = sys::time (); get_file_list (dir_name); try { - std::string abs_name = octave::sys::env::make_absolute (dir_name); + std::string abs_name = sys::env::make_absolute (dir_name); // FIXME: nothing is ever removed from this cache of // directory information, so there could be some resource @@ -1228,12 +1228,12 @@ abs_dir_cache[abs_name] = *this; } - catch (const octave::execution_exception&) + catch (const execution_exception&) { // Skip updating if we don't know where we are but don't treat // it as an error. - octave::interpreter::recover_from_exception (); + interpreter::recover_from_exception (); } } else @@ -1246,7 +1246,7 @@ void load_path::dir_info::get_file_list (const std::string& d) { - octave::sys::dir_entry dir (d); + sys::dir_entry dir (d); if (dir) { @@ -1264,9 +1264,9 @@ { std::string fname = flist[i]; - std::string full_name = octave::sys::file_ops::concat (d, fname); - - octave::sys::file_stat fs (full_name); + std::string full_name = sys::file_ops::concat (d, fname); + + sys::file_stat fs (full_name); if (fs) { @@ -1323,9 +1323,9 @@ { method_file_map[class_name].method_file_map = get_fcn_files (d); - std::string pd = octave::sys::file_ops::concat (d, "private"); - - octave::sys::file_stat fs (pd); + std::string pd = sys::file_ops::concat (d, "private"); + + sys::file_stat fs (pd); if (fs && fs.is_dir ()) method_file_map[class_name].private_file_map = get_fcn_files (pd); @@ -1393,7 +1393,7 @@ for (const auto& dir_fnlst : private_fcn_map) { os << "\n*** private functions in " - << octave::sys::file_ops::concat (dir_fnlst.first, "private") + << sys::file_ops::concat (dir_fnlst.first, "private") << ":\n\n"; print_fcn_list (os, dir_fnlst.second); @@ -1480,7 +1480,7 @@ for (const auto& fi : file_info_list) { - retval = octave::sys::file_ops::concat (fi.dir_name, fcn); + retval = sys::file_ops::concat (fi.dir_name, fcn); if (check_file_type (retval, type, fi.types, fcn, "load_path::find_fcn")) @@ -1517,7 +1517,7 @@ if (p != m.end ()) { std::string fname - = octave::sys::file_ops::concat (octave::sys::file_ops::concat (dir, "private"), fcn); + = sys::file_ops::concat (sys::file_ops::concat (dir, "private"), fcn); if (check_file_type (fname, type, p->second, fcn, "load_path::find_private_fcn")) @@ -1554,7 +1554,7 @@ for (const auto& fi : file_info_list) { - retval = octave::sys::file_ops::concat (fi.dir_name, meth); + retval = sys::file_ops::concat (fi.dir_name, meth); bool found = check_file_type (retval, type, fi.types, meth, "load_path::find_method"); @@ -1683,12 +1683,12 @@ { if (file_info_list.empty ()) { - octave::symbol_table& symtab - = octave::__get_symbol_table__ ("load_path::package_info::add_to_fcn_map"); + symbol_table& symtab + = __get_symbol_table__ ("load_path::package_info::add_to_fcn_map"); if (symtab.is_built_in_function_name (base)) { - std::string fcn_path = octave::sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a built-in function", @@ -1710,7 +1710,7 @@ && sys_path.find (old.dir_name) != std::string::npos && in_path_list (sys_path, old.dir_name)) { - std::string fcn_path = octave::sys::file_ops::concat (dir_name, fname); + std::string fcn_path = sys::file_ops::concat (dir_name, fname); warning_with_id ("Octave:shadowed-function", "function %s shadows a core library function", @@ -1759,7 +1759,7 @@ fcn_map_type& fm = method_map[class_name]; std::string full_dir_name - = octave::sys::file_ops::concat (dir_name, "@" + class_name); + = sys::file_ops::concat (dir_name, "@" + class_name); const dir_info::class_info& ci = cls_ci.second; @@ -1867,7 +1867,7 @@ fcn_map_type& fn_map = cls_fnmap.second; std::string full_dir_name - = octave::sys::file_ops::concat (dir_name, "@" + class_name); + = sys::file_ops::concat (dir_name, "@" + class_name); for (auto& nm_filst : fn_map) { @@ -1958,7 +1958,7 @@ fcn_map_type& fn_map = cls_fnmap.second; std::string full_dir_name - = octave::sys::file_ops::concat (dir, "@" + class_name); + = sys::file_ops::concat (dir, "@" + class_name); for (auto& nm_filst : fn_map) { @@ -2129,7 +2129,7 @@ { std::string retval; - octave::sys::dir_entry dir (dirname); + sys::dir_entry dir (dirname); if (dir) { @@ -2157,12 +2157,12 @@ if (! skip_p) { - std::string nm = octave::sys::file_ops::concat (dirname, elt); - - octave::sys::file_stat fs (nm); + std::string nm = sys::file_ops::concat (dirname, elt); + + sys::file_stat fs (nm); if (fs && fs.is_dir ()) - retval += octave::directory_path::path_sep_str () + genpath (nm, skip); + retval += directory_path::path_sep_str () + genpath (nm, skip); } } }