From 876d4150aa3da531ddd687b48afada6e43f79146 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 2 Mar 2020 15:25:13 -0800 Subject: 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. --- host/lib/transport/nirio/nifpga_lvbitx.cpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'host/lib/transport/nirio/nifpga_lvbitx.cpp') 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 +#include #include -#include #include -#include -#include #include +#include +#include namespace uhd { namespace niusrprio { std::string nifpga_lvbitx::_get_bitstream_checksum(const std::string& file_path) { const std::regex md5_regex( - "([a-fA-F0-9]{32})<\\/BitstreamMD5>", - std::regex::icase); + "([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("") != std::string::npos && - std::regex_search(line, md5_match, md5_regex)) - { + if (line.find("") != 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 -- cgit v1.2.3