Mercurial > jwe > octave
diff libinterp/octave-value/ov-scalar.cc @ 21118:3ac9f47fb04b
Invert pattern if/code/else/err_XXX to if !/err_XXX/code.
* daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, load-save.cc, lsode.cc,
quad.cc, xnorm.cc, xpow.cc, ov-base-diag.cc, ov-base-mat.cc, ov-base-scalar.cc,
ov-base.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc, ov-ch-mat.cc,
ov-class.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-flt-cx-mat.cc,
ov-flt-re-mat.cc, ov-intx.h, ov-perm.cc, ov-range.cc, ov-re-mat.cc,
ov-re-sparse.cc, ov-scalar.cc, ov-struct.cc, ov.cc, pt-idx.cc, Array-util.cc,
Array.cc, Sparse.cc, lo-specfun.cc, mx-inlines.cc, oct-binmap.h:
Invert pattern if/code/else/err_XXX to if !/err_XXX/code.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 20 Jan 2016 16:08:30 -0800 |
parents | dfcb9d74b253 |
children | fcac5dbbf9ed |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-scalar.cc Wed Jan 20 15:45:58 2016 -0800 +++ b/libinterp/octave-value/ov-scalar.cc Wed Jan 20 16:08:30 2016 -0800 @@ -127,21 +127,19 @@ if (xisnan (scalar)) err_nan_to_character_conversion (); - else - { - int ival = NINT (scalar); + + int ival = NINT (scalar); - if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) - { - // FIXME: is there something better we could do? + if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) + { + // FIXME: is there something better we could do? - ival = 0; + ival = 0; - ::warning ("range error for conversion to character value"); - } + ::warning ("range error for conversion to character value"); + } - retval = octave_value (std::string (1, static_cast<char> (ival)), type); - } + retval = octave_value (std::string (1, static_cast<char> (ival)), type); return retval; }