Mercurial > octave
changeset 23589:63950abd2f81
maint: Deprecate is_null_type and replace with isnull.
* ov.h (is_null_type): Use OCTAVE_DEPRECATED macro around function.
* ov.h (isnull): New function.
* ov-base.h, ov-cell.cc, ov-null-mat.cc, ov-null-mat.h, ov-struct.cc, ov.cc:
Replace instances of is_null_type with isnull.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 13 Jun 2017 13:05:19 -0700 |
parents | 0549061d35b9 |
children | eb3c7abad98f |
files | libinterp/octave-value/ov-base.h libinterp/octave-value/ov-cell.cc libinterp/octave-value/ov-null-mat.cc libinterp/octave-value/ov-null-mat.h libinterp/octave-value/ov-struct.cc libinterp/octave-value/ov.cc libinterp/octave-value/ov.h |
diffstat | 7 files changed, 14 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base.h Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov-base.h Tue Jun 13 13:05:19 2017 -0700 @@ -429,7 +429,7 @@ virtual bool is_true (void) const { return false; } - virtual bool is_null_value (void) const { return false; } + virtual bool isnull (void) const { return false; } virtual bool is_constant (void) const { return false; }
--- a/libinterp/octave-value/ov-cell.cc Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov-cell.cc Tue Jun 13 13:05:19 2017 -0700 @@ -334,7 +334,7 @@ if (t_rhs.iscell ()) octave_base_matrix<Cell>::assign (i, t_rhs.cell_value ()); - else if (t_rhs.is_null_value ()) + else if (t_rhs.isnull ()) octave_base_matrix<Cell>::delete_elements (i); else octave_base_matrix<Cell>::assign (i, Cell (t_rhs));
--- a/libinterp/octave-value/ov-null-mat.cc Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov-null-mat.cc Tue Jun 13 13:05:19 2017 -0700 @@ -117,7 +117,7 @@ if (args.length () != 1) print_usage (); - return ovl (args(0).is_null_value ()); + return ovl (args(0).isnull ()); } /*
--- a/libinterp/octave-value/ov-null-mat.h Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov-null-mat.h Tue Jun 13 13:05:19 2017 -0700 @@ -48,7 +48,7 @@ static const octave_value instance; - bool is_null_value (void) const { return true; } + bool isnull (void) const { return true; } type_conv_info numeric_conversion_function (void) const; @@ -69,7 +69,7 @@ static const octave_value instance; - bool is_null_value (void) const { return true; } + bool isnull (void) const { return true; } type_conv_info numeric_conversion_function (void) const; @@ -90,7 +90,7 @@ static const octave_value instance; - bool is_null_value (void) const { return true; } + bool isnull (void) const { return true; } type_conv_info numeric_conversion_function (void) const;
--- a/libinterp/octave-value/ov-struct.cc Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov-struct.cc Tue Jun 13 13:05:19 2017 -0700 @@ -474,7 +474,7 @@ } else { - if (! t_rhs.is_null_value ()) + if (! t_rhs.isnull ()) error ("invalid structure assignment"); map.delete_elements (idx.front ());
--- a/libinterp/octave-value/ov.cc Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov.cc Tue Jun 13 13:05:19 2017 -0700 @@ -2126,7 +2126,7 @@ octave_value::storable_value (void) const { octave_value retval = *this; - if (is_null_value ()) + if (isnull ()) retval = octave_value (rep->empty_clone ()); else retval.maybe_economize (); @@ -2137,7 +2137,7 @@ void octave_value::make_storable_value (void) { - if (is_null_value ()) + if (isnull ()) { octave_base_value *rc = rep->empty_clone (); if (--rep->count == 0)
--- a/libinterp/octave-value/ov.h Tue Jun 13 12:43:42 2017 -0700 +++ b/libinterp/octave-value/ov.h Tue Jun 13 13:05:19 2017 -0700 @@ -615,8 +615,12 @@ bool is_magic_colon (void) const { return rep->is_magic_colon (); } + bool isnull (void) const + { return rep->isnull (); } + + OCTAVE_DEPRECATED ("use 'isnull' instead") bool is_null_value (void) const - { return rep->is_null_value (); } + { return rep->isnull (); } // Are any or all of the elements in this constant nonzero?