# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1637946154 -3600
#      Fri Nov 26 18:02:34 2021 +0100
# Node ID afe5ca3dbea5893fcc0b166a4c9e4bbaf24f18c5
# Parent  9014fec674bdbac46727ca3e3f25d57bf06a2115
Fix compilation with Octave 8 (bug #61568).

* src/crlibm_function.cc (Fcrlibm_function), src/mpfr_function_d.cc
(Fmpfr_function_d), src/mpfr_linspace_d.cc (Fmpfr_linspace_d),
src/mpfr_matrix_mul_d.cc (Fmpfr_matrix_mul_d), src/mpfr_matrix_sqr_d.cc
(Fmpfr_matrix_sqr_d), src/mpfr_to_string_d.cc (Fmpfr_to_string_d),
src/mpfr_vector_dot_d.cc (Fmpfr_vector_dot_d), src/mpfr_vector_sum_d.cc
(Fmpfr_vector_sum_d), src/__setround__.cc (F__setround__): Remove usage of
`error_state`. It was unconditionally set to 0 since about 6 years ago and will
finally be removed in Octave 8.

diff -r 9014fec674bd -r afe5ca3dbea5 src/__setround__.cc
--- a/src/__setround__.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/__setround__.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -62,9 +62,6 @@
     error ("__setround__: Unsupported rounding mode, please use -inf, +inf "
            "or 0.5");
 
-  if (error_state)
-    return octave_value_list ();
-
   if (fesetround (mode) != 0)
     error ("__setround__: Unable to change rounding mode");
 
diff -r 9014fec674bd -r afe5ca3dbea5 src/crlibm_function.cc
--- a/src/crlibm_function.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/crlibm_function.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -84,9 +84,6 @@
   const double      rnd      = args(1).scalar_value ();
   NDArray           arg1     = args(2).array_value ();
 
-  if (error_state)
-    return octave_value_list ();
-
   if (rnd == INFINITY)
     {
       // Round upwards
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_function_d.cc
--- a/src/mpfr_function_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_function_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -391,8 +391,6 @@
       if (arg1.dims () != arg2.dims () || arg2.dims () != arg3.dims ())
         error ("mpfr_function_d: Array dimensions must agree!");
     }
-  if (error_state)
-    return octave_value_list ();
 
   // Choose the function to evaluate
   switch (nargin - 2)
@@ -491,8 +489,6 @@
         else if (function == "nthroot")
           {
             uint64NDArray n = args (3).uint64_array_value ();
-            if (error_state)
-              return octave_value_list ();
             nthroot (arg1, n, rnd);
           }
         else if (function == "plus")
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_linspace_d.cc
--- a/src/mpfr_linspace_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_linspace_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -65,8 +65,6 @@
     error ("mpfr_linspace_d: vectors must be of equal length");
   if (rnd != MPFR_RNDD && rnd != MPFR_RNDU)
     error ("mpfr_linspace_d: only directed rounding supported");
-  if (error_state)
-    return octave_value_list ();
 
   // Result size
   n = std::max (n, 1);
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_matrix_mul_d.cc
--- a/src/mpfr_matrix_mul_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_matrix_mul_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -137,9 +137,7 @@
   Matrix matrix_yl = args (1).matrix_value ();
   Matrix matrix_xu = args (2).matrix_value ();
   Matrix matrix_yu = args (3).matrix_value ();
-  if (error_state)
-    return octave_value_list ();
-  
+
   std::pair <Matrix, Matrix> result_d = 
     interval_matrix_mul (matrix_xl, matrix_yl, matrix_xu, matrix_yu);
   octave_value_list result;
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_matrix_sqr_d.cc
--- a/src/mpfr_matrix_sqr_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_matrix_sqr_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -331,9 +331,7 @@
 
   Matrix matrix_xl = args (0).matrix_value ();
   Matrix matrix_xu = args (1).matrix_value ();
-  if (error_state)
-    return octave_value_list ();
-  
+
   std::pair <Matrix, Matrix> result_d = 
     interval_matrix_sqr (matrix_xl, matrix_xu);
   octave_value_list result;
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_to_string_d.cc
--- a/src/mpfr_to_string_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_to_string_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -128,9 +128,7 @@
     }
   
   const Matrix x = args (2).matrix_value ();
-  if (error_state)
-    return octave_value_list ();
-  
+
   char buf [768];
   mpfr_t mp;
   mpfr_t zero;
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_vector_dot_d.cc
--- a/src/mpfr_vector_dot_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_vector_dot_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -460,8 +460,6 @@
           NDArray array_xu = args (2).array_value ();
           NDArray array_yu = args (3).array_value ();
           octave_idx_type dim = args (4).scalar_value ();
-          if (error_state)
-            return octave_value_list ();
 
           std::pair <NDArray, NDArray> result_d =
               interval_vector_dot (array_xl, array_yl, array_xu, array_yu, dim);
@@ -475,8 +473,6 @@
           const NDArray array_x = args (1).array_value ();
           const NDArray array_y = args (2).array_value ();
           const octave_idx_type dim = args (3).scalar_value ();
-          if (error_state)
-            return octave_value_list ();
 
           std::pair <NDArray, NDArray> result_and_error
               = vector_dot (rnd, array_x, array_y, dim, nargout >= 2);
diff -r 9014fec674bd -r afe5ca3dbea5 src/mpfr_vector_sum_d.cc
--- a/src/mpfr_vector_sum_d.cc	Mon Dec 21 08:57:25 2020 +0100
+++ b/src/mpfr_vector_sum_d.cc	Fri Nov 26 18:02:34 2021 +0100
@@ -69,8 +69,6 @@
   const mpfr_rnd_t rnd      = parse_rounding_mode (args (0).scalar_value ());
   const NDArray    array    = args (1).array_value ();
   const octave_idx_type dim = args (2).scalar_value ();
-  if (error_state)
-    return octave_value_list ();
 
   if (dim > array.ndims ())
     {
