diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2016-08-06 14:45:18 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2016-08-06 14:45:18 -0700 |
commit | 76b0159d29b72430c1a370c4fb524f610f43c2e6 (patch) | |
tree | 2fe694b0c5dab25fbdd45c48380f0f43a00e092f | |
parent | 124c641c12c091368bf79c6fa612eded9de8e2f4 (diff) | |
parent | 87846f81b939ab8fa32ffaf4da3cd9a869039a95 (diff) |
Merge branch 'maint'
-rw-r--r-- | gnuradio-runtime/include/gnuradio/attributes.h | 8 | ||||
-rw-r--r-- | gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc | 10 | ||||
-rw-r--r-- | gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc | 8 |
3 files changed, 14 insertions, 12 deletions
diff --git a/gnuradio-runtime/include/gnuradio/attributes.h b/gnuradio-runtime/include/gnuradio/attributes.h index 0102c110c2..250683f248 100644 --- a/gnuradio-runtime/include/gnuradio/attributes.h +++ b/gnuradio-runtime/include/gnuradio/attributes.h @@ -81,12 +81,10 @@ //////////////////////////////////////////////////////////////////////// // implement cross-compiler VLA macros //////////////////////////////////////////////////////////////////////// -#ifdef C99 -# define __GR_VLA(TYPE, buf, size) TYPE buf[size] -# define __GR_VLA2D(TYPE, buf, size, size2) TYPE buf[size][size2] -#else +#ifdef _MSC_VER # define __GR_VLA(TYPE, buf, size) TYPE * buf = (TYPE *) alloca(sizeof(TYPE) * (size)) -# define __GR_VLA2D(TYPE, buf, size, size2) TYPE ** buf = (TYPE **) alloca(sizeof(TYPE) * (size) * (size2)) +#else +# define __GR_VLA(TYPE, buf, size) TYPE buf[size] #endif #endif /* INCLUDED_GNURADIO_ATTRIBUTES_H */ diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc index 9e45c81018..c10a77c98a 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_deinterleaver_impl.cc @@ -26,10 +26,13 @@ #include "dvbt_bit_inner_deinterleaver_impl.h" #include <stdio.h> +#define MAX_MODULATION_ORDER 6 +#define INTERLEAVER_BLOCK_SIZE 126 + namespace gr { namespace dtv { - const int dvbt_bit_inner_deinterleaver_impl::d_bsize = 126; + const int dvbt_bit_inner_deinterleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; int dvbt_bit_inner_deinterleaver_impl::H(int e, int w) @@ -135,9 +138,8 @@ namespace gr { // First index of d_b is Bit interleaver number // Second index of d_b is the position inside Bit interleaver - // Linux: unsigned char d_b[d_v][d_bsize]; - __GR_VLA2D(unsigned char, d_b, d_v, d_bsize); - + unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; + for (int bcount = 0; bcount < bmax; bcount++) { for (int w = 0; w < d_bsize; w++) { int c = in[(bcount * d_bsize) + w]; diff --git a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc index a5a9847812..43146f02c5 100644 --- a/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_bit_inner_interleaver_impl.cc @@ -26,10 +26,13 @@ #include "dvbt_bit_inner_interleaver_impl.h" #include <stdio.h> +#define MAX_MODULATION_ORDER 6 +#define INTERLEAVER_BLOCK_SIZE 126 + namespace gr { namespace dtv { - const int dvbt_bit_inner_interleaver_impl::d_bsize = 126; + const int dvbt_bit_inner_interleaver_impl::d_bsize = INTERLEAVER_BLOCK_SIZE; int dvbt_bit_inner_interleaver_impl::H(int e, int w) @@ -137,8 +140,7 @@ namespace gr { // First index of d_b is Bit interleaver number // Second index of d_b is the position inside the Bit interleaver - // Linux: unsigned char d_b[d_v][d_bsize]; - __GR_VLA2D(unsigned char, d_b, d_v, d_bsize); + unsigned char d_b[MAX_MODULATION_ORDER][INTERLEAVER_BLOCK_SIZE]; for (int bcount = 0; bcount < bmax; bcount++) { for (int i = 0; i < d_bsize; i++) { |