changeset 27069:0a62d9a6aa2d

Place Octave's warning and error IDs in to the "Octave" namespace (bug #56213). * oct-stream.cc (textscan_format_list::parse_char_class), ov-ch-mat.cc (octave_char_matrix::map): Use "Octave" namespace with initial capital rather than "octave" lowercase in warning_with_id. * fminbnd.m (guarded_eval), fminunc.m (guarded_eval), fsolve.m (guarded_eval): Place error IDs in to "Octave" namespace. * print.m (epstool, fig2dev, latexstandalone, lpr, pstoedit): Place error IDs in to "Octave" namespace. * __print_parse_opts__.m (convert2points): Place error IDs in to "Octave" namespace. * fzero.m, __ghostscript__.m, __gnuplot_print__.m, __opengl_print__.m, splinefit.m, strjoin.m, strsplit.m: Place error IDs in to "Octave" namespace.
author Rik <rik@octave.org>
date Thu, 25 Apr 2019 08:48:19 -0700
parents 2cede23e44c3
children 726d945f23de
files libinterp/corefcn/oct-stream.cc libinterp/octave-value/ov-ch-mat.cc scripts/optimization/fminbnd.m scripts/optimization/fminunc.m scripts/optimization/fsolve.m scripts/optimization/fzero.m scripts/plot/util/print.m scripts/plot/util/private/__ghostscript__.m scripts/plot/util/private/__gnuplot_print__.m scripts/plot/util/private/__opengl_print__.m scripts/plot/util/private/__print_parse_opts__.m scripts/polynomial/splinefit.m scripts/strings/strjoin.m scripts/strings/strsplit.m
diffstat 14 files changed, 41 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Wed Apr 24 21:21:06 2019 -0700
+++ b/libinterp/corefcn/oct-stream.cc	Thu Apr 25 08:48:19 2019 -0700
@@ -2306,13 +2306,13 @@
             if (mask[ch]++ == 0)
               retval[out++] = ch;
             else if (ch != '-')
