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/types/byte_vector.cpp | 2 +- host/lib/types/mac_addr.cpp | 6 +++--- host/lib/types/serial.cpp | 28 ++++++++++++++-------------- host/lib/types/sid.cpp | 22 +++++++++++----------- host/lib/types/wb_iface.cpp | 12 ++++++------ 5 files changed, 35 insertions(+), 35 deletions(-) (limited to 'host/lib/types') diff --git a/host/lib/types/byte_vector.cpp b/host/lib/types/byte_vector.cpp index 071cdb8cb..15ae93858 100644 --- a/host/lib/types/byte_vector.cpp +++ b/host/lib/types/byte_vector.cpp @@ -23,7 +23,7 @@ namespace uhd{ std::string bytes_to_string(const byte_vector_t &bytes){ std::string out; - BOOST_FOREACH(boost::uint8_t byte, bytes){ + BOOST_FOREACH(uint8_t byte, bytes){ if (byte < 32 or byte > 127) return out; out += byte; } diff --git a/host/lib/types/mac_addr.cpp b/host/lib/types/mac_addr.cpp index a5cb90f97..ab71bc0c3 100644 --- a/host/lib/types/mac_addr.cpp +++ b/host/lib/types/mac_addr.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include using namespace uhd; @@ -49,7 +49,7 @@ mac_addr_t mac_addr_t::from_string(const std::string &mac_addr_str){ int hex_num; std::istringstream iss(hex_str); iss >> std::hex >> hex_num; - bytes.push_back(boost::uint8_t(hex_num)); + bytes.push_back(uint8_t(hex_num)); } } @@ -68,7 +68,7 @@ byte_vector_t mac_addr_t::to_bytes(void) const{ std::string mac_addr_t::to_string(void) const{ std::string addr = ""; - BOOST_FOREACH(boost::uint8_t byte, this->to_bytes()){ + BOOST_FOREACH(uint8_t byte, this->to_bytes()){ addr += str(boost::format("%s%02x") % ((addr == "")?"":":") % int(byte)); } return addr; diff --git a/host/lib/types/serial.cpp b/host/lib/types/serial.cpp index 52961691c..5d03d40cf 100644 --- a/host/lib/types/serial.cpp +++ b/host/lib/types/serial.cpp @@ -45,8 +45,8 @@ spi_config_t::spi_config_t(edge_t edge): } void i2c_iface::write_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, const byte_vector_t &bytes ){ for (size_t i = 0; i < bytes.size(); i++){ @@ -58,8 +58,8 @@ void i2c_iface::write_eeprom( } byte_vector_t i2c_iface::read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ){ byte_vector_t bytes; @@ -80,22 +80,22 @@ struct eeprom16_impl : i2c_iface i2c_iface* _internal; byte_vector_t read_i2c( - boost::uint16_t addr, + uint16_t addr, size_t num_bytes ){ return _internal->read_i2c(addr, num_bytes); } void write_i2c( - boost::uint16_t addr, + uint16_t addr, const byte_vector_t &bytes ){ return _internal->write_i2c(addr, bytes); } byte_vector_t read_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, size_t num_bytes ){ byte_vector_t cmd = boost::assign::list_of(offset >> 8)(offset & 0xff); @@ -104,14 +104,14 @@ struct eeprom16_impl : i2c_iface } void write_eeprom( - boost::uint16_t addr, - boost::uint16_t offset, + uint16_t addr, + uint16_t offset, const byte_vector_t &bytes ){ for (size_t i = 0; i < bytes.size(); i++) { //write a byte at a time, its easy that way - boost::uint16_t offset_i = offset+i; + uint16_t offset_i = offset+i; byte_vector_t cmd = boost::assign::list_of(offset_i >> 8)(offset_i & 0xff)(bytes[i]); this->write_i2c(addr, cmd); boost::this_thread::sleep(boost::posix_time::milliseconds(10)); //worst case write @@ -124,10 +124,10 @@ i2c_iface::sptr i2c_iface::eeprom16(void) return i2c_iface::sptr(new eeprom16_impl(this)); } -boost::uint32_t spi_iface::read_spi( +uint32_t spi_iface::read_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ return transact_spi( @@ -138,7 +138,7 @@ boost::uint32_t spi_iface::read_spi( void spi_iface::write_spi( int which_slave, const spi_config_t &config, - boost::uint32_t data, + uint32_t data, size_t num_bits ){ transact_spi( diff --git a/host/lib/types/sid.cpp b/host/lib/types/sid.cpp index 2fc3781cf..b697bd614 100644 --- a/host/lib/types/sid.cpp +++ b/host/lib/types/sid.cpp @@ -29,12 +29,12 @@ sid_t::sid_t() { } -sid_t::sid_t(boost::uint32_t sid) +sid_t::sid_t(uint32_t sid) : _sid(sid), _set(true) { } -sid_t::sid_t(boost::uint8_t src_addr, boost::uint8_t src_ep, boost::uint8_t dst_addr, boost::uint8_t dst_ep) +sid_t::sid_t(uint8_t src_addr, uint8_t src_ep, uint8_t dst_addr, uint8_t dst_ep) : _sid(0x0000), _set(true) { set_src_addr(src_addr); @@ -76,7 +76,7 @@ std::string sid_t::to_pp_string_hex() const } -void sid_t::set_sid(boost::uint32_t new_sid) +void sid_t::set_sid(uint32_t new_sid) { _set = true; _sid = new_sid; @@ -107,36 +107,36 @@ void sid_t::set_from_str(const std::string &sid_str) throw uhd::value_error(str(boost::format("Invalid SID representation: %s") % sid_str)); } -void sid_t::set_src(boost::uint32_t new_addr) { +void sid_t::set_src(uint32_t new_addr) { set_sid((_sid & 0x0000FFFF) | ((new_addr & 0xFFFF) << 16)); } -void sid_t::set_dst(boost::uint32_t new_addr) { +void sid_t::set_dst(uint32_t new_addr) { set_sid((_sid & 0xFFFF0000) | (new_addr & 0xFFFF)); } -void sid_t::set_src_addr(boost::uint32_t new_addr) { +void sid_t::set_src_addr(uint32_t new_addr) { set_sid((_sid & 0x00FFFFFF) | ((new_addr & 0xFF) << 24)); } -void sid_t::set_src_endpoint(boost::uint32_t new_addr) { +void sid_t::set_src_endpoint(uint32_t new_addr) { set_sid((_sid & 0xFF00FFFF) | ((new_addr & 0xFF) << 16)); } -void sid_t::set_dst_addr(boost::uint32_t new_addr) { +void sid_t::set_dst_addr(uint32_t new_addr) { set_sid((_sid & 0xFFFF00FF) | ((new_addr & 0xFF) << 8)); } -void sid_t::set_dst_endpoint(boost::uint32_t new_addr) { +void sid_t::set_dst_endpoint(uint32_t new_addr) { set_sid((_sid & 0xFFFFFF00) | ((new_addr & 0xFF) << 0)); } -void sid_t::set_dst_xbarport(boost::uint32_t new_xbarport) +void sid_t::set_dst_xbarport(uint32_t new_xbarport) { set_sid((_sid & 0xFFFFFF0F) | ((new_xbarport & 0xF) << 4)); } -void sid_t::set_dst_blockport(boost::uint32_t new_blockport) +void sid_t::set_dst_blockport(uint32_t new_blockport) { set_sid((_sid & 0xFFFFFFF0) | ((new_blockport & 0xF) << 0)); } diff --git a/host/lib/types/wb_iface.cpp b/host/lib/types/wb_iface.cpp index dc8d2a83e..686f0e1ee 100644 --- a/host/lib/types/wb_iface.cpp +++ b/host/lib/types/wb_iface.cpp @@ -25,32 +25,32 @@ wb_iface::~wb_iface(void) //NOP } -void wb_iface::poke64(const wb_iface::wb_addr_type, const boost::uint64_t) +void wb_iface::poke64(const wb_iface::wb_addr_type, const uint64_t) { throw uhd::not_implemented_error("poke64 not implemented"); } -boost::uint64_t wb_iface::peek64(const wb_iface::wb_addr_type) +uint64_t wb_iface::peek64(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek64 not implemented"); } -void wb_iface::poke32(const wb_iface::wb_addr_type, const boost::uint32_t) +void wb_iface::poke32(const wb_iface::wb_addr_type, const uint32_t) { throw uhd::not_implemented_error("poke32 not implemented"); } -boost::uint32_t wb_iface::peek32(const wb_iface::wb_addr_type) +uint32_t wb_iface::peek32(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek32 not implemented"); } -void wb_iface::poke16(const wb_iface::wb_addr_type, const boost::uint16_t) +void wb_iface::poke16(const wb_iface::wb_addr_type, const uint16_t) { throw uhd::not_implemented_error("poke16 not implemented"); } -boost::uint16_t wb_iface::peek16(const wb_iface::wb_addr_type) +uint16_t wb_iface::peek16(const wb_iface::wb_addr_type) { throw uhd::not_implemented_error("peek16 not implemented"); } -- cgit v1.2.3