changeset 29950:6549fa7558ba

eliminate some unnecessary octave:: namespace tags Where possible, remove octave:: namespace tags used inside a "namespace octave" block. Files affected: event-manager.cc, hook-fcn.cc, input.cc, latex-text-renderer.cc, oct-hist.cc, sysdep.cc, cdef-object.cc, cdef-object.h, oct-parse.yy, pt-eval.cc, CollocWt.cc, oct-convn.cc, oct-norm.cc, file-ops.cc.
author John W. Eaton <jwe@octave.org>
date Fri, 13 Aug 2021 14:08:16 -0400
parents f254c302bb9c
children 381082ed261d
files libinterp/corefcn/event-manager.cc libinterp/corefcn/hook-fcn.cc libinterp/corefcn/input.cc libinterp/corefcn/latex-text-renderer.cc libinterp/corefcn/oct-hist.cc libinterp/corefcn/sysdep.cc libinterp/octave-value/cdef-object.cc libinterp/octave-value/cdef-object.h libinterp/parse-tree/oct-parse.yy libinterp/parse-tree/pt-eval.cc liboctave/numeric/CollocWt.cc liboctave/numeric/oct-convn.cc liboctave/numeric/oct-norm.cc liboctave/system/file-ops.cc
diffstat 14 files changed, 37 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/event-manager.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/event-manager.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -186,7 +186,7 @@
   void event_manager::set_history (void)
   {
     if (enabled ())
-      instance->set_history (octave::command_history::list ());
+      instance->set_history (command_history::list ());
   }
 }
 
--- a/libinterp/corefcn/hook-fcn.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/hook-fcn.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -55,7 +55,7 @@
     if (m_data.is_defined ())
       args.append (m_data);
 
-    octave::feval (m_name, args, 0);
+    feval (m_name, args, 0);
   }
 
   void fcn_handle_hook_function::eval (const octave_value_list& initial_args)
@@ -65,6 +65,6 @@
     if (m_data.is_defined ())
       args.append (m_data);
 
-    octave::feval (m_fcn_handle, args, 0);
+    feval (m_fcn_handle, args, 0);
   }
 }
--- a/libinterp/corefcn/input.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/input.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -908,7 +908,7 @@
     file_reader (interpreter& interp, FILE *f_arg)
       : base_reader (interp), m_file (f_arg)
     {
-      octave::input_system& input_sys = interp.get_input_system ();
+      input_system& input_sys = interp.get_input_system ();
       m_encoding = input_sys.mfile_encoding ();
     }
 
