commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r5220 - gnuradio/trunk/gnuradio-core/src/lib/gengen


From: eb
Subject: [Commit-gnuradio] r5220 - gnuradio/trunk/gnuradio-core/src/lib/gengen
Date: Tue, 1 May 2007 22:03:32 -0600 (MDT)

Author: eb
Date: 2007-05-01 22:03:32 -0600 (Tue, 01 May 2007)
New Revision: 5220

Modified:
   gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t
Log:
cleaned up some warnings

Modified: gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t    
2007-05-02 04:02:29 UTC (rev 5219)
+++ gnuradio/trunk/gnuradio-core/src/lib/gengen/gr_sig_source_X.cc.t    
2007-05-02 04:03:32 UTC (rev 5220)
@@ -181,19 +181,19 @@
   /* The triangle wave rises from -PI to 0 and falls from 0 to PI.     */ 
   case GR_TRI_WAVE:    
     for (int i = 0; i < noutput_items; i++){
-      t = (@TYPE@) d_ampl*d_nco.get_phase()/M_PI;
-        if (d_nco.get_phase() < 0)
-          optr[i] = t + d_ampl + d_offset;
-        else
-          optr[i] = -1*t + d_ampl + d_offset;
-        d_nco.step();
+      double t = d_ampl*d_nco.get_phase()/M_PI;
+      if (d_nco.get_phase() < 0)
+       optr[i] = static_cast<@TYPE@>(t + d_ampl + d_offset);
+      else
+       optr[i] = static_cast<@TYPE@>(-1*t + d_ampl + d_offset);
+      d_nco.step();
     }
     break;
        
   /* The saw tooth wave rises from -PI to PI.  */
   case GR_SAW_WAVE:    
     for (int i = 0; i < noutput_items; i++){
-      t = (@TYPE@) d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2 + d_offset;
+      t = static_cast<@TYPE@>(d_ampl*d_nco.get_phase()/(2*M_PI) + d_ampl/2 + 
d_offset);
       optr[i] = t;             
       d_nco.step();
     }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]