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/n230/n230_eeprom_manager.cpp | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'host/lib/usrp/n230/n230_eeprom_manager.cpp') diff --git a/host/lib/usrp/n230/n230_eeprom_manager.cpp b/host/lib/usrp/n230/n230_eeprom_manager.cpp index b19deb23a..d9d02c58c 100644 --- a/host/lib/usrp/n230/n230_eeprom_manager.cpp +++ b/host/lib/usrp/n230/n230_eeprom_manager.cpp @@ -65,13 +65,13 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() const n230_eeprom_map_t* map_ptr = reinterpret_cast(_response.data); const n230_eeprom_map_t& map = *map_ptr; - uint16_t ver_major = uhd::htonx(map.data_version_major); - uint16_t ver_minor = uhd::htonx(map.data_version_minor); + uint16_t ver_major = uhd::htonx(map.data_version_major); + uint16_t ver_minor = uhd::htonx(map.data_version_minor); _mb_eeprom["product"] = boost::lexical_cast( - uhd::htonx(map.hw_product)); + uhd::htonx(map.hw_product)); _mb_eeprom["revision"] = boost::lexical_cast( - uhd::htonx(map.hw_revision)); + uhd::htonx(map.hw_revision)); //The revision_compat field does not exist in version 1.0 //EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set //revision_compat = revision @@ -79,20 +79,20 @@ const mboard_eeprom_t& n230_eeprom_manager::read_mb_eeprom() _mb_eeprom["revision_compat"] = _mb_eeprom["revision"]; } else { _mb_eeprom["revision_compat"] = boost::lexical_cast( - uhd::htonx(map.hw_revision_compat)); + uhd::htonx(map.hw_revision_compat)); } _mb_eeprom["serial"] = _bytes_to_string( map.serial, N230_EEPROM_SERIAL_LEN); //Extract ethernet info _mb_eeprom["gateway"] = boost::asio::ip::address_v4( - uhd::htonx(map.gateway)).to_string(); + uhd::htonx(map.gateway)).to_string(); for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) { const std::string n(1, i+'0'); _mb_eeprom["ip-addr"+n] = boost::asio::ip::address_v4( - uhd::htonx(map.eth_info[i].ip_addr)).to_string(); + uhd::htonx(map.eth_info[i].ip_addr)).to_string(); _mb_eeprom["subnet"+n] = boost::asio::ip::address_v4( - uhd::htonx(map.eth_info[i].subnet)).to_string(); + uhd::htonx(map.eth_info[i].subnet)).to_string(); byte_vector_t mac_addr(map.eth_info[i].mac_addr, map.eth_info[i].mac_addr + 6); _mb_eeprom["mac-addr"+n] = mac_addr_t::from_bytes(mac_addr).to_string(); } @@ -117,28 +117,28 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) n230_eeprom_map_t& map = *map_ptr; // Automatic version upgrade handling - uint16_t old_ver_major = uhd::htonx(map.data_version_major); - uint16_t old_ver_minor = uhd::htonx(map.data_version_minor); + uint16_t old_ver_major = uhd::htonx(map.data_version_major); + uint16_t old_ver_minor = uhd::htonx(map.data_version_minor); //The revision_compat field does not exist for version 1.0 so force write it //EEPROM version 1.0 will only exist on HW revision 1 so it is safe to set //revision_compat = revision for the upgrade bool force_write_version_compat = (old_ver_major == 1 and old_ver_minor == 0); - map.data_version_major = uhd::htonx(N230_EEPROM_VER_MAJOR); - map.data_version_minor = uhd::htonx(N230_EEPROM_VER_MINOR); + map.data_version_major = uhd::htonx(N230_EEPROM_VER_MAJOR); + map.data_version_minor = uhd::htonx(N230_EEPROM_VER_MINOR); if (_mb_eeprom.has_key("product")) { - map.hw_product = uhd::htonx( - boost::lexical_cast(_mb_eeprom["product"])); + map.hw_product = uhd::htonx( + boost::lexical_cast(_mb_eeprom["product"])); } if (_mb_eeprom.has_key("revision")) { - map.hw_revision = uhd::htonx( - boost::lexical_cast(_mb_eeprom["revision"])); + map.hw_revision = uhd::htonx( + boost::lexical_cast(_mb_eeprom["revision"])); } if (_mb_eeprom.has_key("revision_compat")) { - map.hw_revision_compat = uhd::htonx( - boost::lexical_cast(_mb_eeprom["revision_compat"])); + map.hw_revision_compat = uhd::htonx( + boost::lexical_cast(_mb_eeprom["revision_compat"])); } else if (force_write_version_compat) { map.hw_revision_compat = map.hw_revision; } @@ -148,17 +148,17 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) //Push ethernet info if (_mb_eeprom.has_key("gateway")){ - map.gateway = uhd::htonx( + map.gateway = uhd::htonx( boost::asio::ip::address_v4::from_string(_mb_eeprom["gateway"]).to_ulong()); } for (size_t i = 0; i < N230_MAX_NUM_ETH_PORTS; i++) { const std::string n(1, i+'0'); if (_mb_eeprom.has_key("ip-addr"+n)){ - map.eth_info[i].ip_addr = uhd::htonx( + map.eth_info[i].ip_addr = uhd::htonx( boost::asio::ip::address_v4::from_string(_mb_eeprom["ip-addr"+n]).to_ulong()); } if (_mb_eeprom.has_key("subnet"+n)){ - map.eth_info[i].subnet = uhd::htonx( + map.eth_info[i].subnet = uhd::htonx( boost::asio::ip::address_v4::from_string(_mb_eeprom["subnet"+n]).to_ulong()); } if (_mb_eeprom.has_key("mac-addr"+n)) { @@ -175,11 +175,11 @@ void n230_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) _transact(N230_FLASH_COMM_CMD_WRITE_NV_DATA); } -void n230_eeprom_manager::_transact(const boost::uint32_t command) +void n230_eeprom_manager::_transact(const uint32_t command) { //Load request struct - _request.flags = uhd::htonx(N230_FLASH_COMM_FLAGS_ACK | command); - _request.seq = uhd::htonx(_seq_num++); + _request.flags = uhd::htonx(N230_FLASH_COMM_FLAGS_ACK | command); + _request.seq = uhd::htonx(_seq_num++); //Send request _flush_xport(); @@ -190,7 +190,7 @@ void n230_eeprom_manager::_transact(const boost::uint32_t command) if (nbytes == 0) throw uhd::io_error("n230_eeprom_manager::_transact failure"); //Sanity checks - const size_t flags = uhd::ntohx(_response.flags); + const size_t flags = uhd::ntohx(_response.flags); UHD_ASSERT_THROW(nbytes == sizeof(_response)); UHD_ASSERT_THROW(_response.seq == _request.seq); UHD_ASSERT_THROW(flags & command); -- cgit v1.2.3