From f1ef7c182d22df3e757b7dc4fa2970fc8bf143de Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 19 Sep 2012 14:24:47 -0400 Subject: digital: fix private access in gr_endian_swap --- gnuradio-core/src/lib/general/gr_endian_swap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/general/gr_endian_swap.cc b/gnuradio-core/src/lib/general/gr_endian_swap.cc index d86da5aa7..8bea0ca30 100644 --- a/gnuradio-core/src/lib/general/gr_endian_swap.cc +++ b/gnuradio-core/src/lib/general/gr_endian_swap.cc @@ -51,7 +51,7 @@ gr_endian_swap::work (int noutput_items, const char *in = (const char *) input_items[0]; char *out = (char *) output_items[0]; - int nbytes( d_output_signature->sizeof_stream_item(0) ); + int nbytes( output_signature()->sizeof_stream_item(0) ); if(is_unaligned()) { switch(nbytes){ case 1: -- cgit From 08cf111f1d30ad08965c2892aeed5030d2cec1b2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 14 Aug 2012 23:00:16 -0700 Subject: core: fix use of private vars in place of API accessor Conflicts: gnuradio-core/src/lib/io/gr_tagged_file_sink.cc --- gnuradio-core/src/lib/general/gr_annotator_raw.cc | 2 +- gnuradio-core/src/lib/io/gr_tagged_file_sink.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/general/gr_annotator_raw.cc b/gnuradio-core/src/lib/general/gr_annotator_raw.cc index e1ae73efb..d3dcce73a 100644 --- a/gnuradio-core/src/lib/general/gr_annotator_raw.cc +++ b/gnuradio-core/src/lib/general/gr_annotator_raw.cc @@ -55,7 +55,7 @@ void gr_annotator_raw::add_tag(uint64_t offset, pmt_t key, pmt_t val) gruel::scoped_lock l(d_mutex); gr_tag_t tag; - tag.srcid = pmt::pmt_intern(d_name); + tag.srcid = pmt::pmt_intern(name()); tag.key = key; tag.value = val; tag.offset = offset; 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 d69892762..6d642088e 100644 --- a/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc +++ b/gnuradio-core/src/lib/io/gr_tagged_file_sink.cc @@ -143,7 +143,7 @@ gr_tagged_file_sink::work (int noutput_items, std::stringstream filename; filename.setf(std::ios::fixed, std::ios::floatfield); filename.precision(8); - filename << "file" << d_n << "_" << d_timeval << ".dat"; + filename << "file" << unique_id() << "_" << d_n << "_" << d_timeval << ".dat"; d_n++; int fd; -- cgit From 2abda17d8ed2794ff5b4bc0d9f61d30d8ffac651 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 29 Sep 2012 20:29:27 -0700 Subject: core: fix implicit assumption in skiphead skiphead is a gr_block, not sync block, but assumes that the number of input items is at least the number of output items remove this assumption and make this safe with std::min(ninputs, noutputs) may be necessary with new scheduler patches that can vary the circular buffer sizes --- gnuradio-core/src/lib/general/gr_skiphead.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/general/gr_skiphead.cc b/gnuradio-core/src/lib/general/gr_skiphead.cc index c887376e4..7b441bea9 100644 --- a/gnuradio-core/src/lib/general/gr_skiphead.cc +++ b/gnuradio-core/src/lib/general/gr_skiphead.cc @@ -43,14 +43,14 @@ gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip) int gr_skiphead::general_work(int noutput_items, - gr_vector_int &ninput_items_ignored, + gr_vector_int &ninput_items_, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { const char *in = (const char *) input_items[0]; char *out = (char *) output_items[0]; - int ninput_items = noutput_items; // we've got at least this many input items + int ninput_items = std::min(ninput_items_[0], noutput_items); int ii = 0; // input index while (ii < ninput_items){ -- cgit From a7e260a09bdb923b77174cedd31c2d7d70f32765 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 29 Sep 2012 20:13:38 -0700 Subject: core: source block can yield thread context/produce none --- gnuradio-core/src/lib/runtime/gr_block_executor.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc index 6fea14613..c08534475 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc @@ -449,6 +449,7 @@ gr_block_executor::run_one_iteration() // We didn't produce any output even though we called general_work. // We have (most likely) consumed some input. + /* // If this is a source, it's broken. if (d->source_p()){ std::cerr << "gr_block_executor: source " << m @@ -456,6 +457,7 @@ gr_block_executor::run_one_iteration() // FIXME maybe we ought to raise an exception... goto were_done; } + */ // Have the caller try again... return READY_NO_OUTPUT; -- cgit From 65ea256f8de15b7a23c602f9775edf0636b3732c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 29 Sep 2012 20:19:16 -0700 Subject: core: udp source wait mode yields work thread --- gnuradio-core/src/lib/io/gr_udp_source.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc index af41159ee..eca8e89d0 100644 --- a/gnuradio-core/src/lib/io/gr_udp_source.cc +++ b/gnuradio-core/src/lib/io/gr_udp_source.cc @@ -269,8 +269,9 @@ gr_udp_source::work (int noutput_items, else if(r == 0 ) { // timed out if( d_wait ) { // Allow boost thread interrupt, then try again - boost::this_thread::interruption_point(); - continue; + //boost::this_thread::interruption_point(); + //continue; + return 0; } else return -1; @@ -294,8 +295,9 @@ gr_udp_source::work (int noutput_items, if( d_wait ) { // Allow boost thread interrupt, then try again - boost::this_thread::interruption_point(); - continue; + //boost::this_thread::interruption_point(); + //continue; + return 0; } else return -1; -- cgit