summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/grc_gr_uhd.m43
-rw-r--r--gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc7
-rw-r--r--gnuradio-core/src/lib/io/gr_tagged_file_sink.cc1
-rw-r--r--gnuradio-core/src/lib/io/gr_tagged_file_sink.h1
-rw-r--r--gnuradio-core/src/lib/io/gr_wavfile_source.cc1
-rw-r--r--gnuradio-core/src/lib/io/gr_wavfile_source.h1
-rw-r--r--gnuradio-core/src/lib/runtime/gr_error_handler.cc1
-rw-r--r--gnuradio-core/src/lib/runtime/gr_error_handler.h1
-rw-r--r--gnuradio-core/src/tests/benchmark_dotprod_ccc.cc8
-rw-r--r--gnuradio-core/src/tests/benchmark_dotprod_ccf.cc8
-rw-r--r--gr-usrp/src/Makefile.am1
-rw-r--r--gr-usrp/src/usrp_swig.i1
-rw-r--r--usrp/host/lib/db_flexrf.cc3
-rw-r--r--usrp/host/lib/db_wbxng.cc3
-rw-r--r--usrp/host/lib/fusb_win32.cc1
15 files changed, 28 insertions, 13 deletions
diff --git a/config/grc_gr_uhd.m4 b/config/grc_gr_uhd.m4
index 030b15155..3cc9691e5 100644
--- a/config/grc_gr_uhd.m4
+++ b/config/grc_gr_uhd.m4
@@ -35,9 +35,10 @@ AC_DEFUN([GRC_GR_UHD],[
# Use this to tell the Makefile whether to define
# GR_HAVE_UHD for swig.
- AM_CONDITIONAL([GR_DEFINE_HAVE_UHD],[test $passed = yes])
fi
+ AM_CONDITIONAL([GR_DEFINE_HAVE_UHD],[test $passed = yes])
+
AC_CONFIG_FILES([ \
gr-uhd/Makefile \
gr-uhd/grc/Makefile \
diff --git a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc
index e87d93ebf..ca76c8eb8 100644
--- a/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc
+++ b/gnuradio-core/src/lib/filter/qa_gri_fir_filter_with_buffer_ccc.cc
@@ -42,6 +42,7 @@ typedef gr_complex acc_type;
using std::vector;
+#define MAX_DATA (32767)
#define ERR_DELTA (1e-5)
#define NELEM(x) (sizeof (x) / sizeof (x[0]))
@@ -56,8 +57,8 @@ static void
random_complex (gr_complex *buf, unsigned n)
{
for (unsigned i = 0; i < n; i++){
- float re = rint (uniform () * 32767);
- float im = rint (uniform () * 32767);
+ float re = rint (uniform () * MAX_DATA);
+ float im = rint (uniform () * MAX_DATA);
buf[i] = gr_complex (re, im);
}
}
@@ -151,7 +152,7 @@ qa_gri_fir_filter_with_buffer_ccc::test_decimate(unsigned int decimate)
for (int o = 0; o < (int)(ol/decimate); o++){
CPPUNIT_ASSERT_COMPLEXES_EQUAL(expected_output[o], actual_output[o],
- abs (expected_output[o]) * ERR_DELTA);
+ sqrt((float)n)*0.25*MAX_DATA*MAX_DATA * ERR_DELTA);
}
delete f1;
}
diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc
index c76ede542..154611c32 100644
--- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc
+++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc
@@ -26,7 +26,6 @@
#include <gr_tagged_file_sink.h>
#include <gr_io_signature.h>
-#include <cstdio>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h
index 956340f8d..2e0a5c63a 100644
--- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.h
+++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.h
@@ -24,6 +24,7 @@
#define INCLUDED_GR_TAGGED_FILE_SINK_H
#include <gr_sync_block.h>
+#include <cstdio> // for FILE
class gr_tagged_file_sink;
typedef boost::shared_ptr<gr_tagged_file_sink> gr_tagged_file_sink_sptr;
diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.cc b/gnuradio-core/src/lib/io/gr_wavfile_source.cc
index d00dd3028..136e52611 100644
--- a/gnuradio-core/src/lib/io/gr_wavfile_source.cc
+++ b/gnuradio-core/src/lib/io/gr_wavfile_source.cc
@@ -27,7 +27,6 @@
#include <gr_wavfile_source.h>
#include <gr_io_signature.h>
#include <gri_wavfile.h>
-#include <cstdio>
#include <sys/types.h>
#include <fcntl.h>
#include <stdexcept>
diff --git a/gnuradio-core/src/lib/io/gr_wavfile_source.h b/gnuradio-core/src/lib/io/gr_wavfile_source.h
index 0c663f0a0..e434a6b4c 100644
--- a/gnuradio-core/src/lib/io/gr_wavfile_source.h
+++ b/gnuradio-core/src/lib/io/gr_wavfile_source.h
@@ -24,6 +24,7 @@
#define INCLUDED_GR_WAVFILE_SOURCE_H
#include <gr_sync_block.h>
+#include <cstdio> // for FILE
class gr_wavfile_source;
typedef boost::shared_ptr<gr_wavfile_source> gr_wavfile_source_sptr;
diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.cc b/gnuradio-core/src/lib/runtime/gr_error_handler.cc
index 6dbb0a5d2..4b4cdacef 100644
--- a/gnuradio-core/src/lib/runtime/gr_error_handler.cc
+++ b/gnuradio-core/src/lib/runtime/gr_error_handler.cc
@@ -48,7 +48,6 @@
#include <assert.h>
#include <stdexcept>
#include <unistd.h>
-#include <stdio.h>
#ifdef HAVE_IO_H
#include <io.h>
diff --git a/gnuradio-core/src/lib/runtime/gr_error_handler.h b/gnuradio-core/src/lib/runtime/gr_error_handler.h
index 530a2c23c..aedb6f41f 100644
--- a/gnuradio-core/src/lib/runtime/gr_error_handler.h
+++ b/gnuradio-core/src/lib/runtime/gr_error_handler.h
@@ -45,6 +45,7 @@
#include <stdarg.h>
#include <string>
+#include <cstdio> // for FILE
/*!
* \brief abstract error handler
diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
index 5d53a9f89..8ef26a40d 100644
--- a/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
+++ b/gnuradio-core/src/tests/benchmark_dotprod_ccc.cc
@@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
{
int i;
gr_complex coeffs[NTAPS];
- gr_complex input[BLOCK_SIZE + NTAPS];
+ //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned
+ gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS];
long n;
gr_complex result;
#ifdef HAVE_SYS_RESOURCE_H
@@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
exit (1);
}
#else
- clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_start= (double) clock() / CLOCKS_PER_SEC;
#endif
// do the actual work
@@ -116,7 +117,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
double total = user + sys;
#else
- clock_end = (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_end = (double) clock() / CLOCKS_PER_SEC;
double total = clock_end - clock_start;
#endif
@@ -126,6 +127,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total);
delete f;
+ delete [] input;
}
static void
diff --git a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
index 60855ec94..ed3c49165 100644
--- a/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
+++ b/gnuradio-core/src/tests/benchmark_dotprod_ccf.cc
@@ -56,7 +56,8 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
{
int i;
float coeffs[NTAPS];
- gr_complex input[BLOCK_SIZE + NTAPS];
+ //gr_complex input[BLOCK_SIZE + NTAPS]; // not always 16-bit aligned
+ gr_complex *input = new gr_complex[BLOCK_SIZE + NTAPS];
long n;
gr_complex result;
#ifdef HAVE_SYS_RESOURCE_H
@@ -86,7 +87,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
exit (1);
}
#else
- clock_start= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_start= (double) clock() / CLOCKS_PER_SEC;
#endif
// do the actual work
@@ -118,7 +119,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
double total = user + sys;
#else
- clock_end= (double) clock() * (1000000. / CLOCKS_PER_SEC);
+ clock_end= (double) clock() / CLOCKS_PER_SEC;
double total = clock_end - clock_start;
#endif
@@ -128,6 +129,7 @@ benchmark (fir_maker_t filter_maker, const char *implementation_name)
implementation_name, NTAPS, (double) TOTAL_TEST_SIZE, total, macs / total);
delete f;
+ delete [] input;
}
static void
diff --git a/gr-usrp/src/Makefile.am b/gr-usrp/src/Makefile.am
index a0c6b7a82..29cedc96a 100644
--- a/gr-usrp/src/Makefile.am
+++ b/gr-usrp/src/Makefile.am
@@ -86,6 +86,7 @@ usrp_swig_pythondir_category = \
# additional arguments to the SWIG command
usrp_swig_swig_args = \
+ $(DEFAULT_INCLUDES) \
$(USRP_INCLUDES)
# additional libraries for linking with the SWIG-generated library
diff --git a/gr-usrp/src/usrp_swig.i b/gr-usrp/src/usrp_swig.i
index b1797d758..80d59abc9 100644
--- a/gr-usrp/src/usrp_swig.i
+++ b/gr-usrp/src/usrp_swig.i
@@ -23,6 +23,7 @@
%include "gnuradio.i" // the common stuff
%{
+#include "config.h" // for NOMINMAX
#include <vector>
%}
diff --git a/usrp/host/lib/db_flexrf.cc b/usrp/host/lib/db_flexrf.cc
index 2819c19bd..ddd87012d 100644
--- a/usrp/host/lib/db_flexrf.cc
+++ b/usrp/host/lib/db_flexrf.cc
@@ -24,6 +24,9 @@
#include <usrp/db_flexrf.h>
#include <db_base_impl.h>
+#ifdef HAVE_TIME_H
+#include <ctime>
+#endif
// d'board i/o pin defs
// Tx and Rx have shared defs, but different i/o regs
diff --git a/usrp/host/lib/db_wbxng.cc b/usrp/host/lib/db_wbxng.cc
index 89200653e..4d17c72d1 100644
--- a/usrp/host/lib/db_wbxng.cc
+++ b/usrp/host/lib/db_wbxng.cc
@@ -26,6 +26,9 @@
#include "db_wbxng_adf4350.h"
#include <db_base_impl.h>
#include <stdio.h>
+#ifdef HAVE_TIME_H
+#include <ctime>
+#endif
// d'board i/o pin defs
// Tx and Rx have shared defs, but different i/o regs
diff --git a/usrp/host/lib/fusb_win32.cc b/usrp/host/lib/fusb_win32.cc
index 8900576d9..8c218534b 100644
--- a/usrp/host/lib/fusb_win32.cc
+++ b/usrp/host/lib/fusb_win32.cc
@@ -29,6 +29,7 @@
#include <assert.h>
#include <stdexcept>
#include <string.h>
+#include <cstdio>
static const int MAX_BLOCK_SIZE = fusb_sysconfig::max_block_size();
static const int DEFAULT_BLOCK_SIZE = MAX_BLOCK_SIZE;