changeset 23585:570170b6eb09

maint: Deprecate is_float_type and replace with isfloat. * ov.h (is_float_type): Use OCTAVE_DEPRECATED macro around function. * ov.h (isfloat): New function. * __magick_read__.cc, bsxfun.cc, data.cc, dot.cc, eig.cc, ov-base.h, ov-class.cc, ov-complex.h, ov-cx-diag.h, ov-cx-mat.h, ov-cx-sparse.h, ov-float.h, ov-flt-complex.h, ov-flt-cx-diag.h, ov-flt-cx-mat.h, ov-flt-re-diag.h, ov-flt-re-mat.h, ov-java.cc, ov-lazy-idx.h, ov-perm.h, ov-range.h, ov-re-diag.h, ov-re-mat.h, ov-re-sparse.h, ov-scalar.h, ov.h: Replace instances of is_float_type with isfloat.
author Rik <rik@octave.org>
date Tue, 13 Jun 2017 09:52:59 -0700
parents 7ed6b258db91
children f6c5db0a02e7
files libinterp/corefcn/__magick_read__.cc libinterp/corefcn/bsxfun.cc libinterp/corefcn/data.cc libinterp/corefcn/dot.cc libinterp/corefcn/eig.cc libinterp/octave-value/ov-base.h libinterp/octave-value/ov-class.cc libinterp/octave-value/ov-complex.h libinterp/octave-value/ov-cx-diag.h libinterp/octave-value/ov-cx-mat.h libinterp/octave-value/ov-cx-sparse.h libinterp/octave-value/ov-float.h libinterp/octave-value/ov-flt-complex.h libinterp/octave-value/ov-flt-cx-diag.h libinterp/octave-value/ov-flt-cx-mat.h libinterp/octave-value/ov-flt-re-diag.h libinterp/octave-value/ov-flt-re-mat.h libinterp/octave-value/ov-java.cc libinterp/octave-value/ov-lazy-idx.h libinterp/octave-value/ov-perm.h libinterp/octave-value/ov-range.h libinterp/octave-value/ov-re-diag.h libinterp/octave-value/ov-re-mat.h libinterp/octave-value/ov-re-sparse.h libinterp/octave-value/ov-scalar.h libinterp/octave-value/ov.h
diffstat 26 files changed, 33 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/__magick_read__.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/corefcn/__magick_read__.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -1503,7 +1503,7 @@
       else if (img.is_uint32_type ())
         encode_uint_image<uint32NDArray> (imvec, img.uint32_array_value (),
                                           alpha.uint32_array_value ());
