summaryrefslogtreecommitdiff
path: root/gnuradio-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r--gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py2
-rw-r--r--gnuradio-runtime/include/gnuradio/block.h46
-rw-r--r--gnuradio-runtime/include/gnuradio/block_gateway.h4
-rw-r--r--gnuradio-runtime/include/gnuradio/fxpt.h5
-rw-r--r--gnuradio-runtime/include/gnuradio/logger.h16
-rw-r--r--gnuradio-runtime/include/gnuradio/math.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/prefs.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/pycallback_object.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/thread/thread.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/thrift_application_base.h2
-rw-r--r--gnuradio-runtime/include/pmt/pmt.h6
-rw-r--r--gnuradio-runtime/lib/block_detail.cc28
-rw-r--r--gnuradio-runtime/lib/block_executor.cc57
-rw-r--r--gnuradio-runtime/lib/controlport/thrift/README2
-rw-r--r--gnuradio-runtime/lib/logger.cc2
-rw-r--r--gnuradio-runtime/lib/math/fast_atan2f.cc2
-rw-r--r--gnuradio-runtime/lib/math/fxpt.cc1
-rw-r--r--gnuradio-runtime/lib/math/qa_fxpt.cc2
-rw-r--r--gnuradio-runtime/lib/math/random.cc12
-rw-r--r--gnuradio-runtime/lib/test.h6
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py2
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/gateway.py4
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py2
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py2
-rw-r--r--gnuradio-runtime/python/gnuradio/gr_unittest.py2
-rw-r--r--gnuradio-runtime/python/gnuradio/gru/freqz.py2
-rw-r--r--gnuradio-runtime/python/pmt/pmt_to_python.py2
-rw-r--r--gnuradio-runtime/swig/gr_intrusive_ptr.i2
-rw-r--r--gnuradio-runtime/swig/hier_block2.i18
-rw-r--r--gnuradio-runtime/swig/top_block.i14
30 files changed, 151 insertions, 100 deletions
diff --git a/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py b/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
index eb39ca7ae1..603c2ae5c3 100644
--- a/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
+++ b/gnuradio-runtime/examples/volk_benchmark/volk_test_funcs.py
@@ -160,7 +160,7 @@ def timeit(tb, iterations):
def format_results(kernel, times):
'''
- Convinience function to convert the results of the timeit function
+ Convenience function to convert the results of the timeit function
into a dictionary.
'''
res = dict()
diff --git a/gnuradio-runtime/include/gnuradio/block.h b/gnuradio-runtime/include/gnuradio/block.h
index d23358cccb..1cb7947179 100644
--- a/gnuradio-runtime/include/gnuradio/block.h
+++ b/gnuradio-runtime/include/gnuradio/block.h
@@ -44,9 +44,14 @@ namespace gr {
* streams and output streams respectively, and the type of the data
* items in each stream.
*
- * Although blocks may consume data on each input stream at a
- * different rate, all outputs streams must produce data at the same
- * rate. That rate may be different from any of the input rates.
+ * Blocks report the number of items consumed on each input in
+ * general_work(), using consume() or consume_each().
+ *
+ * If the same number of items is produced on each output, the block
+ * returns that number from general_work(). Otherwise, the block
+ * calls produce() for each output, then returns
+ * WORK_CALLED_PRODUCE. The input and output rates are not required
+ * to be related.
*
* User derived blocks override two methods, forecast and
* general_work, to implement their signal processing
@@ -160,8 +165,15 @@ namespace gr {
* \param input_items vector of pointers to the input items, one entry per input stream
* \param output_items vector of pointers to the output items, one entry per output stream
*
- * \returns number of items actually written to each output stream, or -1 on EOF.
- * It is OK to return a value less than noutput_items. -1 <= return value <= noutput_items
+ * \returns number of items actually written to each output stream
+ * or WORK_CALLED_PRODUCE or WORK_DONE. It is OK to return a
+ * value less than noutput_items.
+ *
+ * WORK_CALLED_PRODUCE is used where not all outputs produce the
+ * same number of items. general_work must call produce() for each
+ * output to indicate the numer of items actually produced.
+ *
+ * WORK_DONE indicates that no more data will be produced by this block.
*
* general_work must call consume or consume_each to indicate how
* many items were consumed on each input stream.
@@ -228,13 +240,19 @@ namespace gr {
/*!
* \brief Tell the scheduler \p how_many_items of input stream \p
* which_input were consumed.
- * This function should be called at the end of work() or general_work(), after all processing is finished.
+ *
+ * This function should be used in general_work() to tell the scheduler the
+ * number of input items processed. Calling consume() multiple times in the
+ * same general_work() call is safe. Every invocation of consume() updates
+ * the values returned by nitems_read().
*/
void consume(int which_input, int how_many_items);
/*!
* \brief Tell the scheduler \p how_many_items were consumed on
* each input stream.
+ *
+ * Also see notes on consume().
*/
void consume_each(int how_many_items);
@@ -242,8 +260,12 @@ namespace gr {
* \brief Tell the scheduler \p how_many_items were produced on
* output stream \p which_output.
*
- * If the block's general_work method calls produce, \p
- * general_work must return WORK_CALLED_PRODUCE.
+ * This function should be used in general_work() to tell the scheduler the
+ * number of output items produced. If produce() is called in
+ * general_work(), general_work() must return \p WORK_CALLED_PRODUCE.
+ * Calling produce() multiple times in the same general_work() call is safe.
+ * Every invocation of produce() updates the values returned by
+ * nitems_written().
*/
void produce(int which_output, int how_many_items);
@@ -515,17 +537,17 @@ namespace gr {
std::vector<float> pc_input_buffers_full_var();
/*!
- * \brief Gets instantaneous fullness of \p which input buffer.
+ * \brief Gets instantaneous fullness of \p which output buffer.
*/
float pc_output_buffers_full(int which);
/*!
- * \brief Gets average fullness of \p which input buffer.
+ * \brief Gets average fullness of \p which output buffer.
*/
float pc_output_buffers_full_avg(int which);
/*!
- * \brief Gets variance of fullness of \p which input buffer.
+ * \brief Gets variance of fullness of \p which output buffer.
*/
float pc_output_buffers_full_var(int which);
@@ -871,7 +893,7 @@ namespace gr {
*/
void notify_msg_neighbors();
- /*! \brief Make sure we dont think we are finished
+ /*! \brief Make sure we don't think we are finished
*/
void clear_finished(){ d_finished = false; }
diff --git a/gnuradio-runtime/include/gnuradio/block_gateway.h b/gnuradio-runtime/include/gnuradio/block_gateway.h
index bb0c26f8f2..ef218ea662 100644
--- a/gnuradio-runtime/include/gnuradio/block_gateway.h
+++ b/gnuradio-runtime/include/gnuradio/block_gateway.h
@@ -70,13 +70,13 @@ namespace gr {
int general_work_args_noutput_items;
std::vector<int> general_work_args_ninput_items;
- std::vector<void *> general_work_args_input_items; //TODO this should be const void*, but swig cant int cast it right
+ std::vector<void *> general_work_args_input_items; //TODO this should be const void*, but swig can't int cast it right
std::vector<void *> general_work_args_output_items;
int general_work_args_return_value;
int work_args_ninput_items;
int work_args_noutput_items;
- std::vector<void *> work_args_input_items; //TODO this should be const void*, but swig cant int cast it right
+ std::vector<void *> work_args_input_items; //TODO this should be const void*, but swig can't int cast it right
std::vector<void *> work_args_output_items;
int work_args_return_value;
diff --git a/gnuradio-runtime/include/gnuradio/fxpt.h b/gnuradio-runtime/include/gnuradio/fxpt.h
index ded32ed36e..61c7400d01 100644
--- a/gnuradio-runtime/include/gnuradio/fxpt.h
+++ b/gnuradio-runtime/include/gnuradio/fxpt.h
@@ -45,6 +45,7 @@ namespace gr {
static const int NBITS = 10;
static const float s_sine_table[1 << NBITS][2];
static const float PI;
+ static const float TAU;
static const float TWO_TO_THE_31;
public:
@@ -52,8 +53,8 @@ namespace gr {
float_to_fixed(float x)
{
// Fold x into -PI to PI.
- int d = (int)floor(x/2/PI+0.5);
- x -= d*2*PI;
+ int d = (int)std::floor(x/TAU+0.5);
+ x -= d*TAU;
// And convert to an integer.
return (int32_t) ((float) x * TWO_TO_THE_31 / PI);
}
diff --git a/gnuradio-runtime/include/gnuradio/logger.h b/gnuradio-runtime/include/gnuradio/logger.h
index 305461de8a..3cfa471a00 100644
--- a/gnuradio-runtime/include/gnuradio/logger.h
+++ b/gnuradio-runtime/include/gnuradio/logger.h
@@ -236,7 +236,7 @@ namespace gr {
/*!
* \brief Class to control configuration of logger.
- * This is a singleton that cna launch a thread to wathc a config file for changes
+ * This is a singleton that can launch a thread to watch a config file for changes
* \ingroup logging
*/
class GR_RUNTIME_API logger_config
@@ -328,7 +328,7 @@ namespace gr {
/*!
* \brief Retrieve a pointer to a logger by name
*
- * Retrives a logger pointer
+ * Retrieves a logger pointer
* \p name.
*
* \param name Name of the logger for which a pointer is requested
@@ -473,7 +473,7 @@ namespace gr {
*
* \param logger Logger to which appender will be added
* \param target Std target to write 'cout' or 'cerr' (default is cout)
- * \param pattern Formating pattern for log messages
+ * \param pattern Formatting pattern for log messages
*/
GR_RUNTIME_API void logger_add_console_appender(logger_ptr logger,
std::string target,
@@ -486,7 +486,7 @@ namespace gr {
*
* \param logger Logger to which appender will be added
* \param target Std target to write 'cout' or 'cerr' (default is cout)
- * \param pattern Formating pattern for log messages
+ * \param pattern Formatting pattern for log messages
*/
GR_RUNTIME_API void logger_set_console_appender(logger_ptr logger,
std::string target,
@@ -500,7 +500,7 @@ namespace gr {
* \param logger Logger to which appender will be added
* \param filename File to which log will be written
* \param append Overwrite or append to log file
- * \param pattern Formating pattern for log messages
+ * \param pattern Formatting pattern for log messages
*/
GR_RUNTIME_API void logger_add_file_appender(logger_ptr logger,
std::string filename,
@@ -513,7 +513,7 @@ namespace gr {
* \param logger Logger to which appender will be added
* \param filename File to which log will be written
* \param append Overwrite or append to log file
- * \param pattern Formating pattern for log messages
+ * \param pattern Formatting pattern for log messages
*/
GR_RUNTIME_API void logger_set_file_appender(logger_ptr logger,
std::string filename,
@@ -530,7 +530,7 @@ namespace gr {
* \param bkup_index Number of files to write
* \param append Overwrite or append to log file
* \param mode Permissions to set on log file
- * \param pattern Formating pattern for log messages
+ * \param pattern Formatting pattern for log messages
*/
GR_RUNTIME_API void logger_add_rollingfile_appender(logger_ptr logger, std::string filename,
size_t filesize, int bkup_index, bool append,
@@ -565,7 +565,7 @@ namespace gr {
logger_ptr d_logger;
public:
/*!
- * \brief contructor Provide name of logger to associate with this class
+ * \brief constructor Provide name of logger to associate with this class
* \param logger_name Name of logger associated with class
*/
logger(std::string logger_name) {
diff --git a/gnuradio-runtime/include/gnuradio/math.h b/gnuradio-runtime/include/gnuradio/math.h
index d611c98c95..e60f56b594 100644
--- a/gnuradio-runtime/include/gnuradio/math.h
+++ b/gnuradio-runtime/include/gnuradio/math.h
@@ -49,7 +49,7 @@ namespace gr {
*
* This function calculates the angle of the vector (x,y) based on a
* table lookup and linear interpolation. The table uses a 256 point
- * table covering -45 to +45 degrees and uses symetry to determine
+ * table covering -45 to +45 degrees and uses symmetry to determine
* the final angle value in the range of -180 to 180 degrees. Note
* that this function uses the small angle approximation for values
* close to zero. This routine calculates the arc tangent with an
diff --git a/gnuradio-runtime/include/gnuradio/prefs.h b/gnuradio-runtime/include/gnuradio/prefs.h
index 287f86cc7c..ccb4db1e20 100644
--- a/gnuradio-runtime/include/gnuradio/prefs.h
+++ b/gnuradio-runtime/include/gnuradio/prefs.h
@@ -39,7 +39,7 @@ namespace gr {
* \brief Base class for representing user preferences a la windows INI files.
* \ingroup misc
*
- * The real implementation is in Python, and is accessable from C++
+ * The real implementation is in Python, and is accessible from C++
* via the magic of SWIG directors.
*/
class GR_RUNTIME_API prefs
diff --git a/gnuradio-runtime/include/gnuradio/pycallback_object.h b/gnuradio-runtime/include/gnuradio/pycallback_object.h
index 85a883c3d3..f0857b6c8e 100644
--- a/gnuradio-runtime/include/gnuradio/pycallback_object.h
+++ b/gnuradio-runtime/include/gnuradio/pycallback_object.h
@@ -42,7 +42,7 @@ public:
}
};
-/* template specializations for vectors that cant use pmt::mp() */
+/* template specializations for vectors that can't use pmt::mp() */
template<>
pmt::pmt_t pmt_assist<std::vector<float> >::make(std::vector<float> _val)
{
diff --git a/gnuradio-runtime/include/gnuradio/thread/thread.h b/gnuradio-runtime/include/gnuradio/thread/thread.h
index 20a94cba52..3fda5d86ce 100644
--- a/gnuradio-runtime/include/gnuradio/thread/thread.h
+++ b/gnuradio-runtime/include/gnuradio/thread/thread.h
@@ -64,7 +64,7 @@ namespace gr {
/*! \brief Get the current thread's ID as a gr_thread_t
*
* We use this when setting the thread affinity or any other
- * low-level thread settings. Can be called withing a GNU Radio
+ * low-level thread settings. Can be called within a GNU Radio
* block to get a reference to its current thread ID.
*/
GR_RUNTIME_API gr_thread_t get_current_thread_id();
diff --git a/gnuradio-runtime/include/gnuradio/thrift_application_base.h b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
index d3721939a3..34622cacfe 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_application_base.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_application_base.h
@@ -174,7 +174,7 @@ private:
// and since ::i() is static, this function must be static as well.
static void start_application();
- // Pointer to the structure containing staticly allocated
+ // Pointer to the structure containing statically allocated
// state information for the applicaiton_base singleton.
static boost::scoped_ptr<thrift_application_base_impl > p_impl;
diff --git a/gnuradio-runtime/include/pmt/pmt.h b/gnuradio-runtime/include/pmt/pmt.h
index 00564cc8d3..cb2191dd87 100644
--- a/gnuradio-runtime/include/pmt/pmt.h
+++ b/gnuradio-runtime/include/pmt/pmt.h
@@ -314,7 +314,7 @@ PMT_API pmt_t cadddr(pmt_t pair);
* ------------------------------------------------------------------------
*/
-//! Return true if \p x is a tuple, othewise false.
+//! Return true if \p x is a tuple, otherwise false.
PMT_API bool is_tuple(pmt_t x);
PMT_API pmt_t make_tuple();
@@ -348,7 +348,7 @@ PMT_API pmt_t tuple_ref(const pmt_t &tuple, size_t k);
* ------------------------------------------------------------------------
*/
-//! Return true if \p x is a vector, othewise false.
+//! Return true if \p x is a vector, otherwise false.
PMT_API bool is_vector(pmt_t x);
//! Make a vector of length \p k, with initial values set to \p fill
@@ -374,7 +374,7 @@ PMT_API void vector_fill(pmt_t vector, pmt_t fill);
* ------------------------------------------------------------------------
*/
-//! Return true if \p x is a blob, othewise false.
+//! Return true if \p x is a blob, otherwise false.
PMT_API bool is_blob(pmt_t x);
/*!
diff --git a/gnuradio-runtime/lib/block_detail.cc b/gnuradio-runtime/lib/block_detail.cc
index 9e2e29fcd9..3da150ed8f 100644
--- a/gnuradio-runtime/lib/block_detail.cc
+++ b/gnuradio-runtime/lib/block_detail.cc
@@ -313,17 +313,19 @@ namespace gr {
d_total_noutput_items = noutput_items;
d_pc_start_time = (float)gr::high_res_timer_now();
for(size_t i=0; i < d_input.size(); i++) {
- gr::thread::scoped_lock guard(*d_input[i]->mutex());
- float pfull = static_cast<float>(d_input[i]->items_available()) /
- static_cast<float>(d_input[i]->max_possible_items_available());
+ buffer_reader_sptr in_buf = d_input[i];
+ gr::thread::scoped_lock guard(*in_buf->mutex());
+ float pfull = static_cast<float>(in_buf->items_available()) /
+ static_cast<float>(in_buf->max_possible_items_available());
d_ins_input_buffers_full[i] = pfull;
d_avg_input_buffers_full[i] = pfull;
d_var_input_buffers_full[i] = 0;
}
for(size_t i=0; i < d_output.size(); i++) {
- gr::thread::scoped_lock guard(*d_output[i]->mutex());
- float pfull = 1.0f - static_cast<float>(d_output[i]->space_available()) /
- static_cast<float>(d_output[i]->bufsize());
+ buffer_sptr out_buf = d_output[i];
+ gr::thread::scoped_lock guard(*out_buf->mutex());
+ float pfull = 1.0f - static_cast<float>(out_buf->space_available()) /
+ static_cast<float>(out_buf->bufsize());
d_ins_output_buffers_full[i] = pfull;
d_avg_output_buffers_full[i] = pfull;
d_var_output_buffers_full[i] = 0;
@@ -351,9 +353,10 @@ namespace gr {
d_avg_throughput = d_total_noutput_items / monitor_time;
for(size_t i=0; i < d_input.size(); i++) {
- gr::thread::scoped_lock guard(*d_input[i]->mutex());
- float pfull = static_cast<float>(d_input[i]->items_available()) /
- static_cast<float>(d_input[i]->max_possible_items_available());
+ buffer_reader_sptr in_buf = d_input[i];
+ gr::thread::scoped_lock guard(*in_buf->mutex());
+ float pfull = static_cast<float>(in_buf->items_available()) /
+ static_cast<float>(in_buf->max_possible_items_available());
d = pfull - d_avg_input_buffers_full[i];
d_ins_input_buffers_full[i] = pfull;
@@ -362,9 +365,10 @@ namespace gr {
}
for(size_t i=0; i < d_output.size(); i++) {
- gr::thread::scoped_lock guard(*d_output[i]->mutex());
- float pfull = 1.0f - static_cast<float>(d_output[i]->space_available()) /
- static_cast<float>(d_output[i]->bufsize());
+ buffer_sptr out_buf = d_output[i];
+ gr::thread::scoped_lock guard(*out_buf->mutex());
+ float pfull = 1.0f - static_cast<float>(out_buf->space_available()) /
+ static_cast<float>(out_buf->bufsize());
d = pfull - d_avg_output_buffers_full[i];
d_ins_output_buffers_full[i] = pfull;
diff --git a/gnuradio-runtime/lib/block_executor.cc b/gnuradio-runtime/lib/block_executor.cc
index 5c23df39a5..754744449a 100644
--- a/gnuradio-runtime/lib/block_executor.cc
+++ b/gnuradio-runtime/lib/block_executor.cc
@@ -73,14 +73,15 @@ namespace gr {
if(min_noutput_items == 0)
min_noutput_items = 1;
for(int i = 0; i < d->noutputs (); i++) {
- gr::thread::scoped_lock guard(*d->output(i)->mutex());
- int avail_n = round_down(d->output(i)->space_available(), output_multiple);
- int best_n = round_down(d->output(i)->bufsize()/2, output_multiple);
+ buffer_sptr out_buf = d->output(i);
+ gr::thread::scoped_lock guard(*out_buf->mutex());
+ int avail_n = round_down(out_buf->space_available(), output_multiple);
+ int best_n = round_down(out_buf->bufsize()/2, output_multiple);
if(best_n < min_noutput_items)
throw std::runtime_error("Buffer too small for min_noutput_items");
int n = std::min(avail_n, best_n);
if(n < min_noutput_items){ // We're blocked on output.
- if(d->output(i)->done()){ // Downstream is done, therefore we're done.
+ if(out_buf->done()){ // Downstream is done, therefore we're done.
return -1;
}
return 0;
@@ -106,16 +107,28 @@ namespace gr {
case block::TPP_CUSTOM:
return true;
case block::TPP_ALL_TO_ALL:
- // every tag on every input propogates to everyone downstream
+ {
+ // every tag on every input propagates to everyone downstream
+ std::vector<buffer_sptr> out_buf;
+
for(int i = 0; i < d->ninputs(); i++) {
d->get_tags_in_range(rtags, i, start_nitems_read[i],
d->nitems_read(i), block_id);
+ if (rtags.size() == 0)
+ continue;
+
+ if (out_buf.size() == 0) {
+ out_buf.reserve(d->noutputs());
+ for(int o = 0; o < d->noutputs(); o++)
+ out_buf.push_back(d->output(o));
+ }
+
std::vector<tag_t>::iterator t;
if(rrate == 1.0) {
for(t = rtags.begin(); t != rtags.end(); t++) {
for(int o = 0; o < d->noutputs(); o++)
- d->output(o)->add_item_tag(*t);
+ out_buf[o]->add_item_tag(*t);
}
}
else {
@@ -123,25 +136,33 @@ namespace gr {
tag_t new_tag = *t;
new_tag.offset = ((double)new_tag.offset * rrate) + 0.5;
for(int o = 0; o < d->noutputs(); o++)
- d->output(o)->add_item_tag(new_tag);
+ out_buf[o]->add_item_tag(new_tag);
}
}
}
+ }
break;
case block::TPP_ONE_TO_ONE:
// tags from input i only go to output i
// this requires d->ninputs() == d->noutputs; this is checked when this
// type of tag-propagation system is selected in block_detail
if(d->ninputs() == d->noutputs()) {
+ buffer_sptr out_buf;
+
for(int i = 0; i < d->ninputs(); i++) {
d->get_tags_in_range(rtags, i, start_nitems_read[i],
d->nitems_read(i), block_id);
+ if (rtags.size() == 0)
+ continue;
+
+ out_buf = d->output(i);
+
std::vector<tag_t>::iterator t;
for(t = rtags.begin(); t != rtags.end(); t++) {
tag_t new_tag = *t;
new_tag.offset = ((double)new_tag.offset * rrate) + 0.5;
- d->output(i)->add_item_tag(new_tag);
+ out_buf->add_item_tag(new_tag);
}
}
}
@@ -149,7 +170,6 @@ namespace gr {
std::cerr << "Error: block_executor: propagation_policy 'ONE-TO-ONE' requires ninputs == noutputs" << std::endl;
return false;
}
-
break;
default:
return true;
@@ -244,9 +264,10 @@ namespace gr {
/*
* Acquire the mutex and grab local copies of items_available and done.
*/
- gr::thread::scoped_lock guard(*d->input(i)->mutex());
- d_ninput_items[i] = d->input(i)->items_available();
- d_input_done[i] = d->input(i)->done();
+ buffer_reader_sptr in_buf = d->input(i);
+ gr::thread::scoped_lock guard(*in_buf->mutex());
+ d_ninput_items[i] = in_buf->items_available();
+ d_input_done[i] = in_buf->done();
}
LOG(*d_log << " d_ninput_items[" << i << "] = " << d_ninput_items[i] << std::endl);
@@ -288,9 +309,10 @@ namespace gr {
/*
* Acquire the mutex and grab local copies of items_available and done.
*/
- gr::thread::scoped_lock guard(*d->input(i)->mutex());
- d_ninput_items[i] = d->input(i)->items_available ();
- d_input_done[i] = d->input(i)->done();
+ buffer_reader_sptr in_buf = d->input(i);
+ gr::thread::scoped_lock guard(*in_buf->mutex());
+ d_ninput_items[i] = in_buf->items_available ();
+ d_input_done[i] = in_buf->done();
}
max_items_avail = std::max(max_items_avail, d_ninput_items[i]);
}
@@ -403,7 +425,8 @@ namespace gr {
goto were_done;
// Is it possible to ever fulfill this request?
- if(d_ninput_items_required[i] > d->input(i)->max_possible_items_available()) {
+ buffer_reader_sptr in_buf = d->input(i);
+ if(d_ninput_items_required[i] > in_buf->max_possible_items_available()) {
// Nope, never going to happen...
std::cerr << "\nsched: <block " << m->name()
<< " (" << m->unique_id() << ")>"
@@ -412,7 +435,7 @@ namespace gr {
<< " ninput_items_required = "
<< d_ninput_items_required[i] << "\n"
<< " max_possible_items_available = "
- << d->input(i)->max_possible_items_available() << "\n"
+ << in_buf->max_possible_items_available() << "\n"
<< " If this is a filter, consider reducing the number of taps.\n";
goto were_done;
}
diff --git a/gnuradio-runtime/lib/controlport/thrift/README b/gnuradio-runtime/lib/controlport/thrift/README
index 5448e512f7..233dda9362 100644
--- a/gnuradio-runtime/lib/controlport/thrift/README
+++ b/gnuradio-runtime/lib/controlport/thrift/README
@@ -1,6 +1,6 @@
For info on ControlPort and Thrift, see the wiki page:
-http://gnuradio.org/redmine/projects/gnuradio/wiki/ControlPort
+https://wiki.gnuradio.org/index.php/ControlPort
This readme is to address the patch file in the repo for Thrift. We
believe that there is a bug in Thrift itself that occasionally causes
diff --git a/gnuradio-runtime/lib/logger.cc b/gnuradio-runtime/lib/logger.cc
index 0bb898833b..12b63354b1 100644
--- a/gnuradio-runtime/lib/logger.cc
+++ b/gnuradio-runtime/lib/logger.cc
@@ -42,7 +42,7 @@ namespace gr {
/************************ BEGIN LOG4CPP HELPERS ***********************/
/* Logger config class. This is a singleton that controls how
* log4cpp is configured If watch_period>0 a thread is started to
- * watch teh config file for changes.
+ * watch the config file for changes.
*/
// Getters of logger_config
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc b/gnuradio-runtime/lib/math/fast_atan2f.cc
index f968310ff8..72e7291913 100644
--- a/gnuradio-runtime/lib/math/fast_atan2f.cc
+++ b/gnuradio-runtime/lib/math/fast_atan2f.cc
@@ -114,7 +114,7 @@ namespace gr {
Description: This function calculates the angle of the vector (x,y)
based on a table lookup and linear interpolation. The table uses a
- 256 point table covering -45 to +45 degrees and uses symetry to
+ 256 point table covering -45 to +45 degrees and uses symmetry to
determine the final angle value in the range of -180 to 180
degrees. Note that this function uses the small angle approximation
for values close to zero. This routine calculates the arc tangent
diff --git a/gnuradio-runtime/lib/math/fxpt.cc b/gnuradio-runtime/lib/math/fxpt.cc
index 23fdda1241..b40b082194 100644
--- a/gnuradio-runtime/lib/math/fxpt.cc
+++ b/gnuradio-runtime/lib/math/fxpt.cc
@@ -33,6 +33,7 @@ namespace gr {
};
const float fxpt::PI = 3.14159265358979323846;
+ const float fxpt::TAU = 2.0 * 3.14159265358979323846;
const float fxpt::TWO_TO_THE_31 = 2147483648.0;
} /* namespace gr */
diff --git a/gnuradio-runtime/lib/math/qa_fxpt.cc b/gnuradio-runtime/lib/math/qa_fxpt.cc
index 070fb66ccf..d3aadf85b1 100644
--- a/gnuradio-runtime/lib/math/qa_fxpt.cc
+++ b/gnuradio-runtime/lib/math/qa_fxpt.cc
@@ -46,7 +46,7 @@ qa_fxpt::t0()
* These are disabled because of some precision issues.
*
* Different compilers seem to have different opinions on whether
- * the calulations are done single or double (or extended)
+ * the calculations are done single or double (or extended)
* precision. Any of the answers are fine for our real purpose, but
* sometimes the answer is off by a few bits at the bottom.
* Hence, the disabled check.
diff --git a/gnuradio-runtime/lib/math/random.cc b/gnuradio-runtime/lib/math/random.cc
index 59f2f22bd0..401ba89735 100644
--- a/gnuradio-runtime/lib/math/random.cc
+++ b/gnuradio-runtime/lib/math/random.cc
@@ -130,8 +130,8 @@ namespace gr {
s = x*x+y*y;
}while(s >= 1.0f || s == 0.0f);
d_gauss_stored = true;
- d_gauss_value = x*sqrt(-2.0*log(s)/s);
- return y*sqrt(-2.0*log(s)/s);
+ d_gauss_value = x*sqrtf(-2.0*logf(s)/s);
+ return y*sqrtf(-2.0*logf(s)/s);
}
}
@@ -139,8 +139,8 @@ namespace gr {
random::laplacian()
{
float z = ran1()-0.5;
- if(z>0) return -log(1-2*z);
- else return log(1+2*z);
+ if(z>0) return -logf(1-2*z);
+ else return logf(1+2*z);
}
/*
@@ -151,7 +151,7 @@ namespace gr {
float
random::impulse(float factor = 5)
{
- float z = -M_SQRT2 * log(ran1());
+ float z = -M_SQRT2 * logf(ran1());
if(fabsf(z) <= factor)
return 0.0;
else
@@ -167,7 +167,7 @@ namespace gr {
float
random::rayleigh()
{
- return sqrt(-2.0 * log(ran1()));
+ return sqrtf(-2.0 * logf(ran1()));
}
} /* namespace gr */
diff --git a/gnuradio-runtime/lib/test.h b/gnuradio-runtime/lib/test.h
index 24266ab977..a8019bc3b7 100644
--- a/gnuradio-runtime/lib/test.h
+++ b/gnuradio-runtime/lib/test.h
@@ -46,11 +46,11 @@ namespace gr {
* \brief Test class for testing runtime system (setting up buffers and such.)
* \ingroup misc
*
- * This block does not do any usefull actual data processing. It
+ * This block does not do any useful actual data processing. It
* just exposes setting all standard block parameters using the
- * contructor or public methods.
+ * constructor or public methods.
*
- * This block can be usefull when testing the runtime system.
+ * This block can be useful when testing the runtime system.
* You can force this block to have a large history, decimation
* factor and/or large output_multiple.
* The runtime system should detect this and create large enough buffers
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py b/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
index 56604d4fac..cb66baebb9 100644
--- a/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
+++ b/gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py
@@ -144,7 +144,7 @@ class GrDataPlotParent(gr.top_block, QtGui.QWidget):
npts = self.get_npts()
if(self._npts != npts):
- # Adjust buffers to accomodate new settings
+ # Adjust buffers to accommodate new settings
for n in range(self._ncons):
if(npts < self._npts):
if(self._data_len[n] < npts):
diff --git a/gnuradio-runtime/python/gnuradio/gr/gateway.py b/gnuradio-runtime/python/gnuradio/gr/gateway.py
index 2bc1b21591..1acf900f84 100644
--- a/gnuradio-runtime/python/gnuradio/gr/gateway.py
+++ b/gnuradio-runtime/python/gnuradio/gr/gateway.py
@@ -51,7 +51,7 @@ def pointer_to_ndarray(addr, dtype, nitems):
########################################################################
class gateway_handler(gr.feval_ll):
- #dont put a constructor, it wont work
+ #don't put a constructor, it won't work
def init(self, callback):
self._callback = callback
@@ -69,7 +69,7 @@ class gateway_handler(gr.feval_ll):
########################################################################
class msg_handler(gr.feval_p):
- #dont put a constructor, it wont work
+ #don't put a constructor, it won't work
def init(self, callback):
self._callback = callback
diff --git a/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py b/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py
index ff33224d58..f4f062f715 100644
--- a/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py
+++ b/gnuradio-runtime/python/gnuradio/gr/gr_threading_23.py
@@ -109,7 +109,7 @@ class _RLock(_Verbose):
self.__owner = me
self.__count = 1
if __debug__:
- self._note("%s.acquire(%s): initial succes", self, blocking)
+ self._note("%s.acquire(%s): initial success", self, blocking)
else:
if __debug__:
self._note("%s.acquire(%s): failure", self, blocking)
diff --git a/gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py b/gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py
index efb20dca59..6dddce7e22 100644
--- a/gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py
+++ b/gnuradio-runtime/python/gnuradio/gr/gr_threading_24.py
@@ -109,7 +109,7 @@ class _RLock(_Verbose):
self.__owner = me
self.__count = 1
if __debug__:
- self._note("%s.acquire(%s): initial succes", self, blocking)
+ self._note("%s.acquire(%s): initial success", self, blocking)
else:
if __debug__:
self._note("%s.acquire(%s): failure", self, blocking)
diff --git a/gnuradio-runtime/python/gnuradio/gr_unittest.py b/gnuradio-runtime/python/gnuradio/gr_unittest.py
index e9d35d6869..1b8323ad7a 100644
--- a/gnuradio-runtime/python/gnuradio/gr_unittest.py
+++ b/gnuradio-runtime/python/gnuradio/gr_unittest.py
@@ -46,7 +46,7 @@ class TestCase(unittest.TestCase):
(default 7) and comparing to zero.
Note that decimal places (from zero) is usually not the same
- as significant digits (measured from the most signficant digit).
+ as significant digits (measured from the most significant digit).
"""
if round(second.real-first.real, places) != 0:
raise self.failureException(
diff --git a/gnuradio-runtime/python/gnuradio/gru/freqz.py b/gnuradio-runtime/python/gnuradio/gru/freqz.py
index 7ce25e2de1..edea6113b6 100644
--- a/gnuradio-runtime/python/gnuradio/gru/freqz.py
+++ b/gnuradio-runtime/python/gnuradio/gru/freqz.py
@@ -120,7 +120,7 @@ class poly1d(object):
p[k] is the coefficient on the kth power of x (backwards from
sequencing the coefficient array.
- polynomials can be added, substracted, multplied and divided (returns
+ polynomials can be added, substracted, multiplied and divided (returns
quotient and remainder).
asarray(p) will also give the coefficient array, so polynomials can
be used in all functions that accept arrays.
diff --git a/gnuradio-runtime/python/pmt/pmt_to_python.py b/gnuradio-runtime/python/pmt/pmt_to_python.py
index 918e2f9872..270a1dd9e9 100644
--- a/gnuradio-runtime/python/pmt/pmt_to_python.py
+++ b/gnuradio-runtime/python/pmt/pmt_to_python.py
@@ -92,7 +92,7 @@ def numpy_to_uvector(numpy_array):
pc = list(map(mapping[1], numpy.ravel(numpy_array)))
return mapping[0](numpy_array.size, pc)
except KeyError:
- raise ValueError("unsupported numpy array dtype for converstion to pmt %s"%(numpy_array.dtype))
+ raise ValueError("unsupported numpy array dtype for conversion to pmt %s"%(numpy_array.dtype))
def uvector_to_numpy(uvector):
match = None
diff --git a/gnuradio-runtime/swig/gr_intrusive_ptr.i b/gnuradio-runtime/swig/gr_intrusive_ptr.i
index 40c438d004..3b3c9242ab 100644
--- a/gnuradio-runtime/swig/gr_intrusive_ptr.i
+++ b/gnuradio-runtime/swig/gr_intrusive_ptr.i
@@ -1,6 +1,6 @@
// This file was borrowed from the SWIG project to allow use to
// wrap PMTs that use intrusive pointers. This is only necessary
-// to support backwards compatability with older distributions of
+// to support backwards compatibility with older distributions of
// Linux that do not natively support a new enough version of SWIG.
// We do this to prevent having to update our dependency on a new
// SWIG. Eventually, the need for this should go away.
diff --git a/gnuradio-runtime/swig/hier_block2.i b/gnuradio-runtime/swig/hier_block2.i
index 6e964db8a1..9511471ebc 100644
--- a/gnuradio-runtime/swig/hier_block2.i
+++ b/gnuradio-runtime/swig/hier_block2.i
@@ -34,7 +34,7 @@ namespace gr {
make_hier_block2(const std::string name,
gr::io_signature::sptr input_signature,
gr::io_signature::sptr output_signature)
- throw (std::runtime_error);
+ noexcept(false);
}
// Rename connect and disconnect so that we can more easily build a
@@ -58,28 +58,28 @@ namespace gr {
~hier_block2 ();
void connect(gr::basic_block_sptr block)
- throw (std::invalid_argument);
+ noexcept(false);
void connect(gr::basic_block_sptr src, int src_port,
gr::basic_block_sptr dst, int dst_port)
- throw (std::invalid_argument);
+ noexcept(false);
void msg_connect(gr::basic_block_sptr src, pmt::pmt_t srcport,
gr::basic_block_sptr dst, pmt::pmt_t dstport)
- throw (std::runtime_error);
+ noexcept(false);
void msg_connect(gr::basic_block_sptr src, std::string srcport,
gr::basic_block_sptr dst, std::string dstport)
- throw (std::runtime_error);
+ noexcept(false);
void msg_disconnect(gr::basic_block_sptr src, pmt::pmt_t srcport,
gr::basic_block_sptr dst, pmt::pmt_t dstport)
- throw (std::runtime_error);
+ noexcept(false);
void msg_disconnect(gr::basic_block_sptr src, std::string srcport,
gr::basic_block_sptr dst, std::string dstport)
- throw (std::runtime_error);
+ noexcept(false);
void disconnect(gr::basic_block_sptr block)
- throw (std::invalid_argument);
+ noexcept(false);
void disconnect(gr::basic_block_sptr src, int src_port,
gr::basic_block_sptr dst, int dst_port)
- throw (std::invalid_argument);
+ noexcept(false);
void disconnect_all();
void lock();
void unlock();
diff --git a/gnuradio-runtime/swig/top_block.i b/gnuradio-runtime/swig/top_block.i
index c7ee0af941..6d0632a9a7 100644
--- a/gnuradio-runtime/swig/top_block.i
+++ b/gnuradio-runtime/swig/top_block.i
@@ -37,12 +37,12 @@ namespace gr {
public:
~top_block();
- void start(int max_noutput_items=100000000) throw (std::runtime_error);
+ void start(int max_noutput_items=100000000) noexcept(false);
void stop();
//void wait();
//void run() throw (std::runtime_error);
void lock();
- void unlock() throw (std::runtime_error);
+ void unlock() noexcept(false);
std::string edge_list();
std::string msg_edge_list();
void dump();
@@ -57,7 +57,7 @@ namespace gr {
#ifdef SWIGPYTHON
%inline %{
-void top_block_run_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
+void top_block_run_unlocked(gr::top_block_sptr r) noexcept(false)
{
GR_PYTHON_BLOCKING_CODE
(
@@ -65,7 +65,7 @@ void top_block_run_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
)
}
-void top_block_start_unlocked(gr::top_block_sptr r, int max_noutput_items) throw (std::runtime_error)
+void top_block_start_unlocked(gr::top_block_sptr r, int max_noutput_items) noexcept(false)
{
GR_PYTHON_BLOCKING_CODE
(
@@ -73,7 +73,7 @@ void top_block_start_unlocked(gr::top_block_sptr r, int max_noutput_items) throw
)
}
-void top_block_wait_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
+void top_block_wait_unlocked(gr::top_block_sptr r) noexcept(false)
{
GR_PYTHON_BLOCKING_CODE
(
@@ -81,7 +81,7 @@ void top_block_wait_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
)
}
-void top_block_stop_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
+void top_block_stop_unlocked(gr::top_block_sptr r) noexcept(false)
{
GR_PYTHON_BLOCKING_CODE
(
@@ -89,7 +89,7 @@ void top_block_stop_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
)
}
-void top_block_unlock_unlocked(gr::top_block_sptr r) throw (std::runtime_error)
+void top_block_unlock_unlocked(gr::top_block_sptr r) noexcept(false)
{
GR_PYTHON_BLOCKING_CODE
(