commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 02/13: do not use deprecated gr_int* types


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/13: do not use deprecated gr_int* types
Date: Fri, 3 Apr 2015 19:59:34 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 5c56ab77b779257bc908e45d7d7e0ff790e9e28d
Author: Jiří Pinkava <address@hidden>
Date:   Tue Mar 24 02:43:10 2015 +0100

    do not use deprecated gr_int* types
---
 gnuradio-runtime/include/gnuradio/fxpt.h         | 19 ++++++++++---------
 gnuradio-runtime/include/gnuradio/fxpt_vco.h     |  2 +-
 gnuradio-runtime/lib/math/qa_fxpt.cc             |  6 +++---
 gr-analog/lib/frequency_modulator_fc_impl.cc     |  2 +-
 gr-atsc/include/gnuradio/atsc/field_sync_demux.h |  4 ++--
 gr-pager/lib/flex_parse_impl.cc                  |  4 ++--
 6 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/gnuradio-runtime/include/gnuradio/fxpt.h 
b/gnuradio-runtime/include/gnuradio/fxpt.h
index 6143aca..ded32ed 100644
--- a/gnuradio-runtime/include/gnuradio/fxpt.h
+++ b/gnuradio-runtime/include/gnuradio/fxpt.h
@@ -25,6 +25,7 @@
 
 #include <gnuradio/api.h>
 #include <gnuradio/types.h>
