aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/wavetable.hpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-02-19 14:16:24 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-19 17:01:40 -0800
commit305d0e79e219b427c6425dab0715ed2132d928b8 (patch)
tree9962f0fd34c1d0488255785cf99243708dec4fb6 /host/examples/wavetable.hpp
parent21b5f2c6aa88af5488b140da0ef7ed34cc14153f (diff)
downloaduhd-305d0e79e219b427c6425dab0715ed2132d928b8.tar.gz
uhd-305d0e79e219b427c6425dab0715ed2132d928b8.tar.bz2
uhd-305d0e79e219b427c6425dab0715ed2132d928b8.zip
examples: Fix some minor compiler warnings
All warnings reported by MSVC. Mostly related to narrowing conversions.
Diffstat (limited to 'host/examples/wavetable.hpp')
-rw-r--r--host/examples/wavetable.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/host/examples/wavetable.hpp b/host/examples/wavetable.hpp
index acced0d3a..8fdc8db30 100644
--- a/host/examples/wavetable.hpp
+++ b/host/examples/wavetable.hpp
@@ -19,7 +19,7 @@ public:
_wave_table(wave_table_len)
{
//compute real wave table with 1.0 amplitude
- std::vector<double> real_wave_table(wave_table_len);
+ std::vector<float> real_wave_table(wave_table_len);
if (wave_type == "CONST"){
for (size_t i = 0; i < wave_table_len; i++)
real_wave_table[i] = 1.0;
@@ -42,7 +42,10 @@ public:
//compute i and q pairs with 90% offset and scale to amplitude
for (size_t i = 0; i < wave_table_len; i++){
const size_t q = (i+(3*wave_table_len)/4)%wave_table_len;
- _wave_table[i] = std::complex<float>(ampl*real_wave_table[i], ampl*real_wave_table[q]);
+ _wave_table[i] = std::complex<float>(
+ ampl*real_wave_table[i],
+ ampl*real_wave_table[q]
+ );
}
}