aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/convert/gen_convert_general.py
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-10-15 16:19:47 -0700
committerAshish Chaudhari <ashish@ettus.com>2015-10-15 16:19:47 -0700
commit6f93ac01b519b5e01b01d7b8bcc106e58fd50721 (patch)
tree20a45813fc01be561d1974e83efd242a1196396d /host/lib/convert/gen_convert_general.py
parentea982f5f0d4b138f230638624c5e17fa3902706d (diff)
parenteb2f57a6241ce04a3d89c5f41557658387440c3f (diff)
downloaduhd-6f93ac01b519b5e01b01d7b8bcc106e58fd50721.tar.gz
uhd-6f93ac01b519b5e01b01d7b8bcc106e58fd50721.tar.bz2
uhd-6f93ac01b519b5e01b01d7b8bcc106e58fd50721.zip
Merge branch 'master' into ashish/gpio_atr_redux
Diffstat (limited to 'host/lib/convert/gen_convert_general.py')
-rw-r--r--host/lib/convert/gen_convert_general.py12
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);
}}
}}
"""