-              warning_with_id ("octave:textscan-pattern",
+              warning_with_id ("Octave:textscan-pattern",
                                "%s: [...] contains two '%c's",
                                who.c_str (), ch);
 
             if (prev == '-' && mask['-'] >= 2)
               warning_with_id
-                ("octave:textscan-pattern",
+                ("Octave:textscan-pattern",
                  "%s: [...] contains two '-'s outside range expressions",
                  who.c_str ());
           }
--- a/libinterp/octave-value/ov-ch-mat.cc	Wed Apr 24 21:21:06 2019 -0700
+++ b/libinterp/octave-value/ov-ch-mat.cc	Thu Apr 25 08:48:19 2019 -0700
@@ -325,7 +325,7 @@
         U8_FCN (in, matrix.numel (), nullptr, buf, &output_length);            \
         if (output_length != static_cast<size_t> (matrix.numel ()))            \
           {                                                                    \
-            warning_with_id ("octave:multi_byte_char_length",                  \
+            warning_with_id ("Octave:multi_byte_char_length",                  \
                              "UMAP: Possible multi-byte error.");              \
             return octave_value (matrix.map<char, int (&) (int)> (STD_FCN));   \
           }                                                                    \
--- a/scripts/optimization/fminbnd.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/optimization/fminbnd.m	Thu Apr 25 08:48:19 2019 -0700
@@ -272,9 +272,9 @@
   fx = fun (x);
   fx = fx(1);
   if (! isreal (fx))
-    error ("fminbnd:notreal", "fminbnd: non-real value encountered");
+    error ("Octave:fmindbnd:notreal", "fminbnd: non-real value encountered");
   elseif (isnan (fx))
-    error ("fminbnd:isnan", "fminbnd: NaN value encountered");
+    error ("Octave:fmindbnd:isnan", "fminbnd: NaN value encountered");
   endif
 endfunction
 
--- a/scripts/optimization/fminunc.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/optimization/fminunc.m	Thu Apr 25 08:48:19 2019 -0700
@@ -410,11 +410,11 @@
   endif
 
   if (! (isreal (fx) && isreal (gx)))
-    error ("fminunc:notreal", "fminunc: non-real value encountered");
+    error ("Octave:fminunc:notreal", "fminunc: non-real value encountered");
   elseif (any (isnan (fx(:))))
-    error ("fminunc:isnan", "fminunc: NaN value encountered");
+    error ("Octave:fminunc:isnan", "fminunc: NaN value encountered");
   elseif (any (isinf (fx(:))))
-    error ("fminunc:isinf", "fminunc: Inf value encountered");
+    error ("Octave:fminunc:isinf", "fminunc: Inf value encountered");
   endif
 
 endfunction
--- a/scripts/optimization/fsolve.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/optimization/fsolve.m	Thu Apr 25 08:48:19 2019 -0700
@@ -499,13 +499,13 @@
   endif
 
   if (! complexeqn && ! (isreal (fx) && isreal (jx)))
-    error ("fsolve:notreal", "fsolve: non-real value encountered");
+    error ("Octave:fsolve:notreal", "fsolve: non-real value encountered");
   elseif (complexeqn && ! (isnumeric (fx) && isnumeric (jx)))
-    error ("fsolve:notnum", "fsolve: non-numeric value encountered");
+    error ("Octave:fsolve:notnum", "fsolve: non-numeric value encountered");
   elseif (any (isnan (fx(:))))
-    error ("fsolve:isnan", "fsolve: NaN value encountered");
+    error ("Octave:fsolve:isnan", "fsolve: NaN value encountered");
   elseif (any (isinf (fx(:))))
-    error ("fsolve:isinf", "fsolve: Inf value encountered");
+    error ("Octave:fsolve:isinf", "fsolve: Inf value encountered");
   endif
 
 endfunction
--- a/scripts/optimization/fzero.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/optimization/fzero.m	Thu Apr 25 08:48:19 2019 -0700
@@ -197,7 +197,7 @@
   endif
 
   if (! (sign (fa) * sign (fb) <= 0))
-    error ("fzero:bracket", "fzero: not a valid initial bracketing");
+    error ("Octave:fzero:bracket", "fzero: not a valid initial bracketing");
   endif
 
   slope0 = (fb - fa) / (b - a);
@@ -331,7 +331,7 @@
       break;
     else
       ## This should never happen.
-      error ("fzero:bracket", "fzero: zero point is not bracketed");
+      error ("Octave:fzero:bracket", "fzero: zero point is not bracketed");
     endif
 
     ## If there's an output function, use it now.
@@ -385,9 +385,9 @@
   fx = fun (x);
   fx = fx(1);
   if (! isreal (fx))
-    error ("fzero:notreal", "fzero: non-real value encountered");
+    error ("Octave:fzero:notreal", "fzero: non-real value encountered");
   elseif (isnan (fx))
-    error ("fzero:isnan", "fzero: NaN value encountered");
+    error ("Octave:fzero:isnan", "fzero: NaN value encountered");
   endif
 endfunction
 
--- a/scripts/plot/util/print.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/plot/util/print.m	Thu Apr 25 08:48:19 2019 -0700
@@ -770,7 +770,7 @@
   persistent epsdevice;
   if (dos_shell && isempty (epsdevice))
     if (isempty (opts.ghostscript.binary))
-      error ("print:nogs",
+      error ("Octave:print:nogs",
              "print: 'gs' (Ghostscript) is required for specified output format, but binary is not available in PATH");
     endif
 
@@ -821,7 +821,7 @@
   if (! isempty (opts.preview) || opts.tight)
 
     if (isempty (opts.epstool_binary))
-      error ("print:noepstool", "print: 'epstool' is required for specified output format, but binary is not available in PATH");
+      error ("Octave:print:noepstool", "print: 'epstool' is required for specified output format, but binary is not available in PATH");
     endif
 
     if (opts.tight)
@@ -837,7 +837,7 @@
         case "pict"
           cmd = sprintf ("--add-%s-preview --mac-single", opts.preview);
         otherwise
-          error ("print:invalidpreview",
+          error ("Octave:print:invalidpreview",
                  "print: epstool cannot include preview for format '%s'",
                  opts.preview);
       endswitch
@@ -872,7 +872,7 @@
     endif
     if (! isempty (cleanup))
       if (pipeout && dos_shell)
-        error ("print:epstoolpipe",
+        error ("Octave:print:epstoolpipe",
                "print: cannot pipe output of 'epstool' for DOS shell");
       elseif (pipeout)
         cmd = sprintf ("( %s %s )", cmd, cleanup);
@@ -928,7 +928,7 @@
   endif
 
   if (isempty (opts.fig2dev_binary))
-    error ("print:nofig2dev", "print: 'fig2dev' is required for specified output format, but binary is not available in PATH");
+    error ("Octave:print:nofig2dev", "print: 'fig2dev' is required for specified output format, but binary is not available in PATH");
   endif
 
   dos_shell = (ispc () && ! isunix ());
@@ -976,13 +976,13 @@
 
   fid = fopen (latexfile, "r");
   if (fid < 0)
-    error ("print:erroropeningfile",
+    error ("Octave:print:erroropeningfile",
            "print: error opening file '%s'", latexfile);
   endif
   latex = fscanf (fid, "%c", Inf);
   status = fclose (fid);
   if (status != 0)
-    error ("print:errorclosingfile",
+    error ("Octave:print:errorclosingfile",
            "print: error closing file '%s'", latexfile);
   endif
   ## FIXME: should this be fixed in GL2PS?
@@ -996,11 +996,11 @@
     fprintf (fid, "%s\n", postpend{:});
     status = fclose (fid);
     if (status != 0)
-      error ("print:errorclosingfile",
+      error ("Octave:print:errorclosingfile",
              "print: error closing file '%s'", latexfile);
     endif
   else
-    error ("print:erroropeningfile",
+    error ("Octave:print:erroropeningfile",
            "print: error opening file '%s'", latexfile);
   endif
 
@@ -1021,7 +1021,7 @@
       cmd = sprintf ("%s %s", cmd, opts.printer);
     endif
   elseif (isempty (opts.lpr_binary))
-    error ("print:nolpr", "print: 'lpr' not found in PATH");
+    error ("Octave:print:nolpr", "print: 'lpr' not found in PATH");
   endif
   if (opts.debug)
     fprintf ("lpr command: '%s'\n", cmd);
@@ -1036,7 +1036,7 @@
   endif
 
   if (isempty (opts.pstoedit_binary))
-    error ("print:nopstoedit", ...
+    error ("Octave:print:nopstoedit", ...
            "print: 'pstoedit' is required for specified output format, but binary is not available in PATH");
   endif
 
--- a/scripts/plot/util/private/__ghostscript__.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/plot/util/private/__ghostscript__.m	Thu Apr 25 08:48:19 2019 -0700
@@ -61,7 +61,7 @@
   endfor
 
   if (isempty (opts.binary))
-    error ("print:nogs", "__ghostscript__: 'gs' (Ghostscript) binary is required for specified output format, but binary is not available in PATH");
+    error ("Octave:print:nogs", "__ghostscript__: 'gs' (Ghostscript) binary is required for specified output format, but binary is not available in PATH");
   endif
 
   if (isempty (opts.papersize))
@@ -111,7 +111,7 @@
         gs_opts = sprintf ("%s -dNORANGEPAGESIZE", gs_opts);
       endif
     else
-      error ("print:badpapersize", "__ghostscript__.m: invalid 'papersize'");
+      error ("Octave:print:badpapersize", "__ghostscript__.m: invalid 'papersize'");
     endif
     gs_opts = sprintf ("%s -dFIXEDMEDIA", gs_opts);
     ## "pageoffset" is relative to the coordinates, not the BBox LLHC.
@@ -132,13 +132,13 @@
     unwind_protect
       fid = fopen (offsetfile, "w");
       if (fid == -1)
-        error ("print:fopenfailed", "__ghostscript__.m: fopen () failed");
+        error ("Octave:print:fopenfailed", "__ghostscript__.m: fopen () failed");
       endif
       fprintf (fid, "%s\n", offset_ps{:});
     unwind_protect_cleanup
       status = fclose (fid);
       if (status == -1)
-        error ("print:fclosefailed", "__ghostscript__.m: fclose () failed");
+        error ("Octave:print:fclosefailed", "__ghostscript__.m: fclose () failed");
       endif
     end_unwind_protect
     if (opts.debug)
--- a/scripts/plot/util/private/__gnuplot_print__.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/plot/util/private/__gnuplot_print__.m	Thu Apr 25 08:48:19 2019 -0700
@@ -93,7 +93,7 @@
           suffix = ext;  # If user provides eps/ps/pdf suffix, use it.
         endif
       else
-        error ("print:invalid-suffix",
+        error ("Octave:print:invalid-suffix",
                "invalid suffix '%s' for device '%s'.",
                ext, lower (opts.devopt));
       endif
@@ -204,7 +204,7 @@
                "---------- output begin ----------",
                output,
                "----------- output end -----------");
-      error ("gnuplot:failedpipe", "print: failed to print");
+      error ("Octave:gnuplot:failedpipe", "print: failed to print");
     endif
   endfor
 
--- a/scripts/plot/util/private/__opengl_print__.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/plot/util/private/__opengl_print__.m	Thu Apr 25 08:48:19 2019 -0700
@@ -57,7 +57,7 @@
           suffix = ext;  # If user provides eps/ps/pdf suffix, use it.
         endif
       else
-        error ("print:invalid-suffix",
+        error ("Octave:print:invalid-suffix",
                "invalid suffix '%s' for device '%s'.",
                ext, lower (opts.devopt));
       endif
--- a/scripts/plot/util/private/__print_parse_opts__.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Thu Apr 25 08:48:19 2019 -0700
@@ -744,7 +744,7 @@
     case "centimeters"
       value *= (72 / 2.54);
     case "normalized"
-      error ("print:customnormalized",
+      error ("Octave:print:customnormalized",
              "print: papersize=='<custom>' and paperunits='normalized' may not be combined");
   endswitch
 
--- a/scripts/polynomial/splinefit.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/polynomial/splinefit.m	Thu Apr 25 08:48:19 2019 -0700
@@ -111,7 +111,7 @@
   for f = 1:numel (fields)
     if (! any (strcmp (fields{f},
                        {"periodic", "robust", "beta", "order", "constraints"})))
-      error ("splinefit:invalidproperty",
+      error ("Octave:splinefit:invalidproperty",
              "unrecognized property '%s'", fields{f});
     endif
   endfor
@@ -127,14 +127,14 @@
     if (0 < props.beta && props.beta < 1)
       args{end+1} = props.beta;
     else
-      error ("splinefit:invalidbeta", "invalid beta parameter (0 < BETA < 1)");
+      error ("Octave:splinefit:invalidbeta", "invalid beta parameter (0 < BETA < 1)");
     endif
   endif
   if (isfield (props, "order"))
     if (props.order >= 0)
       args{end+1} = props.order + 1;
     else
-      error ("splinefit:invalidorder", "invalid ORDER");
+      error ("Octave:splinefit:invalidorder", "invalid ORDER");
     endif
   endif
   if (isfield (props, "constraints"))
--- a/scripts/strings/strjoin.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/strings/strjoin.m	Thu Apr 25 08:48:19 2019 -0700
@@ -71,7 +71,7 @@
     delimiter = repmat (delimiter, 1, num);
     delimiter(end) = {""};
   elseif (num > 0 && numel (delimiter) != num - 1)
-    error ("strjoin:cellstring_delimiter_mismatch",
+    error ("Octave:strjoin:cellstring_delimiter_mismatch",
       "strjoin: the number of delimiters does not match the number of strings");
   else
     delimiter(end+1) = {""};
--- a/scripts/strings/strsplit.m	Wed Apr 24 21:21:06 2019 -0700
+++ b/scripts/strings/strsplit.m	Thu Apr 25 08:48:19 2019 -0700
@@ -154,7 +154,7 @@
     if (any (strcmpi (params{n}, fields)))
       args.(tolower (params{n})) = params{n+1};
     elseif (ischar (varargin{n}))
-      error ("strsplit:invalid_parameter_name",
+      error ("Octave:strsplit:invalid_parameter_name",
              "strsplit: invalid parameter name, '%s'", varargin{n});
     else
       print_usage ();
@@ -190,7 +190,7 @@
   elseif (strncmpi (args.delimitertype, "regularexpression", length_deltype))
     is_simple = false;
   else
-    error ("strsplit:invalid_delimitertype", "strsplit: Invalid DELIMITERTYPE");
+    error ("Octave:strsplit:invalid_delimitertype", "strsplit: Invalid DELIMITERTYPE");
   endif
 
   if (is_simple)