diff options
-rw-r--r-- | gnuradio-runtime/include/gnuradio/basic_block.h | 5 | ||||
-rw-r--r-- | gnuradio-runtime/lib/prefs.cc | 5 | ||||
-rw-r--r-- | gnuradio-runtime/lib/tpb_thread_body.cc | 3 | ||||
-rw-r--r-- | gr-audio/lib/audio_registry.cc | 5 | ||||
-rw-r--r-- | gr-blocks/lib/patterned_interleaver_impl.cc | 2 | ||||
-rw-r--r-- | gr-blocks/lib/patterned_interleaver_impl.h | 4 | ||||
-rw-r--r-- | gr-blocks/lib/stream_mux_impl.cc | 3 | ||||
-rw-r--r-- | gr-channels/lib/selective_fading_model2_impl.h | 6 | ||||
-rw-r--r-- | gr-channels/lib/selective_fading_model_impl.h | 6 | ||||
-rw-r--r-- | gr-uhd/examples/c++/tag_sink_demo.h | 3 | ||||
-rw-r--r-- | gr-uhd/examples/c++/tag_source_demo.h | 1 | ||||
-rw-r--r-- | gr-uhd/lib/usrp_sink_impl.cc | 8 | ||||
-rw-r--r-- | gr-uhd/lib/usrp_source_impl.cc | 2 |
13 files changed, 23 insertions, 30 deletions
diff --git a/gnuradio-runtime/include/gnuradio/basic_block.h b/gnuradio-runtime/include/gnuradio/basic_block.h index 1f84a97c5b..90c9c2f8bc 100644 --- a/gnuradio-runtime/include/gnuradio/basic_block.h +++ b/gnuradio-runtime/include/gnuradio/basic_block.h @@ -18,7 +18,6 @@ #include <gnuradio/sptr_magic.h> #include <gnuradio/thread/thread.h> #include <boost/enable_shared_from_this.hpp> -#include <boost/foreach.hpp> #include <boost/function.hpp> #include <boost/thread/condition_variable.hpp> #include <deque> @@ -226,7 +225,7 @@ public: bool empty_p() { bool rv = true; - BOOST_FOREACH (msg_queue_map_t::value_type& i, msg_queue) { + for (const auto& i : msg_queue) { rv &= msg_queue[i.first].empty(); } return rv; @@ -240,7 +239,7 @@ public: bool empty_handled_p() { bool rv = true; - BOOST_FOREACH (msg_queue_map_t::value_type& i, msg_queue) { + for (const auto& i : msg_queue) { rv &= empty_handled_p(i.first); } return rv; diff --git a/gnuradio-runtime/lib/prefs.cc b/gnuradio-runtime/lib/prefs.cc index 6eefcfd569..f87bb7a10c 100644 --- a/gnuradio-runtime/lib/prefs.cc +++ b/gnuradio-runtime/lib/prefs.cc @@ -23,7 +23,6 @@ #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/operations.hpp> #include <boost/filesystem/path.hpp> -#include <boost/foreach.hpp> #include <boost/program_options.hpp> namespace fs = boost::filesystem; namespace po = boost::program_options; @@ -73,13 +72,13 @@ std::vector<std::string> prefs::_sys_prefs_filenames() void prefs::_read_files(const std::vector<std::string>& filenames) { - BOOST_FOREACH (std::string fname, filenames) { + for (const auto& fname : filenames) { std::ifstream infile(fname.c_str()); if (infile.good()) { try { po::basic_parsed_options<char_t> parsed = po::parse_config_file(infile, po::options_description(), true); - BOOST_FOREACH (po::basic_option<char_t> o, (parsed.options)) { + for (const auto& o : parsed.options) { std::string okey = o.string_key; size_t pos = okey.find("."); std::string section, key; diff --git a/gnuradio-runtime/lib/tpb_thread_body.cc b/gnuradio-runtime/lib/tpb_thread_body.cc index d262427b35..fd5b278cb9 100644 --- a/gnuradio-runtime/lib/tpb_thread_body.cc +++ b/gnuradio-runtime/lib/tpb_thread_body.cc @@ -15,7 +15,6 @@ #include "tpb_thread_body.h" #include <gnuradio/prefs.h> #include <pmt/pmt.h> -#include <boost/foreach.hpp> #include <boost/thread.hpp> #include <iostream> @@ -87,7 +86,7 @@ tpb_thread_body::tpb_thread_body(block_sptr block, d->d_tpb.clear_changed(); // handle any queued up messages - BOOST_FOREACH (basic_block::msg_queue_map_t::value_type& i, block->msg_queue) { + for (const auto& i : block->msg_queue) { // Check if we have a message handler attached before getting // any messages. This is mostly a protection for the unknown // startup sequence of the threads. diff --git a/gr-audio/lib/audio_registry.cc b/gr-audio/lib/audio_registry.cc index 8e62511dfc..13ad989c61 100644 --- a/gr-audio/lib/audio_registry.cc +++ b/gr-audio/lib/audio_registry.cc @@ -10,7 +10,6 @@ #include "audio_registry.h" #include <gnuradio/logger.h> #include <gnuradio/prefs.h> -#include <boost/foreach.hpp> #include <iostream> #include <stdexcept> #include <vector> @@ -151,7 +150,7 @@ source::make(int sampling_rate, const std::string device_name, bool ok_to_block) std::string arch = default_arch_name(); source_entry_t entry = get_source_registry().front(); - BOOST_FOREACH (const source_entry_t& e, get_source_registry()) { + for (const auto& e : get_source_registry()) { if (e.prio > entry.prio) entry = e; // entry is highest prio if (arch != e.arch) @@ -175,7 +174,7 @@ sink::sptr sink::make(int sampling_rate, const std::string device_name, bool ok_ std::string arch = default_arch_name(); sink_entry_t entry = get_sink_registry().front(); - BOOST_FOREACH (const sink_entry_t& e, get_sink_registry()) { + for (const sink_entry_t& e : get_sink_registry()) { if (e.prio > entry.prio) entry = e; // entry is highest prio if (arch != e.arch) diff --git a/gr-blocks/lib/patterned_interleaver_impl.cc b/gr-blocks/lib/patterned_interleaver_impl.cc index 9ea596dc67..e38ba5099a 100644 --- a/gr-blocks/lib/patterned_interleaver_impl.cc +++ b/gr-blocks/lib/patterned_interleaver_impl.cc @@ -34,7 +34,7 @@ patterned_interleaver_impl::patterned_interleaver_impl(size_t itemsize, d_counts(pattern_max(pattern) + 1, 0), d_itemsize(itemsize) { - BOOST_FOREACH (int i, d_pattern) { + for (const auto& i : d_pattern) { d_counts[i]++; } set_output_multiple(d_pattern.size()); diff --git a/gr-blocks/lib/patterned_interleaver_impl.h b/gr-blocks/lib/patterned_interleaver_impl.h index aeeff66179..f48af2cdd5 100644 --- a/gr-blocks/lib/patterned_interleaver_impl.h +++ b/gr-blocks/lib/patterned_interleaver_impl.h @@ -12,7 +12,7 @@ #define INCLUDED_PATTERNED_INTERLEAVER_IMPL_H #include <gnuradio/blocks/patterned_interleaver.h> -#include <boost/foreach.hpp> +#include <algorithm> namespace gr { namespace blocks { @@ -30,7 +30,7 @@ public: int pattern_max(std::vector<int> pattern) { int mval(0); - BOOST_FOREACH (int i, pattern) { + for (const auto& i : pattern) { mval = std::max(mval, i); } return mval; diff --git a/gr-blocks/lib/stream_mux_impl.cc b/gr-blocks/lib/stream_mux_impl.cc index eb4daf9f94..42a0b1f27e 100644 --- a/gr-blocks/lib/stream_mux_impl.cc +++ b/gr-blocks/lib/stream_mux_impl.cc @@ -14,7 +14,6 @@ #include "stream_mux_impl.h" #include <gnuradio/io_signature.h> -#include <boost/foreach.hpp> #include <cstring> namespace gr { @@ -80,7 +79,7 @@ int stream_mux_impl::general_work(int noutput_items, d_stream, input_index[d_stream], input_index[d_stream] + items_to_copy); - BOOST_FOREACH (gr::tag_t t, stream_t) { + for (auto t : stream_t) { t.offset = t.offset - nitems_read(d_stream) - input_index[d_stream] + nitems_written(0) + out_index; add_item_tag(0, t); diff --git a/gr-channels/lib/selective_fading_model2_impl.h b/gr-channels/lib/selective_fading_model2_impl.h index 79c9d73b7f..680bcbb56c 100644 --- a/gr-channels/lib/selective_fading_model2_impl.h +++ b/gr-channels/lib/selective_fading_model2_impl.h @@ -59,14 +59,14 @@ public: virtual void set_fDTs(float fDTs) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_fDTs = fDTs; fader->d_step = powf(0.00125 * fDTs, 1.1); } } virtual void set_K(float K) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_K = K; fader->scale_los = sqrtf(fader->d_K) / sqrtf(fader->d_K + 1); fader->scale_nlos = (1 / sqrtf(fader->d_K + 1)); @@ -74,7 +74,7 @@ public: } virtual void set_step(float step) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_step = step; } } diff --git a/gr-channels/lib/selective_fading_model_impl.h b/gr-channels/lib/selective_fading_model_impl.h index 6b333b82c2..b899319a2c 100644 --- a/gr-channels/lib/selective_fading_model_impl.h +++ b/gr-channels/lib/selective_fading_model_impl.h @@ -51,14 +51,14 @@ public: virtual void set_fDTs(float fDTs) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_fDTs = fDTs; fader->d_step = powf(0.00125 * fDTs, 1.1); } } virtual void set_K(float K) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_K = K; fader->scale_los = sqrtf(fader->d_K) / sqrtf(fader->d_K + 1); fader->scale_nlos = (1 / sqrtf(fader->d_K + 1)); @@ -66,7 +66,7 @@ public: } virtual void set_step(float step) { - BOOST_FOREACH (gr::channels::flat_fader_impl* fader, d_faders) { + for (const auto& fader : d_faders) { fader->d_step = step; } } diff --git a/gr-uhd/examples/c++/tag_sink_demo.h b/gr-uhd/examples/c++/tag_sink_demo.h index 2f60be225e..f123bc3993 100644 --- a/gr-uhd/examples/c++/tag_sink_demo.h +++ b/gr-uhd/examples/c++/tag_sink_demo.h @@ -9,7 +9,6 @@ #include <gnuradio/io_signature.h> #include <gnuradio/sync_block.h> -#include <boost/foreach.hpp> #include <boost/format.hpp> #include <complex> #include <iostream> @@ -39,7 +38,7 @@ public: pmt::string_to_symbol("rx_time")); // print all tags - BOOST_FOREACH (const gr::tag_t& rx_time_tag, rx_time_tags) { + for (const auto& rx_time_tag : rx_time_tags) { const uint64_t offset = rx_time_tag.offset; const pmt::pmt_t& value = rx_time_tag.value; diff --git a/gr-uhd/examples/c++/tag_source_demo.h b/gr-uhd/examples/c++/tag_source_demo.h index 2c48425423..623a902d68 100644 --- a/gr-uhd/examples/c++/tag_source_demo.h +++ b/gr-uhd/examples/c++/tag_source_demo.h @@ -9,7 +9,6 @@ #include <gnuradio/io_signature.h> #include <gnuradio/sync_block.h> -#include <boost/foreach.hpp> #include <boost/format.hpp> #include <complex> #include <iostream> diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc index d0be142784..e3694a8948 100644 --- a/gr-uhd/lib/usrp_sink_impl.cc +++ b/gr-uhd/lib/usrp_sink_impl.cc @@ -65,7 +65,7 @@ std::string usrp_sink_impl::get_subdev_spec(size_t mboard) void usrp_sink_impl::set_samp_rate(double rate) { - BOOST_FOREACH (const size_t chan, _stream_args.channels) { + for (const auto& chan : _stream_args.channels) { _dev->set_tx_rate(rate, chan); } _sample_rate = this->get_samp_rate(); @@ -413,7 +413,7 @@ int usrp_sink_impl::work(int noutput_items, GR_LOG_DEBUG(d_debug_logger, boost::format("Executing %d pending commands.") % _pending_cmds.size()); - BOOST_FOREACH (const pmt::pmt_t& cmd_pmt, _pending_cmds) { + for (const auto& cmd_pmt : _pending_cmds) { msg_handler_command(cmd_pmt); } _pending_cmds.clear(); @@ -440,7 +440,7 @@ void usrp_sink_impl::tag_work(int& ninput_items) // For commands that are in the middle of the burst: std::vector<pmt::pmt_t> commands_in_burst; // Store the command uint64_t in_burst_cmd_offset = 0; // Store its position - BOOST_FOREACH (const tag_t& my_tag, _tags) { + for (const auto& my_tag : _tags) { const uint64_t my_tag_count = my_tag.offset; const pmt::pmt_t& key = my_tag.key; const pmt::pmt_t& value = my_tag.value; @@ -566,7 +566,7 @@ void usrp_sink_impl::tag_work(int& ninput_items) // ...then it's in the middle of a burst, only send() until before the tag max_count = in_burst_cmd_offset; } else if (in_burst_cmd_offset < max_count) { - BOOST_FOREACH (const pmt::pmt_t& cmd_pmt, commands_in_burst) { + for (const auto& cmd_pmt : commands_in_burst) { _pending_cmds.push_back(cmd_pmt); } } diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc index 14486dd109..38ec5ecc46 100644 --- a/gr-uhd/lib/usrp_source_impl.cc +++ b/gr-uhd/lib/usrp_source_impl.cc @@ -69,7 +69,7 @@ std::string usrp_source_impl::get_subdev_spec(size_t mboard) void usrp_source_impl::set_samp_rate(double rate) { - BOOST_FOREACH (const size_t chan, _stream_args.channels) { + for (const auto& chan : _stream_args.channels) { _dev->set_rx_rate(rate, chan); } _samp_rate = this->get_samp_rate(); |