Mercurial > octave
diff libinterp/corefcn/bitfcns.cc @ 17396:0b644adf4f31
speak CHAR_BIT in C++-ese
* bitfcns.cc, typecast.cc, data-conv.cc: Instead of CHAR_BIT, use
std::numeric_limits<unsigned char>::digits.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 09 Sep 2013 17:13:11 -0400 |
parents | e09cd91168d1 |
children | fedcd3717ebc |
line wrap: on
line diff
--- a/libinterp/corefcn/bitfcns.cc Mon Sep 09 08:47:06 2013 -0700 +++ b/libinterp/corefcn/bitfcns.cc Mon Sep 09 17:13:11 2013 -0400 @@ -24,6 +24,8 @@ #include <config.h> #endif +#include <limits> + #include "str-vec.h" #include "quit.h" @@ -588,7 +590,7 @@ mask = mask >> (bits_in_mantissa - nbits); else if (nbits < 1) mask = 0; - int bits_in_type = sizeof (double) * CHAR_BIT; + int bits_in_type = sizeof (double) * std::numeric_limits<unsigned char>::digits; NDArray m = m_arg.array_value (); DO_BITSHIFT ( ); } @@ -601,7 +603,7 @@ mask = mask >> (bits_in_mantissa - nbits); else if (nbits < 1) mask = 0; - int bits_in_type = sizeof (float) * CHAR_BIT; + int bits_in_type = sizeof (float) * std::numeric_limits<unsigned char>::digits; FloatNDArray m = m_arg.float_array_value (); DO_BITSHIFT (Float); }