From: Johnathan Corgan Date: Wed, 14 Jul 2010 01:22:50 +0000 (-0700) Subject: gnuradio-core: add ASSERTs for proper alignment X-Git-Url: https://git.gag.com/?p=debian%2Fgnuradio;a=commitdiff_plain;h=327f3c9cb84021a52f1542afd1e843310e35578f gnuradio-core: add ASSERTs for proper alignment --- diff --git a/gnuradio-core/src/lib/filter/qa_gr_fir_fcc.cc b/gnuradio-core/src/lib/filter/qa_gr_fir_fcc.cc index 25083bb2..b84b590a 100644 --- a/gnuradio-core/src/lib/filter/qa_gr_fir_fcc.cc +++ b/gnuradio-core/src/lib/filter/qa_gr_fir_fcc.cc @@ -109,6 +109,7 @@ test_random_io (fir_maker_t maker) const int INPUT_LEN = MAX_TAPS + OUTPUT_LEN; i_type input_raw[INPUT_LEN + 4*16/sizeof(i_type)]; + CPPUNIT_ASSERT(((intptr_t) input_raw & 0x3) == 0); memset(input_raw, 0, sizeof(input_raw)); i_type *input = &input_raw[2*16/sizeof(i_type)]; diff --git a/gnuradio-core/src/lib/filter/qa_gr_fir_fff.cc b/gnuradio-core/src/lib/filter/qa_gr_fir_fff.cc index 60ba7609..74de6dac 100644 --- a/gnuradio-core/src/lib/filter/qa_gr_fir_fff.cc +++ b/gnuradio-core/src/lib/filter/qa_gr_fir_fff.cc @@ -148,9 +148,11 @@ test_random_io (fir_maker_t maker) const int INPUT_LEN = MAX_TAPS + OUTPUT_LEN; i_type input_raw[INPUT_LEN + 4*16/sizeof(i_type)]; + CPPUNIT_ASSERT(((intptr_t) input_raw & 0x3) == 0); memset(input_raw, 0, sizeof(input_raw)); i_type *input = &input_raw[2*16/sizeof(i_type)]; + o_type expected_output[OUTPUT_LEN]; o_type actual_output[OUTPUT_LEN]; tap_type taps[MAX_TAPS]; diff --git a/gnuradio-core/src/lib/filter/qa_gr_fir_scc.cc b/gnuradio-core/src/lib/filter/qa_gr_fir_scc.cc index 21e0da60..21b82104 100644 --- a/gnuradio-core/src/lib/filter/qa_gr_fir_scc.cc +++ b/gnuradio-core/src/lib/filter/qa_gr_fir_scc.cc @@ -107,6 +107,7 @@ test_random_io (fir_maker_t maker) const int INPUT_LEN = MAX_TAPS + OUTPUT_LEN; i_type input_raw[INPUT_LEN + 4*16/sizeof(i_type)]; + CPPUNIT_ASSERT(((intptr_t) input_raw & 0x3) == 0); memset(input_raw, 0, sizeof(input_raw)); i_type *input = &input_raw[2*16/sizeof(i_type)]; diff --git a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator.cc b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator.cc index a4deafb9..2047f99d 100644 --- a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator.cc +++ b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator.cc @@ -44,6 +44,7 @@ qa_gri_mmse_fir_interpolator::t1 () static const unsigned N = 100; float input_raw[N + 10 + 4*16/sizeof(float)]; + CPPUNIT_ASSERT(((intptr_t) input_raw & 0x3) == 0); memset(input_raw, 0, sizeof(input_raw)); float *input = &input_raw[2*16/sizeof(float)];