diff options
author | Tom Rondeau | 2011-10-24 00:19:16 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-10-24 00:19:16 -0400 |
commit | 2cc26e4d8b835683ff0289e3cea2e2120738cf2a (patch) | |
tree | d083835d08ffb4a2126c4fac0ecbf927e81414f1 | |
parent | acd378df821766371f6ea8673e0eabee6cbf3223 (diff) | |
download | gnuradio-2cc26e4d8b835683ff0289e3cea2e2120738cf2a.tar.gz gnuradio-2cc26e4d8b835683ff0289e3cea2e2120738cf2a.tar.bz2 gnuradio-2cc26e4d8b835683ff0289e3cea2e2120738cf2a.zip |
core: fixed float_to_int for 32-bit machines.
-rw-r--r-- | gnuradio-core/src/lib/general/gri_float_to_int.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/general/gri_float_to_int.cc b/gnuradio-core/src/lib/general/gri_float_to_int.cc index 0b29abfd9..8a05da7b4 100644 --- a/gnuradio-core/src/lib/general/gri_float_to_int.cc +++ b/gnuradio-core/src/lib/general/gri_float_to_int.cc @@ -28,15 +28,15 @@ #include <gri_float_to_int.h> #include <math.h> -static const int MIN_INT = -2147483648; // -2^31 -static const int MAX_INT = 2147483647; // (2^31)-1 +static const long int MAX_INT = 2147483647; // (2^31)-1 +static const long int MIN_INT = -2147483648; // -2^31 void gri_float_to_int (const float *in, int *out, int nsamples) { for (int i = 0; i < nsamples; i++){ - long int r = (long int) rint (in[i]); + long int r = static_cast<long int>(rint(in[i])); if (r < MIN_INT) r = MIN_INT; else if (r > MAX_INT) |