diff libinterp/corefcn/file-io.cc @ 20463:7ac907da9fba

Use error() rather than ::error() unless explicitly required. * resource-manager.cc (instance_ok), shortcut-manager.cc (instance_ok), daspk.cc (DASPK_ABORT, DASPK_ABORT2), dasrt.cc (DASRT_ABORT, DASRT_ABORT2), dassl.cc (DASSL_ABORT, DASSL_ABORT2), debug.cc (instance_ok), display.cc (instance_ok), dynamic-ld.cc (octave_shlib_list::instance_ok, octave_dynamic_loader::instance_ok, do_load_oct, do_load_mex), file-io.cc (fopen_mode_to_ios_mode, do_stream_open, Ffprintf, Fsprintf, Fscanf, Ffscanf, get_sscanf_data, Fsscanf, do_fread, do_fwrite, Fpopen, Ftempname, convert, Fumask), graphics.in.h (graphics_toolkit::instance_ok, gh_manager::instance_ok), load-path.cc (instance_ok), ls-oct-ascii.cc (save_three_d), lsode.cc (LSODE_ABORT, LSODE_ABORT2), oct-errno.in.cc (instance_ok), octave-link.cc (connect_link), pager.cc (octave_pager_stream::instance_ok, octave_diary_stream::instance_ok), quad.cc (QUAD_ABORT, QUAD_ABORT2), sighandlers.cc (w32_interrupt_manager::instance_ok, octave_child_list::instance_ok), symtab.cc (do_update_nest), symtab.h (instance_ok), syscalls.cc (convert), toplev.h (instance_ok), txt-eng-ft.cc (instance_ok, set_mode), urlwrite.cc (instance_ok), __init_fltk__.cc (instance_ok), ov-builtin.cc (do_multi_index_op), ov-classdef.cc (class_fevalStatic, make_class, octave_classdef::subsasgn, do_multi_index_op, cdef_object_array::subsref, cdef_object_array::subsasgn, install_meth, meta_subsref, run_constructor, make_meta_class, get_value, set_value, check_method), ov-classdef.h (meta_subsref, instance_ok), ov-fcn-handle.cc (octave_fcn_handle), ov-mex-fcn.cc (do_multi_index_op), ov-range.h (octave_range), ov-typeinfo.cc (instance_ok), ov-usr-fcn.cc (subsref, do_multi_index_op), pt-arg-list.cc (Fend, convert_to_const_vector), pt-cell.cc (rvalue1), pt-colon.cc (append, rvalue1), pt-eval.cc (visit_simple_for_command, visit_switch_command), pt-exp.cc (is_logically_true, rvalue), pt-id.cc (eval_undefined_error), pt-id.h (workspace_error), pt-mat.cc (get_concat_class): Use error() rather than ::error().
author Rik <rik@octave.org>
date Thu, 06 Aug 2015 08:09:01 -0700
parents d9f35ceff9e1
children 859423f351a3
line wrap: on
line diff
--- a/libinterp/corefcn/file-io.cc	Wed Aug 05 22:47:41 2015 -0700
+++ b/libinterp/corefcn/file-io.cc	Thu Aug 06 08:09:01 2015 -0700
@@ -230,7 +230,7 @@
         retval = (std::ios::in | std::ios::out | std::ios::app
                   | std::ios::binary);
       else
-        ::error ("invalid mode specified");
+        error ("invalid mode specified");
     }
 
   return retval;
@@ -576,13 +576,13 @@
               retval = do_stream_open (name, mode, arch, fid);
             }
           else
-            ::error ("%s: architecture type must be a string", fcn);
+            error ("%s: architecture type must be a string", fcn);
         }
       else
-        ::error ("%s: file mode must be a string", fcn);
+        error ("%s: file mode must be a string", fcn);
     }
   else
-    ::error ("%s: file name must be a string", fcn);
+    error ("%s: file name must be a string", fcn);
 
   return retval;
 }
@@ -946,7 +946,7 @@
               result = os.printf (args(fmt_n), tmp_args, who);
             }
           else
-            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
+            error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
     }
   else
@@ -1001,7 +1001,7 @@
           result = stdout_stream.printf (args(0), tmp_args, who);
         }
       else
-        ::error ("%s: format TEMPLATE must be a string", who.c_str ());
+        error ("%s: format TEMPLATE must be a string", who.c_str ());
     }
   else
     print_usage ();
@@ -1129,10 +1129,10 @@
                            : octave_value (result, type));
             }
           else
-            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
+            error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
       else
-        ::error ("%s: unable to create output buffer", who.c_str ());
+        error ("%s: unable to create output buffer", who.c_str ());
     }
   else
     print_usage ();
@@ -1205,7 +1205,7 @@
           if (args(1).is_string ())
             retval = os.oscanf (args(1), who);
           else
