diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2015-10-15 16:19:27 -0700 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2015-10-15 16:19:27 -0700 |
commit | c41a7fa386a467ba76d5f09f390cb62a1bfa7282 (patch) | |
tree | 3f458325c74af227b5745ce5390624f8fc94f638 /host/lib/convert | |
parent | 09a69b22ae41ca6b9935508d523ae88df58301f3 (diff) | |
parent | eb2f57a6241ce04a3d89c5f41557658387440c3f (diff) | |
download | uhd-c41a7fa386a467ba76d5f09f390cb62a1bfa7282.tar.gz uhd-c41a7fa386a467ba76d5f09f390cb62a1bfa7282.tar.bz2 uhd-c41a7fa386a467ba76d5f09f390cb62a1bfa7282.zip |
Merge branch 'master' into x300/dram
Diffstat (limited to 'host/lib/convert')
-rw-r--r-- | host/lib/convert/gen_convert_general.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/host/lib/convert/gen_convert_general.py b/host/lib/convert/gen_convert_general.py index ac8d7c7bd..5c62d51df 100644 --- a/host/lib/convert/gen_convert_general.py +++ b/host/lib/convert/gen_convert_general.py @@ -122,10 +122,8 @@ DECLARE_CONVERTER(s16, 1, s16_item32_{end}, 1, PRIORITY_GENERAL) {{ }} // 2) If nsamps was not a multiple of 2, copy the last one by hand if (nsamps % 2) {{ - const s16_t *last_input_word = reinterpret_cast<const s16_t *>(&input[n_words]); - s16_t *last_output_word = reinterpret_cast<s16_t *>(&output[n_words]); - last_output_word[0] = last_input_word[0]; - output[n_words] = {to_wire}(output[n_words]); + item32_t tmp = item32_t(*reinterpret_cast<const s16_t *>(&input[n_words])); + output[n_words] = {to_wire}(tmp); }} }} @@ -140,10 +138,8 @@ DECLARE_CONVERTER(s16_item32_{end}, 1, s16, 1, PRIORITY_GENERAL) {{ }} // 2) If nsamps was not a multiple of 2, copy the last one by hand if (nsamps % 2) {{ - item32_t last_input_word = {to_host}(input[n_words]); - const s16_t *last_input_word_ptr = reinterpret_cast<const s16_t *>(&last_input_word); - s16_t *last_output_word = reinterpret_cast<s16_t *>(&output[n_words]); - last_output_word[0] = last_input_word_ptr[0]; + item32_t tmp = {to_host}(input[n_words]); + *reinterpret_cast<s16_t *>(&output[n_words]) = s16_t(tmp); }} }} """ |