view src/of-signal-2-error_state.patch @ 5981:b507e4ab93d5

of-signal: Fix for Octave 8 (bug #61564). * src/of-signal-2-error_state.patch: Add patch to fix compilation with Octave 8. * dist-files.mk: Add new file to dist.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 26 Nov 2021 17:03:51 +0100
parents
children
line wrap: on
line source

# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1637941971 -3600
#      Fri Nov 26 16:52:51 2021 +0100
# Node ID 8d0372aeaf46d24f1d1b22ffc1bbfa32e7623250
# Parent  7f535130c1912a5cc5021b5a761be02509219738
Fix compilation with Octave 8 (bug #61564).

* src/cl2bp.cc (Fcl2bp), src/sosfilt.cc (Fsosfilt), src/upfirdn.cc (Fupfirdn):
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 7f535130c191 -r 8d0372aeaf46 src/cl2bp.cc
--- a/src/cl2bp.cc	Thu Jun 17 00:46:56 2021 +0200
+++ b/src/cl2bp.cc	Fri Nov 26 16:52:51 2021 +0100
@@ -89,30 +89,10 @@
   }
 
   const int m = args(0).int_value(true);
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(0));
-    return retval;
-  }
   const double w1 = args(1).double_value();
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(1));
-    return retval;
-  }
   const double w2 = args(2).double_value();
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(2));
-    return retval;
-  }
   const ColumnVector up_vector(args(3).vector_value());
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(3));
-    return retval;
-  }
   const ColumnVector lo_vector(args(4).vector_value());
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(4));
-    return retval;
-  }
   if (up_vector.numel() != 3 || lo_vector.numel() != 3) {
     error("cl2bp: The up and lo vectors must contain 3 values");
     return retval;
@@ -126,10 +106,6 @@
   }
 
   const int L = args(5).int_value(true);
-  if (error_state) {
-    err_wrong_type_arg ("cl2bp", args(5));
-    return retval;
-  }
   if (L > 1000000) {
     error("cl2bp: The \"gridsize\" parameter cannot exceed 1000000");
     return retval;
diff -r 7f535130c191 -r 8d0372aeaf46 src/sosfilt.cc
--- a/src/sosfilt.cc	Thu Jun 17 00:46:56 2021 +0200
+++ b/src/sosfilt.cc	Fri Nov 26 16:52:51 2021 +0100
@@ -55,12 +55,6 @@
 
   Matrix sos( args(0).matrix_value() );
 
-  if (error_state)
-    {
-      err_wrong_type_arg ("sosfilt", args(0));
-      return retval;
-    }
-
   if (sos.columns() != 6)
     {
       error("Second-order section matrix must be a non-empty Lx6 matrix");
@@ -69,12 +63,6 @@
 
   Matrix x( args(1).matrix_value() );
 
-  if (error_state)
-    {
-      err_wrong_type_arg ("sosfilt", args(1));
-      return retval;
-    }
-
   int n=x.rows();
   int m=x.columns();
 
diff -r 7f535130c191 -r 8d0372aeaf46 src/upfirdn.cc
--- a/src/upfirdn.cc	Thu Jun 17 00:46:56 2021 +0200
+++ b/src/upfirdn.cc	Fri Nov 26 16:52:51 2021 +0100
@@ -107,51 +107,19 @@
     }
 
   ColumnVector h (args (1).vector_value ());
-
-  if (error_state)
-    {
-      err_wrong_type_arg ("upfirdn", args(1));
-      return retval;
-    }
-
   octave_idx_type p = args (2).idx_type_value ();
-
-  if (error_state)
-    {
-      err_wrong_type_arg ("upfirdn", args(2));
-      return retval;
-    }
-
   octave_idx_type q = args (3).idx_type_value ();
 
-  if (error_state)
-    {
-      err_wrong_type_arg ("upfirdn", args(3));
-      return retval;
-    }
-
   // Do the dispatching
   if (octave::signal::isreal (args (0)))
     {
       Matrix x = args (0).matrix_value ();
-      if (error_state)
-        {
-          err_wrong_type_arg ("upfirdn", args(0));
-          return retval;
-        }
-
       Matrix y = upfirdn (x, h, p, q);
       retval (0) = y;
     }
   else if (octave::signal::iscomplex (args (0)))
     {
       ComplexMatrix x = args (0).complex_matrix_value ();
-      if (error_state)
-        {
-          err_wrong_type_arg ("upfirdn", args(0));
-          return retval;
-        }
-
       ComplexMatrix y = upfirdn (x, h, p, q);
       retval (0) = y;
     }