--- a/libinterp/corefcn/latex-text-renderer.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/latex-text-renderer.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -84,7 +84,7 @@
     ~latex_renderer (void)
       {
         if (! m_tmp_dir.empty () && ! m_debug)
-          octave::sys::recursive_rmdir (m_tmp_dir);
+          sys::recursive_rmdir (m_tmp_dir);
       }
 
     void set_font (const std::string& /*name*/, const std::string& /*weight*/,
@@ -211,9 +211,9 @@
     if (m_tmp_dir.empty ())
       {
         //Create the temporary directory
-        m_tmp_dir = octave::sys::tempnam ("", "latex");
+        m_tmp_dir = sys::tempnam ("", "latex");
 
-        if (octave::sys::mkdir (m_tmp_dir, 0700) != 0)
+        if (sys::mkdir (m_tmp_dir, 0700) != 0)
           {
             warning_with_id ("Octave:LaTeX:internal-error",
                              "latex_renderer: unable to create temp directory");
@@ -222,7 +222,7 @@
       }
 
     std::string base_file_name
-      = octave::sys::file_ops::concat (m_tmp_dir, "default");
+      = sys::file_ops::concat (m_tmp_dir, "default");
 
     // Duplicate \n characters and align multi-line strings based on
     // horizontalalignment
@@ -296,14 +296,14 @@
         alpha = retval(2).xuint8_array_value ("latex_renderer::read_image: "
                                               "Wrong type for alpha");
       }
-    catch (const octave::execution_exception& ee)
+    catch (const execution_exception& ee)
       {
         warning_with_id ("Octave:LaTeX:internal-error",
                          "latex_renderer:: failed to read png data. %s",
                          ee.message ().c_str ());
 
-        octave::interpreter& interp
-          = octave::__get_interpreter__ ("latex_renderer::read_image");
+        interpreter& interp
+          = __get_interpreter__ ("latex_renderer::read_image");
 
         interp.recover_from_exception ();
 
--- a/libinterp/corefcn/oct-hist.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/oct-hist.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -463,7 +463,7 @@
     volatile interrupt_handler old_interrupt_handler
       = ignore_interrupts ();
 
-    int status = octave::sys::system (cmd);
+    int status = sys::system (cmd);
 
     set_interrupt_handler (old_interrupt_handler);
 
--- a/libinterp/corefcn/sysdep.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/corefcn/sysdep.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -698,8 +698,8 @@
   FILE * popen (const char *command, const char *mode)
   {
 #if defined (__MINGW32__) || defined (_MSC_VER)
-    std::wstring wcommand = octave::sys::u8_to_wstring (command);
-    std::wstring wmode = octave::sys::u8_to_wstring (mode);
+    std::wstring wcommand = sys::u8_to_wstring (command);
+    std::wstring wmode = sys::u8_to_wstring (mode);
 
     // Use binary mode on Windows if unspecified
     if (wmode.length () < 2)
--- a/libinterp/octave-value/cdef-object.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/octave-value/cdef-object.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -500,7 +500,7 @@
   }
 
   void
-  cdef_object_scalar::break_closure_cycles (const std::shared_ptr<octave::stack_frame>& frame)
+  cdef_object_scalar::break_closure_cycles (const std::shared_ptr<stack_frame>& frame)
   {
     for (octave_idx_type i = 0; i < map.nfields (); i++)
       map.contents(i).break_closure_cycles (frame);
--- a/libinterp/octave-value/cdef-object.h	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/octave-value/cdef-object.h	Fri Aug 13 14:08:16 2021 -0400
@@ -120,7 +120,7 @@
       err_invalid_object ("get_property");
     }
 
-    virtual void break_closure_cycles (const std::shared_ptr<octave::stack_frame>&)
+    virtual void break_closure_cycles (const std::shared_ptr<stack_frame>&)
     {
       err_invalid_object ("break_closure_cycles");
     }
@@ -281,7 +281,7 @@
       return rep->get_property (idx, pname);
     }
 
-    void break_closure_cycles (const std::shared_ptr<octave::stack_frame>& frame)
+    void break_closure_cycles (const std::shared_ptr<stack_frame>& frame)
     {
       rep->break_closure_cycles (frame);
     }
@@ -466,7 +466,7 @@
 
     dim_vector dims (void) const { return dim_vector (1, 1); }
 
-    void break_closure_cycles (const std::shared_ptr<octave::stack_frame>& frame);
+    void break_closure_cycles (const std::shared_ptr<stack_frame>& frame);
 
     void put (const std::string& pname, const octave_value& val)
     {
--- a/libinterp/parse-tree/oct-parse.yy	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/parse-tree/oct-parse.yy	Fri Aug 13 14:08:16 2021 -0400
@@ -5536,7 +5536,7 @@
     unwind_action act ([=] (void) { ::fclose (ffile); });
 
     // get the encoding for this folder
-    octave::input_system& input_sys = interp.get_input_system ();
+    input_system& input_sys = interp.get_input_system ();
     parser parser (ffile, interp, input_sys.dir_encoding (dir_name));
 
     parser.m_curr_class_name = dispatch_type;
@@ -5618,7 +5618,7 @@
           }
       }
 
-    std::shared_ptr<octave::tree_statement_list> tmp_lst (lst);
+    std::shared_ptr<tree_statement_list> tmp_lst (lst);
 
     statement_list (tmp_lst);
 
--- a/libinterp/parse-tree/pt-eval.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/libinterp/parse-tree/pt-eval.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -189,7 +189,7 @@
 
             command_editor::run_event_hooks ();
 
