# HG changeset patch
# User Markus Mützel <markus.muetzel@gmx.de>
# Date 1528135840 -7200
#      Mon Jun 04 20:10:40 2018 +0200
# Node ID 1b4ba0322d6138c77e05b376c2b15a56de9e06c8
# Parent  93e527afc51d6a7cac7d7efb0749c9d49ed0ee55
Replace functions removed from Octave 5.0 (bug #54010).

* cl2bp.cc, sosfilt.cc, upfirdn.cc: Replace "gripe_wrong_type_arg" with
"err_wrong_type_arg".
* remez.cc: Replace "NINT" with "octave::math::nint".
* medfilt1.cc: Replace "is_complex_type" with "iscomplex".

diff -r 93e527afc51d -r 1b4ba0322d61 src/cl2bp.cc
--- a/src/cl2bp.cc	Wed May 09 11:15:25 2018 -0700
+++ b/src/cl2bp.cc	Mon Jun 04 20:10:40 2018 +0200
@@ -89,27 +89,27 @@
 
   const int m = args(0).int_value(true);
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(0));
+    err_wrong_type_arg ("cl2bp", args(0));
     return retval;
   }
   const double w1 = args(1).double_value();
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(1));
+    err_wrong_type_arg ("cl2bp", args(1));
     return retval;
   }
   const double w2 = args(2).double_value();
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(2));
+    err_wrong_type_arg ("cl2bp", args(2));
     return retval;
   }
   const ColumnVector up_vector(args(3).vector_value());
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(3));
+    err_wrong_type_arg ("cl2bp", args(3));
     return retval;
   }
   const ColumnVector lo_vector(args(4).vector_value());
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(4));
+    err_wrong_type_arg ("cl2bp", args(4));
     return retval;
   }
   if (up_vector.numel() != 3 || lo_vector.numel() != 3) {
@@ -126,7 +126,7 @@
 
   const int L = args(5).int_value(true);
   if (error_state) {
-    gripe_wrong_type_arg ("cl2bp", args(5));
+    err_wrong_type_arg ("cl2bp", args(5));
     return retval;
   }
   if (L > 1000000) {
diff -r 93e527afc51d -r 1b4ba0322d61 src/medfilt1.cc
--- a/src/medfilt1.cc	Wed May 09 11:15:25 2018 -0700
+++ b/src/medfilt1.cc	Mon Jun 04 20:10:40 2018 +0200
@@ -335,7 +335,7 @@
     {
       if (args(1).is_numeric_type ())
         {
-          if (args(1).numel () != 1 || args(1).is_complex_type ())
+          if (args(1).numel () != 1 || args(1).iscomplex ())
             error ("medfilt1: N must be a real scalar");
           else
             n = args(1).idx_type_value ();
@@ -349,7 +349,7 @@
           {
             if (args(3).numel () != 1)
               error ("medfilt1: DIM must be a scalar");
-            else if (args(3).is_complex_type ())
+            else if (args(3).iscomplex ())
               error ("medfilt1: DIM must be real");
 
             dim = round (args(3).double_value ());
diff -r 93e527afc51d -r 1b4ba0322d61 src/remez.cc
--- a/src/remez.cc	Wed May 09 11:15:25 2018 -0700
+++ b/src/remez.cc	Mon Jun 04 20:10:40 2018 +0200
@@ -789,7 +789,7 @@
     return retval;
   }
 
-  int numtaps = NINT (args(0).double_value()) + 1; // #coeff = filter order+1
+  int numtaps = octave::math::nint (args(0).double_value()) + 1; // #coeff = filter order+1
   if (numtaps < 4) {
     error("remez: number of taps must be an integer greater than 3");
     return retval;
@@ -846,7 +846,7 @@
     if (args(4).is_string() && !args(3).is_string())
       stype = args(4).string_value();
     else if (args(4).is_real_scalar())
-      density = NINT (args(4).double_value());
+      density = octave::math::nint (args(4).double_value ());
     else {
       error("remez: incorrect argument list");
       return retval;
@@ -855,7 +855,7 @@
   if (nargin > 5) {
     if (args(5).is_real_scalar()
         && !args(4).is_real_scalar())
-      density = NINT (args(5).double_value());
+      density = octave::math::nint (args(5).double_value ());
     else {
       error("remez: incorrect argument list");
       return retval;
diff -r 93e527afc51d -r 1b4ba0322d61 src/sosfilt.cc
--- a/src/sosfilt.cc	Wed May 09 11:15:25 2018 -0700
+++ b/src/sosfilt.cc	Mon Jun 04 20:10:40 2018 +0200
@@ -21,7 +21,7 @@
 #include <octave/oct.h>
 #include <octave/defun-dld.h>
 #include <octave/error.h>
-#include <octave/gripes.h>
+#include <octave/errwarn.h>
 #include <octave/pager.h>
 #include <octave/quit.h>
 #include <octave/variables.h>
@@ -56,7 +56,7 @@
 
   if (error_state)
     {
-      gripe_wrong_type_arg ("sosfilt", args(0));
+      err_wrong_type_arg ("sosfilt", args(0));
       return retval;
     }
 
@@ -70,7 +70,7 @@
 
   if (error_state)
     {
-      gripe_wrong_type_arg ("sosfilt", args(1));
+      err_wrong_type_arg ("sosfilt", args(1));
       return retval;
     }
 
diff -r 93e527afc51d -r 1b4ba0322d61 src/upfirdn.cc
--- a/src/upfirdn.cc	Wed May 09 11:15:25 2018 -0700
+++ b/src/upfirdn.cc	Mon Jun 04 20:10:40 2018 +0200
@@ -21,7 +21,7 @@
 #include <octave/oct.h>
 #include <octave/defun-dld.h>
 #include <octave/error.h>
-#include <octave/gripes.h>
+#include <octave/errwarn.h>
 #include <octave/pager.h>
 #include <octave/quit.h>
 #include <octave/variables.h>
@@ -109,7 +109,7 @@
 
   if (error_state)
     {
-      gripe_wrong_type_arg ("upfirdn", args(1));
+      err_wrong_type_arg ("upfirdn", args(1));
       return retval;
     }
 
@@ -117,7 +117,7 @@
 
   if (error_state)
     {
-      gripe_wrong_type_arg ("upfirdn", args(2));
+      err_wrong_type_arg ("upfirdn", args(2));
       return retval;
     }
 
@@ -125,7 +125,7 @@
 
   if (error_state)
     {
-      gripe_wrong_type_arg ("upfirdn", args(3));
+      err_wrong_type_arg ("upfirdn", args(3));
       return retval;
     }
 
@@ -135,19 +135,19 @@
       Matrix x = args (0).matrix_value ();
       if (error_state)
         {
-          gripe_wrong_type_arg ("upfirdn", args(0));
+          err_wrong_type_arg ("upfirdn", args(0));
           return retval;
         }
 
       Matrix y = upfirdn (x, h, p, q);
       retval (0) = y;
     }
-  else if (args (0).is_complex_type ())
+  else if (args (0).iscomplex ())
     {
       ComplexMatrix x = args (0).complex_matrix_value ();
       if (error_state)
         {
-          gripe_wrong_type_arg ("upfirdn", args(0));
+          err_wrong_type_arg ("upfirdn", args(0));
           return retval;
         }
 
@@ -156,7 +156,7 @@
     }
   else
     {
-      gripe_wrong_type_arg ("upfirdn", args(0));
+      err_wrong_type_arg ("upfirdn", args(0));
       return retval;
     }
 
