changeset 27136:512399fefc1b

Call error() function from base_stream in the correct manner. * oct-stream.cc (base_stream::do_scanf, base_stream::do_oscanf, base_stream::do_numeric_printf_conv, base_stream::do_printf, base_stream::puts): Use correct prototype form of error function from oct-stream.h which is void error (const std::string& who, const std::string& msg); Calls to error() had mistakenly used prototype for exception-based errors found in libinterp/corefcn/error.h.
author Rik <rik@octave.org>
date Sat, 01 Jun 2019 21:01:45 -0700
parents bf2f533d2d45
children 30f53f7a7293
files libinterp/corefcn/oct-stream.cc
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Sat Jun 01 19:57:45 2019 +0200
+++ b/libinterp/corefcn/oct-stream.cc	Sat Jun 01 21:01:45 2019 -0700
@@ -4891,11 +4891,11 @@
                     break;
 
                   case 'p':
-                    error ("%s: unsupported format specifier", who.c_str ());
+                    error (who, "unsupported format specifier");
                     break;
 
                   default:
-                    error ("%s: internal format error", who.c_str ());
+                    error (who, "internal format error");
                     break;
                   }
 
@@ -4964,7 +4964,7 @@
               }
             else
               {
-                error ("%s: internal format error", who.c_str ());
+                error (who, "internal format error");
                 break;
               }
 
@@ -5229,11 +5229,11 @@
             break;
 
           case 'p':
-            error ("%s: unsupported format specifier", who.c_str ());
+            error (who, "unsupported format specifier");
             break;
 
           default:
-            error ("%s: internal format error", who.c_str ());
+            error (who, "internal format error");
             break;
           }
       }
@@ -5815,7 +5815,7 @@
           default:
             // Note: error is member fcn from base_stream, not ::error.
             // This error does not halt execution so "return ..." must exist.
-            error ("%s: invalid format specifier", who.c_str ());
+            error (who, "invalid format specifier");
             return -1;
             break;
           }
@@ -5923,7 +5923,7 @@
 
             if (! os)
               {
-                error ("%s: write error", who.c_str ());
+                error (who, "write error");
                 break;
               }
 
@@ -5969,7 +5969,7 @@
         os << s;
 
         if (! os)
-          error ("%s: write error", who.c_str ());
+          error (who, "write error");
         else
           {
             // FIXME: why does this seem to be necessary?
@@ -5983,7 +5983,7 @@
             if (os)
               retval = 0;
             else
-              error ("%s: write error", who.c_str ());
+              error (who, "write error");
           }
       }