+#include <stdint.h>
 
 namespace gr {
 
@@ -47,18 +48,18 @@ namespace gr {
     static const float TWO_TO_THE_31;
 
   public:
-    static gr_int32
+    static int32_t
       float_to_fixed(float x)
     {
       // Fold x into -PI to PI.
       int d = (int)floor(x/2/PI+0.5);
       x -= d*2*PI;
       // And convert to an integer.
-      return (gr_int32) ((float) x * TWO_TO_THE_31 / PI);
+      return (int32_t) ((float) x * TWO_TO_THE_31 / PI);
     }
 
     static float
-      fixed_to_float (gr_int32 x)
+      fixed_to_float (int32_t x)
     {
       return x * (PI / TWO_TO_THE_31);
     }
@@ -67,9 +68,9 @@ namespace gr {
      * \brief Given a fixed point angle x, return float sine (x)
      */
     static float
-      sin(gr_int32 x)
+      sin(int32_t x)
     {
-      gr_uint32 ux = x;
+      uint32_t ux = x;
       int index = ux >> (WORDBITS - NBITS);
       return s_sine_table[index][0] * (ux >> 1) + s_sine_table[index][1];
     }
@@ -78,9 +79,9 @@ namespace gr {
      * \brief Given a fixed point angle x, return float cosine (x)
      */
     static float
-      cos (gr_int32 x)
+      cos (int32_t x)
     {
-      gr_uint32 ux = x + 0x40000000;
+      uint32_t ux = x + 0x40000000;
       int index = ux >> (WORDBITS - NBITS);
       return s_sine_table[index][0] * (ux >> 1) + s_sine_table[index][1];
     }
@@ -88,9 +89,9 @@ namespace gr {
     /*
      * \brief Given a fixedpoint angle x, return float cos(x) and sin (x)
      */
-    static void sincos(gr_int32 x, float *s, float *c)
+    static void sincos(int32_t x, float *s, float *c)
     {
-      gr_uint32 ux = x;
+      uint32_t ux = x;
       int sin_index = ux >> (WORDBITS - NBITS);
       *s = s_sine_table[sin_index][0] * (ux >> 1) + s_sine_table[sin_index][1];
 
diff --git a/gnuradio-runtime/include/gnuradio/fxpt_vco.h 
b/gnuradio-runtime/include/gnuradio/fxpt_vco.h
index 28560db..a6bde65 100644
--- a/gnuradio-runtime/include/gnuradio/fxpt_vco.h
+++ b/gnuradio-runtime/include/gnuradio/fxpt_vco.h
@@ -34,7 +34,7 @@ namespace gr {
    * \ingroup misc
    */
   class /*GR_RUNTIME_API*/ fxpt_vco {
-    gr_int32 d_phase;
+    int32_t d_phase;
 
   public:
     fxpt_vco () : d_phase(0) {}
diff --git a/gnuradio-runtime/lib/math/qa_fxpt.cc 
b/gnuradio-runtime/lib/math/qa_fxpt.cc
index d368e7d..070fb66 100644
--- a/gnuradio-runtime/lib/math/qa_fxpt.cc
+++ b/gnuradio-runtime/lib/math/qa_fxpt.cc
@@ -51,9 +51,9 @@ qa_fxpt::t0()
      * sometimes the answer is off by a few bits at the bottom.
      * Hence, the disabled check.
      */
-    CPPUNIT_ASSERT_EQUAL((gr_int32)0x40000000, 
gr::fxpt::float_to_fixed(M_PI/2));
-    CPPUNIT_ASSERT_EQUAL((gr_int32)0,          gr::fxpt::float_to_fixed(0));
-    CPPUNIT_ASSERT_EQUAL((gr_int32)0x80000000, 
gr::fxpt::float_to_fixed(-M_PI));
+    CPPUNIT_ASSERT_EQUAL((int32_t)0x40000000, 
gr::fxpt::float_to_fixed(M_PI/2));
+    CPPUNIT_ASSERT_EQUAL((int32_t)0,          gr::fxpt::float_to_fixed(0));
+    CPPUNIT_ASSERT_EQUAL((int32_t)0x80000000, gr::fxpt::float_to_fixed(-M_PI));
   }
 }
 
diff --git a/gr-analog/lib/frequency_modulator_fc_impl.cc 
b/gr-analog/lib/frequency_modulator_fc_impl.cc
index 9fb7416..5015ff7 100644
--- a/gr-analog/lib/frequency_modulator_fc_impl.cc
+++ b/gr-analog/lib/frequency_modulator_fc_impl.cc
@@ -70,7 +70,7 @@ namespace gr {
 
        float oi, oq;
 
-       gr_int32 angle = gr::fxpt::float_to_fixed (d_phase);
+       int32_t angle = gr::fxpt::float_to_fixed (d_phase);
        gr::fxpt::sincos(angle, &oq, &oi);
        out[i] = gr_complex(oi, oq);
       }
diff --git a/gr-atsc/include/gnuradio/atsc/field_sync_demux.h 
b/gr-atsc/include/gnuradio/atsc/field_sync_demux.h
index e12a456..1c31a5b 100644
--- a/gr-atsc/include/gnuradio/atsc/field_sync_demux.h
+++ b/gr-atsc/include/gnuradio/atsc/field_sync_demux.h
@@ -63,8 +63,8 @@ protected:
   bool            d_locked;
   bool            d_in_field2;
   int             d_segment_number;
-  gr_uint64       d_next_input;
-  gr_uint64       d_lost_index;         // diagnostic fluff
+  uint64_t        d_next_input;
+  uint64_t        d_lost_index;         // diagnostic fluff
 
   unsigned long long d_inputs0_index;  // for inputs[0].index
   unsigned long          d_inputs0_size;               // for inputs[0].size
diff --git a/gr-pager/lib/flex_parse_impl.cc b/gr-pager/lib/flex_parse_impl.cc
index d0009de..80123da 100644
--- a/gr-pager/lib/flex_parse_impl.cc
+++ b/gr-pager/lib/flex_parse_impl.cc
@@ -43,7 +43,7 @@ namespace gr {
 
     flex_parse_impl::flex_parse_impl(msg_queue::sptr queue, float freq) :
       sync_block("flex_parse",
-                   io_signature::make(1, 1, sizeof(gr_int32)),
+                   io_signature::make(1, 1, sizeof(int32_t)),
                    io_signature::make(0, 0, 0)),
       d_queue(queue),
       d_freq(freq)
@@ -59,7 +59,7 @@ namespace gr {
                              gr_vector_const_void_star &input_items,
                              gr_vector_void_star &output_items)
     {
-      const gr_int32 *in = (const gr_int32 *)input_items[0];
+      const int32_t *in = (const int32_t *)input_items[0];
 
       int i = 0;
       while(i < noutput_items) {



reply via email to

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