comparison libinterp/octave-value/ov-float.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
comparison
equal deleted inserted replaced
21117:c1df36373272 21118:3ac9f47fb04b
110 { 110 {
111 octave_value retval; 111 octave_value retval;
112 112
113 if (xisnan (scalar)) 113 if (xisnan (scalar))
114 err_nan_to_character_conversion (); 114 err_nan_to_character_conversion ();
115 else 115
116 { 116 int ival = NINT (scalar);
117 int ival = NINT (scalar); 117
118 118 if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ())
119 if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) 119 {
120 { 120 // FIXME: is there something better we could do?
121 // FIXME: is there something better we could do? 121
122 122 ival = 0;
123 ival = 0; 123
124 124 ::warning ("range error for conversion to character value");
125 ::warning ("range error for conversion to character value"); 125 }
126 } 126
127 127 retval = octave_value (std::string (1, static_cast<char> (ival)), type);
128 retval = octave_value (std::string (1, static_cast<char> (ival)), type);
129 }
130 128
131 return retval; 129 return retval;
132 } 130 }
133 131
134 bool 132 bool