aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorAaron Rossetto <aaron.rossetto@ni.com>2021-01-13 10:24:01 -0600
committerAaron Rossetto <aaron.rossetto@ni.com>2021-01-21 12:47:54 -0600
commit7e2edf7057edc17b3991566ac5559dfde8966934 (patch)
treefcd88e561dfda45177cb78d7a6e769d183d320e1 /host/include
parent7b436148467559a967abffd7c8c2679c629194de (diff)
downloaduhd-7e2edf7057edc17b3991566ac5559dfde8966934.tar.gz
uhd-7e2edf7057edc17b3991566ac5559dfde8966934.tar.bz2
uhd-7e2edf7057edc17b3991566ac5559dfde8966934.zip
sim: Fix CHDR header stringification
Prior to Boost 1.66, boost::format() did not support the %b format specifier, yet the minimum version of Boost required to build UHD is Boost 1.58 (as specified in the CMakeLists.txt file). Rather than force an upgrade of Boost on everyone, this commit replaces the %b format specifiers with %c and provides 'Y' or 'N' values based on the Booleans in the CHDR header being printed (EOV and EOB).
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/rfnoc/chdr_types.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/host/include/uhd/rfnoc/chdr_types.hpp b/host/include/uhd/rfnoc/chdr_types.hpp
index 006aac708..fac0331e0 100644
--- a/host/include/uhd/rfnoc/chdr_types.hpp
+++ b/host/include/uhd/rfnoc/chdr_types.hpp
@@ -181,11 +181,12 @@ public: // Functions
// The static_casts are because vc and num_mdata are uint8_t -> unsigned char
// For some reason, despite the %u meaning unsigned int, boost still formats them
// as chars
- return str(boost::format("chdr_header{vc:%u, eob:%b, eov:%b, pkt_type:%u, "
+ return str(boost::format("chdr_header{vc:%u, eob:%c, eov:%c, pkt_type:%u, "
"num_mdata:%u, seq_num:%u, length:%u, dst_epid:%u}\n")
- % static_cast<uint16_t>(get_vc()) % get_eob() % get_eov()
- % get_pkt_type() % static_cast<uint16_t>(get_num_mdata())
- % get_seq_num() % get_length() % get_dst_epid());
+ % static_cast<uint16_t>(get_vc()) % (get_eob() ? 'Y' : 'N')
+ % (get_eov() ? 'Y' : 'N') % get_pkt_type()
+ % static_cast<uint16_t>(get_num_mdata()) % get_seq_num() % get_length()
+ % get_dst_epid());
}
private: