xtrx: remove BOOST_FOREACH and obsolete API call

All instances of BOOST_FOREACH were removed in an earlier commit, but it
was reintroduced when xtrx support was merged. I removed BOOST_FOREACH
again here.

Also, xtrx support fails to build because it relies on the
xtrx_open_list function, which was removed from the xtrx API in 2019. It
was replaced with xtrx_open_string.

I don't have xtrx hardware, so I've only tested that gr-osmosdr compiles
with these changes.

Signed-off-by: Eric Wild <ewild@sysmocom.de>
This commit is contained in:
Clayton Smith 2021-01-08 22:35:07 -05:00 committed by Eric Wild
parent bc629b03fe
commit c3187ab875
4 changed files with 6 additions and 5 deletions

View File

@ -154,7 +154,8 @@ sink_impl::sink_impl( const std::string &args )
dev_list.push_back( dev ); dev_list.push_back( dev );
#endif #endif
#ifdef ENABLE_XTRX #ifdef ENABLE_XTRX
BOOST_FOREACH( std::string dev, xtrx_sink_c::get_devices() ) for (std::string dev : xtrx_sink_c::get_devices())
dev_list.push_back( dev );
#endif #endif
#ifdef ENABLE_FILE #ifdef ENABLE_FILE
for (std::string dev : file_sink_c::get_devices()) for (std::string dev : file_sink_c::get_devices())

View File

@ -242,7 +242,7 @@ source_impl::source_impl( const std::string &args )
dev_list.push_back( dev ); dev_list.push_back( dev );
#endif #endif
#ifdef ENABLE_XTRX #ifdef ENABLE_XTRX
BOOST_FOREACH( std::string dev, xtrx_source_c::get_devices() ) for (std::string dev : xtrx_source_c::get_devices())
dev_list.push_back( dev ); dev_list.push_back( dev );
#endif #endif

View File

@ -68,7 +68,7 @@ xtrx_obj::xtrx_obj(const std::string &path, unsigned loglevel, bool lmsreset)
unsigned xtrxflag = (loglevel & XTRX_O_LOGLVL_MASK) | ((lmsreset) ? XTRX_O_RESET : 0); unsigned xtrxflag = (loglevel & XTRX_O_LOGLVL_MASK) | ((lmsreset) ? XTRX_O_RESET : 0);
std::cerr << "xtrx_obj::xtrx_obj = " << xtrxflag << std::endl; std::cerr << "xtrx_obj::xtrx_obj = " << xtrxflag << std::endl;
int res = xtrx_open_list(path.c_str(), NULL, &_obj); int res = xtrx_open_string(path.c_str(), &_obj);
if (res < 0) { if (res < 0) {
std::stringstream message; std::stringstream message;
message << "Couldn't open " ": Error: " << -res; message << "Couldn't open " ": Error: " << -res;

View File

@ -394,7 +394,7 @@ void xtrx_sink_c::tag_process(int ninput_items)
uint64_t max_count = samp0_count + ninput_items; uint64_t max_count = samp0_count + ninput_items;
bool found_time_tag = false; bool found_time_tag = false;
BOOST_FOREACH(const gr::tag_t &my_tag, _tags) { for (const gr::tag_t &my_tag : _tags) {
const uint64_t my_tag_count = my_tag.offset; const uint64_t my_tag_count = my_tag.offset;
const pmt::pmt_t &key = my_tag.key; const pmt::pmt_t &key = my_tag.key;
const pmt::pmt_t &value = my_tag.value; const pmt::pmt_t &value = my_tag.value;
@ -416,7 +416,7 @@ void xtrx_sink_c::tag_process(int ninput_items)
std::cerr << "TX_TIME: " << seconds << ":" << fractional << std::endl; std::cerr << "TX_TIME: " << seconds << ":" << fractional << std::endl;
} }
} // end foreach } // end for
if (found_time_tag) { if (found_time_tag) {
//_metadata.has_time_spec = true; //_metadata.has_time_spec = true;