-      else if (img.is_float_type ())
+      else if (img.isfloat ())
         {
           // For image formats that support floating point values, we write
           // the actual values.  For those who don't, we only use the values
--- a/libinterp/corefcn/bsxfun.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/corefcn/bsxfun.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -530,7 +530,7 @@
                   if (have_FloatNDArray
                       || have_FloatComplexNDArray)
                     {
-                      if (! tmp(0).is_float_type ())
+                      if (! tmp(0).isfloat ())
                         {
                           if (have_FloatNDArray)
                             {
@@ -582,7 +582,7 @@
                     }
                   else if (have_NDArray)
                     {
-                      if (! tmp(0).is_float_type ())
+                      if (! tmp(0).isfloat ())
                         {
                           have_NDArray = false;
                           C = result_NDArray;
--- a/libinterp/corefcn/data.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/corefcn/data.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -3210,7 +3210,7 @@
   if (args.length () != 1)
     print_usage ();
 
-  return ovl (args(0).is_float_type ());
+  return ovl (args(0).isfloat ());
 }
 
 // FIXME: perhaps this should be implemented with an
--- a/libinterp/corefcn/dot.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/corefcn/dot.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -149,7 +149,7 @@
           retval = z;
         }
     }
-  else if (argx.is_float_type () && argy.is_float_type ())
+  else if (argx.isfloat () && argy.isfloat ())
     {
       if (argx.is_single_type () || argy.is_single_type ())
         {
--- a/libinterp/corefcn/eig.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/corefcn/eig.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -111,7 +111,7 @@
   if (arg_a.isempty ())
     return octave_value_list (2, Matrix ());
 
-  if (! arg_a.is_float_type ())
+  if (! arg_a.isfloat ())
     err_wrong_type_arg ("eig", arg_a);
 
   if (arg_a.rows () != arg_a.columns ())
@@ -127,7 +127,7 @@
       if (arg_b.isempty ())
         return octave_value_list (2, Matrix ());
 
-      if (! arg_b.is_float_type ())
+      if (! arg_b.isfloat ())
         err_wrong_type_arg ("eig", arg_b);
 
       if (arg_b.rows () != arg_b.columns ())
--- a/libinterp/octave-value/ov-base.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-base.h	Tue Jun 13 09:52:59 2017 -0700
@@ -391,7 +391,7 @@
 
   virtual bool is_single_type (void) const { return false; }
 
-  virtual bool is_float_type (void) const { return false; }
+  virtual bool isfloat (void) const { return false; }
 
   virtual bool is_int8_type (void) const { return false; }
 
--- a/libinterp/octave-value/ov-class.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-class.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -1809,7 +1809,7 @@
     {
       std::string cls = clsnames(idx);
       if (obj_cls == cls
-          || (cls == "float"   && obj.is_float_type   ())
+          || (cls == "float"   && obj.isfloat   ())
           || (cls == "integer" && obj.isinteger ())
           || (cls == "numeric" && obj.is_numeric_type ())
           || obj.is_instance_of (cls))
--- a/libinterp/octave-value/ov-complex.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-complex.h	Tue Jun 13 09:52:59 2017 -0700
@@ -96,7 +96,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-cx-diag.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-cx-diag.h	Tue Jun 13 09:52:59 2017 -0700
@@ -69,7 +69,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   DiagMatrix diag_matrix_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-cx-mat.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-cx-mat.h	Tue Jun 13 09:52:59 2017 -0700
@@ -98,7 +98,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-cx-sparse.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-cx-sparse.h	Tue Jun 13 09:52:59 2017 -0700
@@ -101,7 +101,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-float.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-float.h	Tue Jun 13 09:52:59 2017 -0700
@@ -89,7 +89,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   int8NDArray
   int8_array_value (void) const
--- a/libinterp/octave-value/ov-flt-complex.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-flt-complex.h	Tue Jun 13 09:52:59 2017 -0700
@@ -92,7 +92,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-flt-cx-diag.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-flt-cx-diag.h	Tue Jun 13 09:52:59 2017 -0700
@@ -67,7 +67,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   DiagMatrix diag_matrix_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-flt-cx-mat.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-flt-cx-mat.h	Tue Jun 13 09:52:59 2017 -0700
@@ -96,7 +96,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-flt-re-diag.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-flt-re-diag.h	Tue Jun 13 09:52:59 2017 -0700
@@ -67,7 +67,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   DiagMatrix diag_matrix_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-flt-re-mat.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-flt-re-mat.h	Tue Jun 13 09:52:59 2017 -0700
@@ -101,7 +101,7 @@
 
   bool is_single_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   int8NDArray
   int8_array_value (void) const { return int8NDArray (matrix); }
--- a/libinterp/octave-value/ov-java.cc	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-java.cc	Tue Jun 13 09:52:59 2017 -0700
@@ -1545,7 +1545,7 @@
         UNBOX_PRIMITIVE_ARRAY ( , , jdouble,  Double);
       else if (val.islogical ())
         UNBOX_PRIMITIVE_ARRAY (bool_, bool, jboolean, Boolean);
-      else if (val.is_float_type ())
+      else if (val.isfloat ())
         UNBOX_PRIMITIVE_ARRAY (float_, Float, jfloat, Float);
       else if (val.is_int8_type ())
         UNBOX_PRIMITIVE_ARRAY (int8_, int8, jbyte, Byte);
@@ -1587,7 +1587,7 @@
         UNBOX_PRIMITIVE_SCALAR (double, double, "java/lang/Double", "(D)V");
       else if (val.islogical ())
         UNBOX_PRIMITIVE_SCALAR (bool, bool, "java/lang/Boolean", "(Z)V");
-      else if (val.is_float_type ())
+      else if (val.isfloat ())
         UNBOX_PRIMITIVE_SCALAR (float, float, "java/lang/Float", "(F)V");
       else if (val.is_int8_type ())
         UNBOX_PRIMITIVE_SCALAR (int8_t, int8_scalar, "java/lang/Byte", "(B)V");
--- a/libinterp/octave-value/ov-lazy-idx.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-lazy-idx.h	Tue Jun 13 09:52:59 2017 -0700
@@ -73,7 +73,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   octave_value subsref (const std::string& type,
                         const std::list<octave_value_list>& idx)
--- a/libinterp/octave-value/ov-perm.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-perm.h	Tue Jun 13 09:52:59 2017 -0700
@@ -122,7 +122,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   bool is_true (void) const;
 
--- a/libinterp/octave-value/ov-range.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-range.h	Tue Jun 13 09:52:59 2017 -0700
@@ -161,7 +161,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   bool is_numeric_type (void) const { return true; }
 
--- a/libinterp/octave-value/ov-re-diag.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-re-diag.h	Tue Jun 13 09:52:59 2017 -0700
@@ -72,7 +72,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   DiagMatrix diag_matrix_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-re-mat.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-re-mat.h	Tue Jun 13 09:52:59 2017 -0700
@@ -114,7 +114,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   int8NDArray
   int8_array_value (void) const { return int8NDArray (matrix); }
--- a/libinterp/octave-value/ov-re-sparse.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-re-sparse.h	Tue Jun 13 09:52:59 2017 -0700
@@ -101,7 +101,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   double double_value (bool = false) const;
 
--- a/libinterp/octave-value/ov-scalar.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov-scalar.h	Tue Jun 13 09:52:59 2017 -0700
@@ -88,7 +88,7 @@
 
   bool is_double_type (void) const { return true; }
 
-  bool is_float_type (void) const { return true; }
+  bool isfloat (void) const { return true; }
 
   int8NDArray
   int8_array_value (void) const
--- a/libinterp/octave-value/ov.h	Tue Jun 13 09:20:08 2017 -0700
+++ b/libinterp/octave-value/ov.h	Tue Jun 13 09:52:59 2017 -0700
@@ -633,8 +633,12 @@
   bool is_single_type (void) const
   { return rep->is_single_type (); }
 
+  bool isfloat (void) const
+  { return rep->isfloat (); }
+
+  OCTAVE_DEPRECATED ("use 'isfloat' instead")
   bool is_float_type (void) const
-  { return rep->is_float_type (); }
+  { return rep->isfloat (); }
 
   // Integer types.