From 8673ee7235bb31f2f51ed2200952f605b0de1955 Mon Sep 17 00:00:00 2001
From: Josh Blum <josh@joshknows.com>
Date: Fri, 20 Aug 2010 16:19:41 -0700
Subject: uhd: removed msvc warnings and errors (no M_PI)

---
 host/examples/tx_waveforms.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'host/examples')

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;
-- 
cgit v1.2.3