-            octave::sleep (0.1);
+            sleep (0.1);
           }
         catch (const interrupt_exception&)
           {
@@ -899,7 +899,7 @@
 
             command_editor::run_event_hooks ();
 
-            octave::sleep (0.1);
+            sleep (0.1);
           }
         catch (const interrupt_exception&)
           {
--- a/liboctave/numeric/CollocWt.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/liboctave/numeric/CollocWt.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -233,7 +233,7 @@
             // Famous last words:  100 iterations should be more than
             // enough in all cases.
 
-            if (++k > 100 || octave::math::isnan (z))
+            if (++k > 100 || math::isnan (z))
               return false;
 
             if (std::abs (z) <= 100 * std::numeric_limits<double>::epsilon ())
--- a/liboctave/numeric/oct-convn.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/liboctave/numeric/oct-convn.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -112,11 +112,11 @@
   {
     if (nd == 2)
       {
-        F77_INT ad0 = octave::to_f77_int (ad(0));
-        F77_INT ad1 = octave::to_f77_int (ad(1));
+        F77_INT ad0 = to_f77_int (ad(0));
+        F77_INT ad1 = to_f77_int (ad(1));
 
-        F77_INT bd0 = octave::to_f77_int (bd(0));
-        F77_INT bd1 = octave::to_f77_int (bd(1));
+        F77_INT bd0 = to_f77_int (bd(0));
+        F77_INT bd1 = to_f77_int (bd(1));
 
         convolve_2d<T, R> (a, ad0, ad1, b, bd0, bd1, c, inner);
       }
@@ -186,10 +186,10 @@
     if (ct == convn_same)
       {
         // Pick the relevant part.
-        Array<octave::idx_vector> sidx (dim_vector (nd, 1));
+        Array<idx_vector> sidx (dim_vector (nd, 1));
 
         for (int i = 0; i < nd; i++)
-          sidx(i) = octave::idx_vector::make_range (bdims(i)/2, 1, adims(i));
+          sidx(i) = idx_vector::make_range (bdims(i)/2, 1, adims(i));
         c = c.index (sidx);
       }
 
--- a/liboctave/numeric/oct-norm.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/liboctave/numeric/oct-norm.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -184,8 +184,8 @@
     template <typename U>
     void accum (U val)
     {
-      if (octave::math::isnan (val))
-        max = octave::numeric_limits<R>::NaN ();
+      if (math::isnan (val))
+        max = numeric_limits<R>::NaN ();
       else
         max = std::max (max, std::abs (val));
     }
@@ -198,12 +198,12 @@
   {
     R min;
   public:
-    norm_accumulator_minf () : min (octave::numeric_limits<R>::Inf ()) { }
+    norm_accumulator_minf () : min (numeric_limits<R>::Inf ()) { }
     template <typename U>
     void accum (U val)
     {
-      if (octave::math::isnan (val))
-        min = octave::numeric_limits<R>::NaN ();
+      if (math::isnan (val))
+        min = numeric_limits<R>::NaN ();
       else
         min = std::min (min, std::abs (val));
     }
@@ -407,7 +407,7 @@
   template <typename T, typename R>
   inline T elem_dual_p (T x, R p)
   {
-    return octave::math::signum (x) * std::pow (std::abs (x), p-1);
+    return math::signum (x) * std::pow (std::abs (x), p-1);
   }
 
   // the VectorT is used for vectors, but actually it has to be
@@ -494,8 +494,7 @@
     R res = 0;
     if (p == 2)
       {
-        octave::math::svd<MatrixT> fact
-          (m, octave::math::svd<MatrixT>::Type::sigma_only);
+        math::svd<MatrixT> fact (m, math::svd<MatrixT>::Type::sigma_only);
         res = fact.singular_values () (0,0);
       }
     else if (p == 1)
--- a/liboctave/system/file-ops.cc	Tue Aug 10 16:42:29 2021 -0400
+++ b/liboctave/system/file-ops.cc	Fri Aug 13 14:08:16 2021 -0400
@@ -713,7 +713,7 @@
           return retval;
         }
 
-      octave::unwind_action close_file_handle (CloseHandle, h_file);
+      unwind_action close_file_handle (CloseHandle, h_file);
 
       const std::size_t buf_size = 32767;
       wchar_t buffer[buf_size] = L"";