diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2012-06-29 21:27:22 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2012-06-29 21:27:22 +0200 |
commit | c92822469c0137e0afffa1b5bd7e4b5b864caac9 (patch) | |
tree | 19c4e46fc0e1392397b2b990b86a22c0fcf11d41 /lib/rtl/rtl_source_c.cc | |
parent | 9c8f240a63c7648f65e5afaaf043f2a048d3697e (diff) |
use endianness provided by boost
Diffstat (limited to 'lib/rtl/rtl_source_c.cc')
-rw-r--r-- | lib/rtl/rtl_source_c.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rtl/rtl_source_c.cc b/lib/rtl/rtl_source_c.cc index ffd25fe..4537c89 100644 --- a/lib/rtl/rtl_source_c.cc +++ b/lib/rtl/rtl_source_c.cc @@ -32,6 +32,7 @@ #include <boost/assign.hpp> #include <boost/format.hpp> +#include <boost/detail/endian.hpp> #include <stdexcept> #include <iostream> @@ -112,10 +113,10 @@ rtl_source_c::rtl_source_c (const std::string &args) // create a lookup table for gr_complex values for (unsigned int i = 0; i <= 0xffff; i++) { -#if 1 // little endian +#ifdef BOOST_LITTLE_ENDIAN _lut.push_back( gr_complex( (float(i & 0xff) - 127.5f) * (1.0f/128.0f), (float(i >> 8) - 127.5f) * (1.0f/128.0f) ) ); -#else // big endian +#else // BOOST_BIG_ENDIAN _lut.push_back( gr_complex( (float(i >> 8) - 127.5f) * (1.0f/128.0f), (float(i & 0xff) - 127.5f) * (1.0f/128.0f) ) ); #endif |