-            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
+            error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
     }
   else
@@ -1242,7 +1242,7 @@
                     }
                 }
               else
-                ::error ("%s: format must be a string", who.c_str ());
+                error ("%s: format must be a string", who.c_str ());
             }
         }
       else
@@ -1264,7 +1264,7 @@
       retval = tmp.string_value ();
     }
   else
-    ::error ("sscanf: argument STRING must be a string");
+    error ("sscanf: argument STRING must be a string");
 
   return retval;
 }
@@ -1301,14 +1301,13 @@
               if (args(1).is_string ())
                 retval = os.oscanf (args(1), who);
               else
-                ::error ("%s: format TEMPLATE must be a string", who.c_str ());
+                error ("%s: format TEMPLATE must be a string", who.c_str ());
             }
           else
-            ::error ("%s: unable to create temporary input buffer",
-                     who.c_str ());
+            error ("%s: unable to create temporary input buffer", who.c_str ());
         }
       else
-        ::error ("%s: argument STRING must be a string", who.c_str ());
+        error ("%s: argument STRING must be a string", who.c_str ());
     }
   else
     {
@@ -1353,12 +1352,12 @@
                         }
                     }
                   else
-                    ::error ("%s: format TEMPLATE must be a string",
-                             who.c_str ());
+                    error ("%s: format TEMPLATE must be a string",
+                           who.c_str ());
                 }
               else
-                ::error ("%s: unable to create temporary input buffer",
-                         who.c_str  ());
+                error ("%s: unable to create temporary input buffer",
+                       who.c_str  ());
             }
         }
       else
@@ -1431,19 +1430,19 @@
                                           output_type, skip, flt_fmt, count);
                     }
                   else
-                    ::error ("fread: ARCH architecture type must be a string");
+                    error ("fread: ARCH architecture type must be a string");
                 }
               else
-                ::error ("fread: SKIP must be an integer");
+                error ("fread: SKIP must be an integer");
             }
           else
-            ::error ("fread: invalid PRECISION specified");
+            error ("fread: invalid PRECISION specified");
         }
       else
-        ::error ("fread: PRECISION must be a string");
+        error ("fread: PRECISION must be a string");
     }
   else
-    ::error ("fread: invalid SIZE specified");
+    error ("fread: invalid SIZE specified");
 
   return retval;
 }
@@ -1699,16 +1698,16 @@
                                        skip, flt_fmt);
                 }
               else
-                ::error ("fwrite: ARCH architecture type must be a string");
+                error ("fwrite: ARCH architecture type must be a string");
             }
           else
-            ::error ("fwrite: SKIP must be an integer");
+            error ("fwrite: SKIP must be an integer");
         }
       else
-        ::error ("fwrite: invalid PRECISION specified");
+        error ("fwrite: invalid PRECISION specified");
     }
   else
-    ::error ("fwrite: PRECISION must be a string");
+    error ("fwrite: PRECISION must be a string");
 
   return retval;
 }
@@ -1929,13 +1928,13 @@
                   retval = octave_stream_list::insert (ops);
                 }
               else
-                ::error ("popen: invalid MODE specified");
+                error ("popen: invalid MODE specified");
             }
           else
-            ::error ("popen: MODE must be a string");
+            error ("popen: MODE must be a string");
         }
       else
-        ::error ("popen: COMMAND must be a string");
+        error ("popen: COMMAND must be a string");
     }
   else
     print_usage ();
@@ -1996,7 +1995,7 @@
           if (args(0).is_string ())
             dir = args(0).string_value ();
           else
-            ::error ("DIR must be a string");
+            error ("DIR must be a string");
         }
 
       std::string pfx ("oct-");
@@ -2005,7 +2004,7 @@
           if (args(1).is_string ())
             pfx = args(1).string_value ();
           else
-            ::error ("PREFIX must be a string");
+            error ("PREFIX must be a string");
         }
 
       retval = octave_tempnam (dir, pfx);
@@ -2214,7 +2213,7 @@
   int tmp = x % obase;
 
   if (tmp > ibase - 1)
-    ::error ("umask: invalid digit");
+    error ("umask: invalid digit");
   else
     {
       retval = tmp;
@@ -2224,7 +2223,7 @@
           tmp = x % obase;
           if (tmp > ibase - 1)
             {
-              ::error ("umask: invalid digit");
+              error ("umask: invalid digit");
               break;
             }
           retval += mult * tmp;
@@ -2266,7 +2265,7 @@
           if (mask < 0)
             {
               status = -1;
-              ::error ("umask: MASK must be a positive integer value");
+              error ("umask: MASK must be a positive integer value");
             }
           else
             {
@@ -2279,7 +2278,7 @@
       else
         {
           status = -1;
-          ::error ("umask: MASK must be an integer");
+          error ("umask: MASK must be an integer");
         }
     }
   else