Mercurial > hg > octave-nkf
diff libinterp/interp-core/gl-render.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 | 049e8bbff782 |
line wrap: on
line diff
--- a/libinterp/interp-core/gl-render.cc +++ b/libinterp/interp-core/gl-render.cc @@ -135,7 +135,7 @@ { int m = 1; - while (m < n && m < INT_MAX) + while (m < n && m < std::numeric_limits<int>::max ()) m <<= 1; return m; @@ -1425,7 +1425,7 @@ Matrix z = xform.zscale (props.get_zdata ().matrix_value ()); bool has_z = (z.numel () > 0); - int n = static_cast<int> (::xmin (::xmin (x.numel (), y.numel ()), (has_z ? z.numel () : INT_MAX))); + int n = static_cast<int> (::xmin (::xmin (x.numel (), y.numel ()), (has_z ? z.numel () : std::numeric_limits<int>::max ()))); octave_uint8 clip_mask = (props.is_clipping () ? 0x7F : 0x40), clip_ok (0x40); std::vector<octave_uint8> clip (n);