changeset 28919:7bc983bc2cbd

maint: Prepend name of function to error() messages. * __dsearchn__.cc (F__dsearchn__): Correct name in error message to "__dsearchn__". * data.cc (Ftoc): Prepend name of function to error message. Re-write message for clarity to mention tic(). * graphics.cc (set___graphics_toolkit__): Prepend name of function to error message. Re-write message. * audiodevinfo.cc: Write "audioplayer" and "audiorecorder" in error messages. * profiler.cc (reset): Prepend "profile:" to error message.
author Rik <rik@octave.org>
date Tue, 13 Oct 2020 22:24:20 -0700
parents d8751a1dda2a
children 601b6c7728ed
files libinterp/corefcn/__dsearchn__.cc libinterp/corefcn/data.cc libinterp/corefcn/graphics.cc libinterp/dldfcn/audiodevinfo.cc libinterp/parse-tree/profiler.cc
diffstat 5 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__dsearchn__.cc	Wed Oct 14 00:26:55 2020 -0400
+++ b/libinterp/corefcn/__dsearchn__.cc	Tue Oct 13 22:24:20 2020 -0700
@@ -48,7 +48,7 @@
   Matrix xi = args(1).matrix_value ().transpose ();
 
   if (x.rows () != xi.rows () || x.columns () < 1)
-    error ("__dsearch__: number of rows of X and XI must match");
+    error ("__dsearchn__: number of rows of X and XI must match");
 
   octave_idx_type n = x.rows ();
   octave_idx_type nx = x.columns ();
--- a/libinterp/corefcn/data.cc	Wed Oct 14 00:26:55 2020 -0400
+++ b/libinterp/corefcn/data.cc	Tue Oct 13 22:24:20 2020 -0700
@@ -6508,7 +6508,7 @@
     }
 
   if (start_time < 0)
-    error ("toc called before timer set");
+    error ("toc: function called before timer initialization with tic()");
 
   octave::sys::time now;
 
--- a/libinterp/corefcn/graphics.cc	Wed Oct 14 00:26:55 2020 -0400
+++ b/libinterp/corefcn/graphics.cc	Tue Oct 13 22:24:20 2020 -0700
@@ -4189,7 +4189,7 @@
 figure::properties::set___graphics_toolkit__ (const octave_value& val)
 {
   if (! val.is_string ())
-    error ("set___graphics_toolkit__ must be a string");
+    error ("set___graphics_toolkit__: toolkit must be a string");
 
   std::string nm = val.string_value ();
 
--- a/libinterp/dldfcn/audiodevinfo.cc	Wed Oct 14 00:26:55 2020 -0400
+++ b/libinterp/dldfcn/audiodevinfo.cc	Tue Oct 13 22:24:20 2020 -0700
@@ -592,21 +592,21 @@
   audioplayer *player = static_cast<audioplayer *> (data);
 
   if (! player)
-    error ("audio player callback function called without player");
+    error ("audioplayer callback function called without player");
 
   octave_value_list retval
     = octave::feval (player->octave_callback_function,
                      ovl (static_cast<double> (frames)), 1);
 
   if (retval.length () < 2)
-    error ("audio player callback function failed");
+    error ("audioplayer callback function failed");
 
   const Matrix sound = retval(0).matrix_value ();
   int return_status = retval(1).int_value ();
 
   if (frames - sound.rows () != 0 || sound.columns () < 1
       || sound.columns () > 2)
-    error ("audio player callback function failed");
+    error ("audioplayer callback function failed");
 
   // Don't multiply the audio data by scale_factor here.  Although it
   // does move the operation outside of the loops below, it also causes
@@ -682,7 +682,7 @@
       break;
 
     default:
-      error ("invalid player bit depth in callback function");
+      error ("invalid bit depth in audioplayer callback function");
     }
 
   return return_status;
@@ -696,7 +696,7 @@
   audioplayer *player = static_cast<audioplayer *> (data);
 
   if (! player)
-    error ("audio player callback function called without player");
+    error ("audioplayer callback function called without player");
 
   // Don't multiply the audio data by scale_factor here.  Although it would
   // move the operation outside of the loops below, it also causes a second
@@ -799,7 +799,7 @@
           break;
 
         default:
-          error ("invalid player bit depth in callback function");
+          error ("invalid bit depth in audioplayer callback function");
         }
     }
   else if (player->get_type () == TYPE_INT8)
@@ -1341,7 +1341,7 @@
   audiorecorder *recorder = static_cast<audiorecorder *> (data);
 
   if (! recorder)
-    error ("audio recorder callback function called without recorder");
+    error ("audiorecorder callback function called without recorder");
 
   int channels = recorder->get_channels ();
 
@@ -1445,7 +1445,7 @@
   audiorecorder *recorder = static_cast<audiorecorder *> (data);
 
   if (! recorder)
-    error ("audio recorder callback function called without recorder");
+    error ("audiorecorder callback function called without recorder");
 
   int channels = recorder->get_channels ();
 
@@ -2413,7 +2413,7 @@
 
   audioplayer *pl = dynamic_cast<audioplayer *> (ncrep);
   if (! pl)
-    error ("audiodevinfo.cc get_player: dynamic_cast to audioplayer failed");
+    error ("audiodevinfo.cc (get_player): dynamic_cast to audioplayer failed");
 
   return pl;
 }
--- a/libinterp/parse-tree/profiler.cc	Wed Oct 14 00:26:55 2020 -0400
+++ b/libinterp/parse-tree/profiler.cc	Tue Oct 13 22:24:20 2020 -0700
@@ -255,7 +255,7 @@
   profiler::reset (void)
   {
     if (enabled ())
-      error ("Can't reset active profiler");
+      error ("profile: can't reset active profiler");
 
     m_known_functions.clear ();
     m_fcn_index.clear ();