aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2016-11-08 08:41:46 -0800
committerMartin Braun <martin.braun@ettus.com>2016-11-08 08:41:46 -0800
commit9b852f5f243e5cf68662b7152b5fa331a83e55fb (patch)
tree159ffe0761f78dd87e2ecc97abea14494abab4ff /host/lib/utils
parentc66cb1bad0d881394f3519bd94f4693cceab4c64 (diff)
parent99c2730bc9db270560671f2d7d173768465ed51f (diff)
downloaduhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.gz
uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.tar.bz2
uhd-9b852f5f243e5cf68662b7152b5fa331a83e55fb.zip
Merge branch 'maint'
Diffstat (limited to 'host/lib/utils')
-rw-r--r--host/lib/utils/ihex.cpp38
-rw-r--r--host/lib/utils/ihex.hpp6
-rw-r--r--host/lib/utils/platform.cpp16
-rw-r--r--host/lib/utils/tasks.cpp2
4 files changed, 31 insertions, 31 deletions
diff --git a/host/lib/utils/ihex.cpp b/host/lib/utils/ihex.cpp
index a29ac3e72..98f4fa760 100644
--- a/host/lib/utils/ihex.cpp
+++ b/host/lib/utils/ihex.cpp
@@ -59,9 +59,9 @@ static bool checksum(const std::string& record)
*/
static bool parse_record(
const std::string& record,
- boost::uint16_t &len,
- boost::uint16_t &addr,
- boost::uint16_t &type,
+ uint16_t &len,
+ uint16_t &addr,
+ uint16_t &type,
unsigned char* data
) {
unsigned int i;
@@ -98,16 +98,16 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler)
const char *filename = _ihex_filename.c_str();
/* Fields used in every record. */
- boost::uint16_t len = 0;
- boost::uint16_t type = 0;
- boost::uint16_t lower_address_bits = 0x0000;
+ uint16_t len = 0;
+ uint16_t type = 0;
+ uint16_t lower_address_bits = 0x0000;
static const int MAX_RECORD_LENGTH = 255;
unsigned char data[MAX_RECORD_LENGTH];
/* Can be set by the Intel HEX record 0x04, used for all 0x00 records
* thereafter. Note this field takes the place of the 'index' parameter in
* libusb calls, and is necessary for FX3's 32-bit addressing. */
- boost::uint16_t upper_address_bits = 0x0000;
+ uint16_t upper_address_bits = 0x0000;
std::ifstream file;
file.open(filename, std::ifstream::in);
@@ -117,7 +117,7 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler)
}
while (!file.eof()) {
- boost::int32_t ret = 0;
+ int32_t ret = 0;
std::string record;
file >> record;
@@ -156,8 +156,8 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler)
throw uhd::io_error("ihex_reader::read(): For ELA record, address must be 0, length must be 2.");
}
- upper_address_bits = ((boost::uint16_t)((data[0] & 0x00FF) << 8))\
- + ((boost::uint16_t)(data[1] & 0x00FF));
+ upper_address_bits = ((uint16_t)((data[0] & 0x00FF) << 8))\
+ + ((uint16_t)(data[1] & 0x00FF));
}
/* Type 0x05: Start Linear Address Record. */
@@ -170,10 +170,10 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler)
* to jump to an execution address start point, now contained within
* the data field. Parse these address bits out, and then push the
* instruction. */
- upper_address_bits = ((boost::uint16_t)((data[0] & 0x00FF) << 8))\
- + ((boost::uint16_t)(data[1] & 0x00FF));
- lower_address_bits = ((boost::uint16_t)((data[2] & 0x00FF) << 8))\
- + ((boost::uint16_t)(data[3] & 0x00FF));
+ upper_address_bits = ((uint16_t)((data[0] & 0x00FF) << 8))\
+ + ((uint16_t)(data[1] & 0x00FF));
+ lower_address_bits = ((uint16_t)((data[2] & 0x00FF) << 8))\
+ + ((uint16_t)(data[3] & 0x00FF));
record_handler(lower_address_bits, upper_address_bits, 0, 0);
}
@@ -192,7 +192,7 @@ void ihex_reader::read(ihex_reader::record_handle_type record_handler)
int _file_writer_callback(
boost::shared_ptr<std::ofstream> output_file,
unsigned char *buff,
- boost::uint16_t len
+ uint16_t len
) {
output_file->write((const char *) buff, len);
return 0;
@@ -213,9 +213,9 @@ void ihex_reader::to_bin_file(const std::string &bin_filename)
// We need a functor for the cast, a lambda would be perfect...
int _vector_writer_callback(
- std::vector<boost::uint8_t>& vector,
+ std::vector<uint8_t>& vector,
unsigned char *buff,
- boost::uint16_t len
+ uint16_t len
) {
for (size_t i = 0; i < len; i++) {
vector.push_back(buff[i]);
@@ -224,9 +224,9 @@ int _vector_writer_callback(
}
#define DEFAULT_SIZE_ESTIMATE 8000000
-std::vector<boost::uint8_t> ihex_reader::to_vector(const size_t size_estimate)
+std::vector<uint8_t> ihex_reader::to_vector(const size_t size_estimate)
{
- std::vector<boost::uint8_t> buf;
+ std::vector<uint8_t> buf;
buf.reserve(size_estimate == 0 ? DEFAULT_SIZE_ESTIMATE : size_estimate);
this->read(boost::bind(&_vector_writer_callback, boost::ref(buf), _3, _4));
diff --git a/host/lib/utils/ihex.hpp b/host/lib/utils/ihex.hpp
index 9df1fcbc3..8a8f84b15 100644
--- a/host/lib/utils/ihex.hpp
+++ b/host/lib/utils/ihex.hpp
@@ -20,7 +20,7 @@
#include <boost/bind.hpp>
#include <boost/function.hpp>
-#include <boost/cstdint.hpp>
+#include <stdint.h>
#include <string>
#include <vector>
@@ -30,7 +30,7 @@ class ihex_reader
{
public:
// Arguments are: lower address bits, upper address bits, buff, length
- typedef boost::function<int(boost::uint16_t,boost::uint16_t,unsigned char*,boost::uint16_t)> record_handle_type;
+ typedef boost::function<int(uint16_t,uint16_t,unsigned char*,uint16_t)> record_handle_type;
/*
* \param ihex_filename Path to the *.ihx file
@@ -67,7 +67,7 @@ public:
*
* \throws uhd::io_error if the HEX file is corrupted or unreadable.
*/
- std::vector<boost::uint8_t> to_vector(const size_t size_estimate = 0);
+ std::vector<uint8_t> to_vector(const size_t size_estimate = 0);
private:
const std::string _ihex_filename;
diff --git a/host/lib/utils/platform.cpp b/host/lib/utils/platform.cpp
index a9cef663b..30f3337ac 100644
--- a/host/lib/utils/platform.cpp
+++ b/host/lib/utils/platform.cpp
@@ -26,15 +26,15 @@
namespace uhd {
- boost::int32_t get_process_id() {
+ int32_t get_process_id() {
#ifdef UHD_PLATFORM_WIN32
- return boost::int32_t(GetCurrentProcessId());
+ return int32_t(GetCurrentProcessId());
#else
- return boost::int32_t(getpid());
+ return int32_t(getpid());
#endif
}
- boost::uint32_t get_host_id() {
+ uint32_t get_host_id() {
#ifdef UHD_PLATFORM_WIN32
//extract volume serial number
char szVolName[MAX_PATH+1], szFileSysName[MAX_PATH+1];
@@ -43,16 +43,16 @@ namespace uhd {
&dwSerialNumber, &dwMaxComponentLen,
&dwFileSysFlags, szFileSysName, sizeof(szFileSysName));
- return boost::uint32_t(dwSerialNumber);
+ return uint32_t(dwSerialNumber);
#else
- return boost::uint32_t(gethostid());
+ return uint32_t(gethostid());
#endif
}
- boost::uint32_t get_process_hash() {
+ uint32_t get_process_hash() {
size_t hash = 0;
boost::hash_combine(hash, uhd::get_process_id());
boost::hash_combine(hash, uhd::get_host_id());
- return boost::uint32_t(hash);
+ return uint32_t(hash);
}
}
diff --git a/host/lib/utils/tasks.cpp b/host/lib/utils/tasks.cpp
index 6dbca5fc9..1e8f50736 100644
--- a/host/lib/utils/tasks.cpp
+++ b/host/lib/utils/tasks.cpp
@@ -115,7 +115,7 @@ public:
* This might happen during shutdown when dtors are called.
* See also: comments in b200_io_impl->handle_async_task
*/
- msg_payload_t get_msg_from_dump_queue(boost::uint32_t sid)
+ msg_payload_t get_msg_from_dump_queue(uint32_t sid)
{
boost::mutex::scoped_lock lock(_mutex);
msg_payload_t b;