diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-03-02 15:25:13 -0800 |
---|---|---|
committer | atrnati <54334261+atrnati@users.noreply.github.com> | 2020-03-03 08:51:32 -0600 |
commit | 876d4150aa3da531ddd687b48afada6e43f79146 (patch) | |
tree | fd72a71419f4cd800d4e500cfcaded4dfc8dc367 /host/lib/transport/nirio/nifpga_lvbitx.cpp | |
parent | 1393553d623bdf4ba40d5435c9719b6ce990d9ac (diff) | |
download | uhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.gz uhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.bz2 uhd-876d4150aa3da531ddd687b48afada6e43f79146.zip |
uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
Diffstat (limited to 'host/lib/transport/nirio/nifpga_lvbitx.cpp')
-rw-r--r-- | host/lib/transport/nirio/nifpga_lvbitx.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/host/lib/transport/nirio/nifpga_lvbitx.cpp b/host/lib/transport/nirio/nifpga_lvbitx.cpp index 015344710..ed7c3f852 100644 --- a/host/lib/transport/nirio/nifpga_lvbitx.cpp +++ b/host/lib/transport/nirio/nifpga_lvbitx.cpp @@ -6,20 +6,19 @@ // #include <uhd/transport/nirio/nifpga_lvbitx.h> +#include <boost/algorithm/string.hpp> #include <cstdlib> -#include <string> #include <fstream> -#include <streambuf> -#include <boost/algorithm/string.hpp> #include <regex> +#include <streambuf> +#include <string> namespace uhd { namespace niusrprio { std::string nifpga_lvbitx::_get_bitstream_checksum(const std::string& file_path) { const std::regex md5_regex( - "<BitstreamMD5>([a-fA-F0-9]{32})<\\/BitstreamMD5>", - std::regex::icase); + "<BitstreamMD5>([a-fA-F0-9]{32})<\\/BitstreamMD5>", std::regex::icase); std::ifstream lvbitx_stream(file_path.c_str()); if (!lvbitx_stream.is_open()) { @@ -27,25 +26,21 @@ std::string nifpga_lvbitx::_get_bitstream_checksum(const std::string& file_path) } std::string checksum, line; - while (std::getline(lvbitx_stream, line)) - { + while (std::getline(lvbitx_stream, line)) { try { // short-circuiting the regex search with a simple find is faster // for cases where the tag doesn't exist std::smatch md5_match; - if (line.find("<BitstreamMD5>") != std::string::npos && - std::regex_search(line, md5_match, md5_regex)) - { + if (line.find("<BitstreamMD5>") != std::string::npos + && std::regex_search(line, md5_match, md5_regex)) { checksum = std::string(md5_match[1].first, md5_match[1].second); break; } - } - catch (boost::exception&) { - + } catch (boost::exception&) { } } boost::to_upper(checksum); return checksum; } -}} +}} // namespace uhd::niusrprio |