summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/bug_work_around_6.cc4
-rw-r--r--gnuradio-core/src/lib/filter/qa_gr_rotator.cc7
-rw-r--r--gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc7
-rw-r--r--gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc5
-rw-r--r--gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h3
-rw-r--r--gnuradio-core/src/lib/io/gr_histo_sink_f.cc5
-rw-r--r--gnuradio-core/src/lib/io/gr_wavfile_sink.cc5
-rw-r--r--gnuradio-core/src/lib/missing/bug_work_around_8.cc3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.h3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_flowgraph.cc3
10 files changed, 31 insertions, 14 deletions
diff --git a/gnuradio-core/src/lib/bug_work_around_6.cc b/gnuradio-core/src/lib/bug_work_around_6.cc
index b829360fc..f8012af0d 100644
--- a/gnuradio-core/src/lib/bug_work_around_6.cc
+++ b/gnuradio-core/src/lib/bug_work_around_6.cc
@@ -1,3 +1,3 @@
// if libgrio has no sources, it doesn't get built correctly
-
-static int gr_bug_work_around_6 __attribute__((unused));
+#include <gruel/attributes.h>
+static int gr_bug_work_around_6 __GR_ATTR_UNUSED;
diff --git a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc
index ce71a3d88..ef41127fd 100644
--- a/gnuradio-core/src/lib/filter/qa_gr_rotator.cc
+++ b/gnuradio-core/src/lib/filter/qa_gr_rotator.cc
@@ -20,6 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gruel/attributes.h>
#include <cppunit/TestAssert.h>
#include <qa_gr_rotator.h>
#include <gr_rotator.h>
@@ -29,7 +34,7 @@
// error vector magnitude
-__attribute__((unused)) static float
+__GR_ATTR_UNUSED static float
error_vector_mag(gr_complex a, gr_complex b)
{
return abs(a-b);
diff --git a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc
index 3c379ea25..2fc97a78a 100644
--- a/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc
+++ b/gnuradio-core/src/lib/filter/qa_gri_mmse_fir_interpolator_cc.cc
@@ -20,6 +20,11 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gruel/attributes.h>
#include <cppunit/TestAssert.h>
#include <qa_gri_mmse_fir_interpolator_cc.h>
#include <gri_mmse_fir_interpolator_cc.h>
@@ -55,7 +60,7 @@ void
qa_gri_mmse_fir_interpolator_cc::t1()
{
static const unsigned N = 100;
- gr_complex input[N + 10] __attribute__ ((aligned (8)));
+ __GR_ATTR_ALIGNED(8) gr_complex input[N + 10];
for (unsigned i = 0; i < NELEM(input); i++)
input[i] = test_fcn ((double) i);
diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
index 0f6f0d719..bff22be25 100644
--- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
+++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,6 +28,7 @@
#include <gr_io_signature.h>
#include <gr_sincos.h>
#include <math.h>
+#include <boost/math/special_functions/trunc.hpp>
gr_frequency_modulator_fc_sptr gr_make_frequency_modulator_fc (double sensitivity)
@@ -62,7 +63,7 @@ gr_frequency_modulator_fc::work (int noutput_items,
// to avoid loss of precision in the addition above.
if (fabs (d_phase) > 16 * M_PI){
- double ii = trunc (d_phase / (2 * M_PI));
+ double ii = boost::math::trunc (d_phase / (2 * M_PI));
d_phase = d_phase - (ii * 2 * M_PI);
}
diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h
index 024d74ada..f17b68aa0 100644
--- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h
+++ b/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h
@@ -23,6 +23,7 @@
#ifndef INCLUDED_GR_MPSK_RECEIVER_CC_H
#define INCLUDED_GR_MPSK_RECEIVER_CC_H
+#include <gruel/attributes.h>
#include <gr_block.h>
#include <gr_complex.h>
#include <fstream>
@@ -299,7 +300,7 @@ protected:
static const unsigned int DLLEN = 8;
//! delay line plus some length for overflow protection
- gr_complex d_dl[2*DLLEN] __attribute__ ((aligned(8)));
+ __GR_ATTR_ALIGNED(8) gr_complex d_dl[2*DLLEN];
//! index to delay line
unsigned int d_dl_idx;
diff --git a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc
index a37189c24..fc0c12ce6 100644
--- a/gnuradio-core/src/lib/io/gr_histo_sink_f.cc
+++ b/gnuradio-core/src/lib/io/gr_histo_sink_f.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009,2010 Free Software Foundation, Inc.
+ * Copyright 2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -26,6 +26,7 @@
#include <gr_histo_sink_f.h>
#include <gr_io_signature.h>
+#include <boost/math/special_functions/round.hpp>
static float get_clean_num(float num){
if (num == 0) return 0;
@@ -101,7 +102,7 @@ gr_histo_sink_f::send_frame(void){
int index;
float bin_width = (maximum - minimum)/(d_num_bins-1);
for (unsigned int i = 0; i < d_sample_count; i++){
- index = round((d_samps[i] - minimum)/bin_width);
+ index = boost::math::iround((d_samps[i] - minimum)/bin_width);
/* ensure the index range in case a small floating point error is involed */
if (index < 0) index = 0;
if (index >= (int)d_num_bins) index = d_num_bins-1;
diff --git a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc
index b60a6e3ab..a96aadc72 100644
--- a/gnuradio-core/src/lib/io/gr_wavfile_sink.cc
+++ b/gnuradio-core/src/lib/io/gr_wavfile_sink.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -33,6 +33,7 @@
#include <cmath>
#include <fcntl.h>
#include <gruel/thread.h>
+#include <boost/math/special_functions/round.hpp>
// win32 (mingw/msvc) specific
#ifdef HAVE_IO_H
@@ -224,7 +225,7 @@ gr_wavfile_sink::convert_to_short(float sample)
sample = d_min_sample_val;
}
- return (short int) roundf(sample);
+ return (short int) boost::math::iround(sample);
}
diff --git a/gnuradio-core/src/lib/missing/bug_work_around_8.cc b/gnuradio-core/src/lib/missing/bug_work_around_8.cc
index b2cbdb3d9..5e431a210 100644
--- a/gnuradio-core/src/lib/missing/bug_work_around_8.cc
+++ b/gnuradio-core/src/lib/missing/bug_work_around_8.cc
@@ -1,2 +1,3 @@
// if libmisc has no sources, it doesn't get built correctly
-static int gr_bug_work_around_8 __attribute__((unused));
+#include <gruel/attributes.h>
+static int gr_bug_work_around_8 __GR_ATTR_UNUSED;
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.h b/gnuradio-core/src/lib/runtime/gr_buffer.h
index aa26f1e09..e5725d386 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.h
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2009,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2009,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -27,6 +27,7 @@
#include <boost/weak_ptr.hpp>
#include <gruel/thread.h>
#include <gruel/pmt.h>
+#include <deque>
class gr_vmcircbuf;
diff --git a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc
index 27f6257cc..0d3bbb011 100644
--- a/gnuradio-core/src/lib/runtime/gr_flowgraph.cc
+++ b/gnuradio-core/src/lib/runtime/gr_flowgraph.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,6 +28,7 @@
#include <gr_io_signature.h>
#include <stdexcept>
#include <sstream>
+#include <iterator>
#define GR_FLOWGRAPH_DEBUG 0