Mercurial > octave
diff libinterp/octave-value/ov-flt-re-mat.cc @ 15215:9020dddc925a
use std::numeric_limits for integer max and min values
* strfind.cc, gl-render.cc, jit-typeinfo.cc, oct-stream.cc,
sparse-xpow.cc, xpow.cc, debug.cc, file-io.cc, ls-oct-ascii.cc,
oct-hist.cc, pr-output.cc, utils.cc, variables.h, ov-base-int.cc,
ov-base.cc, ov-bool-sparse.cc, ov-cx-sparse.cc, ov-float.cc,
ov-flt-re-mat.cc, ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc,
ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-struct.cc,
ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc, Array.cc,
Sparse.cc, chNDArray.cc, dNDArray.cc, data-conv.cc, data-conv.h,
fNDArray.cc, kpse.cc, oct-inttypes.h, oct-time.cc:
Use std::numeric_limits for max and min integer values. Include
<limits>, not <climits>.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Aug 2012 17:36:54 -0400 |
parents | 2fc554ffbc28 |
children | ecf5be238b4a |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-flt-re-mat.cc Wed Aug 22 13:46:29 2012 -0700 +++ b/libinterp/octave-value/ov-flt-re-mat.cc Wed Aug 22 17:36:54 2012 -0400 @@ -25,9 +25,8 @@ #include <config.h> #endif -#include <climits> - #include <iostream> +#include <limits> #include <vector> #include "data-conv.h" @@ -69,10 +68,6 @@ #include "ls-utils.h" #include "ls-hdf5.h" -#if ! defined (UCHAR_MAX) -#define UCHAR_MAX 255 -#endif - template class octave_base_matrix<FloatNDArray>; DEFINE_OCTAVE_ALLOCATOR (octave_float_matrix); @@ -308,7 +303,7 @@ { int ival = NINT (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) { // FIXME -- is there something // better we could do?