changeset 28140:e82d00e8be37

maint: merge stable to default.
author John W. Eaton <jwe@octave.org>
date Wed, 26 Feb 2020 13:29:01 -0500
parents cb8ecb818f43 (current diff) 992a7a4f1476 (diff)
children 33d89d314d43
files
diffstat 1 files changed, 28 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/ls-mat5.cc	Tue Feb 25 13:22:02 2020 -0800
+++ b/libinterp/corefcn/ls-mat5.cc	Wed Feb 26 13:29:01 2020 -0500
@@ -925,8 +925,9 @@
                           tc = octave_value (new octave_fcn_handle (ov_fcn, fname));
                         else
                           {
-                            warning ("load: can't find the file %s",
-                                     fpath.c_str ());
+                            warning_with_id ("Octave:load:file-not-found",
+                                             "load: can't find the file %s",
+                                             fpath.c_str ());
                             goto skip_ahead;
                           }
                       }
@@ -946,8 +947,9 @@
                       tc = octave_value (new octave_fcn_handle (ov_fcn, fname));
                     else
                       {
-                        warning ("load: can't find the file %s",
-                                 fpath.c_str ());
+                        warning_with_id ("Octave:load:file-not-found",
+                                         "load: can't find the file %s",
+                                         fpath.c_str ());
                         goto skip_ahead;
                       }
                   }
@@ -955,7 +957,8 @@
           }
         else if (ftype == "nested")
           {
-            warning ("load: can't load nested function");
+            warning_with_id ("Octave:load:unsupported-type",
+                             "load: can't load nested function");
             goto skip_ahead;
           }
         else if (ftype == "anonymous")
@@ -1185,7 +1188,8 @@
                 if (cdm.find_class (classname, false, true).ok ())
                   {
                     tc = m;
-                    warning ("load: classdef element has been converted to a struct");
+                    warning_with_id ("Octave:load:classdef-to-struct",
+                                     "load: classdef element has been converted to a struct");
                   }
                 else
                   {
@@ -1197,7 +1201,8 @@
                       {
 
                         if (! cls->reconstruct_parents ())
-                          warning ("load: unable to reconstruct object inheritance");
+                          warning_with_id ("Octave:load:classdef-object-inheritance",
+                                           "load: unable to reconstruct object inheritance");
 
                         tc = cls;
 
@@ -1220,7 +1225,8 @@
                     else
                       {
                         tc = m;
-                        warning ("load: element has been converted to a structure");
+                        warning_with_id ("Octave:load:classdef-to-struct",
+                                         "load: element has been converted to a structure");
                       }
                   }
               }
@@ -1415,7 +1421,8 @@
                       }
 
                     if (found_big_char)
-                      warning ("load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'");
+                      warning_with_id ("Octave:load:unsupported-utf-char",
+                               "load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'");
                   }
                 else if (type == miUTF8)
                   {
@@ -1432,7 +1439,8 @@
 
                     if (utf8_multi_byte)
                       {
-                        warning ("load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'");
+                        warning_with_id ("Octave:load:unsupported-utf-char",
+                                         "load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'");
                         for (octave_idx_type i = 0; i < n; i++)
                           {
                             unsigned char a
@@ -1463,7 +1471,8 @@
   error ("load: trouble reading binary file '%s'", filename.c_str ());
 
 skip_ahead:
-  warning ("load: skipping over '%s'", retval.c_str ());
+  warning_with_id ("Octave:load:skip-unsupported-element",
+                   "load: skipping over '%s'", retval.c_str ());
   is.seekg (pos + static_cast<std::streamoff> (element_length));
   return read_mat5_binary_element (is, filename, swap, global, tc);
 }
@@ -1499,8 +1508,9 @@
     version = ((version >> 8) & 0xff) + ((version & 0xff) << 8);
 
   if (version != 1 && ! quiet)
-    warning ("load: found version %d binary MAT file, "
-             "but only prepared for version 1", version);
+    warning_with_id ("Octave:load:unsupported-version",
+                     "load: found version %d binary MAT file, but only prepared for version 1",
+                     version);
 
   if (swap)
     swap_bytes<8> (&subsys_offset, 1);
@@ -1594,8 +1604,8 @@
     {
       if (m.too_large_for_float ())
         {
-          warning ("save: some values too large to save as floats --");
-          warning ("save: saving as doubles instead");
+          warning_with_id ("Octave:save:too-large-for-float",
+                           "save: some values too large to save as floats -- saving as doubles instead");
         }
       else
         st = LS_FLOAT;
@@ -2217,8 +2227,9 @@
 static void
 warn_dim_too_large (const std::string& name)
 {
-  warning ("save: skipping %s: dimension too large for MAT format",
-           name.c_str ());
+  warning_with_id ("Octave:save:dimension-too-large",
+                   "save: skipping %s: dimension too large for MAT format",
+                   name.c_str ());
 }
 
 // save the data from TC along with the corresponding NAME on stream