summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/runtime
diff options
context:
space:
mode:
authorTom Rondeau2012-11-22 14:10:31 -0500
committerTom Rondeau2012-11-22 14:10:31 -0500
commit5a6f3e4bc8fc6af84bb09294b77bb4456c4c77f0 (patch)
tree09d195e4b67a303ce28844ab1e046e3c3274b130 /gnuradio-core/src/lib/runtime
parent83e1adf6f3efee641a994a9f4bb8dc2f827c873b (diff)
downloadgnuradio-5a6f3e4bc8fc6af84bb09294b77bb4456c4c77f0.tar.gz
gnuradio-5a6f3e4bc8fc6af84bb09294b77bb4456c4c77f0.tar.bz2
gnuradio-5a6f3e4bc8fc6af84bb09294b77bb4456c4c77f0.zip
runtime: changed check after cast to gr_block.
Diffstat (limited to 'gnuradio-core/src/lib/runtime')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
index b82ef46af..e04deb948 100644
--- a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
+++ b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
@@ -79,25 +79,24 @@ gr_flat_flowgraph::allocate_block_detail(gr_basic_block_sptr block)
int ninputs = calc_used_ports(block, true).size();
int noutputs = calc_used_ports(block, false).size();
gr_block_detail_sptr detail = gr_make_block_detail(ninputs, noutputs);
+
gr_block_sptr grblock = cast_to_block_sptr(block);
+ if(!grblock)
+ throw std::runtime_error("allocate_block_detail found non-gr_block");
if (GR_FLAT_FLOWGRAPH_DEBUG)
std::cout << "Creating block detail for " << block << std::endl;
for (int i = 0; i < noutputs; i++) {
- if(grblock) {
- grblock->expand_minmax_buffer(i);
- }
+ grblock->expand_minmax_buffer(i);
gr_buffer_sptr buffer = allocate_buffer(block, i);
if (GR_FLAT_FLOWGRAPH_DEBUG)
std::cout << "Allocated buffer for output " << block << ":" << i << std::endl;
detail->set_output(i, buffer);
- if(grblock) {
- // Update the block's max_output_buffer based on what was actually allocated.
- grblock->set_max_output_buffer(i, buffer->bufsize());
- }
+ // Update the block's max_output_buffer based on what was actually allocated.
+ grblock->set_max_output_buffer(i, buffer->bufsize());
}
return detail;