From 99c2730bc9db270560671f2d7d173768465ed51f Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 31 Oct 2016 14:30:52 -0700 Subject: Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types) - Also removes all references to boost/cstdint.hpp and replaces it with stdint.h (The 'correct' replacement would be , but not all of our compilers support that). --- host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp | 50 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp') diff --git a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp index ef541e37f..16ee84140 100644 --- a/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp +++ b/host/lib/usrp/common/usrp3_fw_ctrl_iface.cpp @@ -32,7 +32,7 @@ namespace uhd { namespace usrp { namespace usrp3 { //---------------------------------------------------------- uhd::wb_iface::sptr usrp3_fw_ctrl_iface::make( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose) { return wb_iface::sptr(new usrp3_fw_ctrl_iface(udp_xport, product_id, verbose)); @@ -44,7 +44,7 @@ uhd::wb_iface::sptr usrp3_fw_ctrl_iface::make( usrp3_fw_ctrl_iface::usrp3_fw_ctrl_iface( uhd::transport::udp_simple::sptr udp_xport, - const boost::uint16_t product_id, + const uint16_t product_id, const bool verbose) : _product_id(product_id), _verbose(verbose), _udp_xport(udp_xport), _seq_num(0) @@ -64,7 +64,7 @@ void usrp3_fw_ctrl_iface::flush() _flush(); } -void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const boost::uint32_t data) +void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const uint32_t data) { boost::mutex::scoped_lock lock(_mutex); @@ -81,7 +81,7 @@ void usrp3_fw_ctrl_iface::poke32(const wb_addr_type addr, const boost::uint32_t } } -boost::uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) +uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) { boost::mutex::scoped_lock lock(_mutex); @@ -98,13 +98,13 @@ boost::uint32_t usrp3_fw_ctrl_iface::peek32(const wb_addr_type addr) return 0; } -void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t data) +void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const uint32_t data) { //Load request struct fw_comm_pkt_t request; - request.id = uhd::htonx(FW_COMM_GENERATE_ID(_product_id)); - request.flags = uhd::htonx(FW_COMM_FLAGS_ACK | FW_COMM_CMD_POKE32); - request.sequence = uhd::htonx(_seq_num++); + request.id = uhd::htonx(FW_COMM_GENERATE_ID(_product_id)); + request.flags = uhd::htonx(FW_COMM_FLAGS_ACK | FW_COMM_CMD_POKE32); + request.sequence = uhd::htonx(_seq_num++); request.addr = uhd::htonx(addr); request.data_words = 1; request.data[0] = uhd::htonx(data); @@ -119,7 +119,7 @@ void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t if (nbytes == 0) throw uhd::io_error("udp fw poke32 - reply timed out"); //Sanity checks - const size_t flags = uhd::ntohx(reply.flags); + const size_t flags = uhd::ntohx(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & FW_COMM_FLAGS_ERROR_MASK)); UHD_ASSERT_THROW(flags & FW_COMM_CMD_POKE32); @@ -129,13 +129,13 @@ void usrp3_fw_ctrl_iface::_poke32(const wb_addr_type addr, const boost::uint32_t UHD_ASSERT_THROW(reply.data[0] == request.data[0]); } -boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) +uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) { //Load request struct fw_comm_pkt_t request; - request.id = uhd::htonx(FW_COMM_GENERATE_ID(_product_id)); - request.flags = uhd::htonx(FW_COMM_FLAGS_ACK | FW_COMM_CMD_PEEK32); - request.sequence = uhd::htonx(_seq_num++); + request.id = uhd::htonx(FW_COMM_GENERATE_ID(_product_id)); + request.flags = uhd::htonx(FW_COMM_FLAGS_ACK | FW_COMM_CMD_PEEK32); + request.sequence = uhd::htonx(_seq_num++); request.addr = uhd::htonx(addr); request.data_words = 1; request.data[0] = 0; @@ -150,7 +150,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) if (nbytes == 0) throw uhd::io_error("udp fw peek32 - reply timed out"); //Sanity checks - const size_t flags = uhd::ntohx(reply.flags); + const size_t flags = uhd::ntohx(reply.flags); UHD_ASSERT_THROW(nbytes == sizeof(reply)); UHD_ASSERT_THROW(not (flags & FW_COMM_FLAGS_ERROR_MASK)); UHD_ASSERT_THROW(flags & FW_COMM_CMD_PEEK32); @@ -159,7 +159,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::_peek32(const wb_addr_type addr) UHD_ASSERT_THROW(reply.addr == request.addr); //return result! - return uhd::ntohx(reply.data[0]); + return uhd::ntohx(reply.data[0]); } void usrp3_fw_ctrl_iface::_flush(void) @@ -172,7 +172,7 @@ void usrp3_fw_ctrl_iface::_flush(void) std::vector usrp3_fw_ctrl_iface::discover_devices( const std::string& addr_hint, const std::string& port, - boost::uint16_t product_id) + uint16_t product_id) { std::vector addrs; @@ -190,9 +190,9 @@ std::vector usrp3_fw_ctrl_iface::discover_devices( //Send dummy request fw_comm_pkt_t request; - request.id = uhd::htonx(FW_COMM_GENERATE_ID(product_id)); - request.flags = uhd::htonx(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); - request.sequence = uhd::htonx(std::rand()); + request.id = uhd::htonx(FW_COMM_GENERATE_ID(product_id)); + request.flags = uhd::htonx(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); + request.sequence = uhd::htonx(std::rand()); udp_bcast_xport->send(boost::asio::buffer(&request, sizeof(request))); //loop for replies until timeout @@ -213,18 +213,18 @@ std::vector usrp3_fw_ctrl_iface::discover_devices( return addrs; } -boost::uint32_t usrp3_fw_ctrl_iface::get_iface_id( +uint32_t usrp3_fw_ctrl_iface::get_iface_id( const std::string& addr, const std::string& port, - boost::uint16_t product_id) + uint16_t product_id) { uhd::transport::udp_simple::sptr udp_xport = uhd::transport::udp_simple::make_connected(addr, port); //Send dummy request fw_comm_pkt_t request; - request.id = uhd::htonx(FW_COMM_GENERATE_ID(product_id)); - request.flags = uhd::htonx(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); - request.sequence = uhd::htonx(std::rand()); + request.id = uhd::htonx(FW_COMM_GENERATE_ID(product_id)); + request.flags = uhd::htonx(FW_COMM_FLAGS_ACK|FW_COMM_CMD_ECHO); + request.sequence = uhd::htonx(std::rand()); udp_xport->send(boost::asio::buffer(&request, sizeof(request))); //loop for replies until timeout @@ -237,7 +237,7 @@ boost::uint32_t usrp3_fw_ctrl_iface::get_iface_id( request.flags == reply->flags && request.sequence == reply->sequence) { - return uhd::ntohx(reply->data[0]); + return uhd::ntohx(reply->data[0]); } else { throw uhd::io_error("udp get_iface_id - bad response"); } -- cgit v1.2.3