summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-20 16:19:41 -0700
committerJosh Blum <josh@joshknows.com>2010-08-20 16:19:41 -0700
commit8673ee7235bb31f2f51ed2200952f605b0de1955 (patch)
tree1cec1254a44006f621384118cc12902cd3bfa627 /host
parent6798b4f8d7936cc77a979e8e6d22c24eb5c92678 (diff)
downloaduhd-8673ee7235bb31f2f51ed2200952f605b0de1955.tar.gz
uhd-8673ee7235bb31f2f51ed2200952f605b0de1955.tar.bz2
uhd-8673ee7235bb31f2f51ed2200952f605b0de1955.zip
uhd: removed msvc warnings and errors (no M_PI)
Diffstat (limited to 'host')
-rw-r--r--host/examples/tx_waveforms.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index f9c42b1c9..9886000b1 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -37,7 +37,7 @@ float gen_const(float){
}
float gen_square(float x){
- return (std::fmod(x, 1) < float(0.5))? 0 : 1;
+ return float((std::fmod(x, 1) < float(0.5))? 0 : 1);
}
float gen_ramp(float x){
@@ -45,7 +45,8 @@ float gen_ramp(float x){
}
float gen_sine(float x){
- return std::sin(x*2*M_PI);
+ static const float two_pi = 2*std::acos(float(-1));
+ return std::sin(x*two_pi);
}
int UHD_SAFE_MAIN(int argc, char *argv[]){
@@ -123,7 +124,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//allocate the buffer and precalculate values
std::vector<std::complex<float> > buff(spb);
- const float cps = wave_freq/sdev->get_tx_rate();
+ const float cps = float(wave_freq/sdev->get_tx_rate());
const float i_off = (wave_freq > 0)? float(0.25) : 0;
const float q_off = (wave_freq < 0)? float(0.25) : 0;
float theta = 0;