aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Long <willcode4@gmail.com>2024-03-10 19:13:15 -0400
committerJeff Long <willcode4@gmail.com>2024-03-26 16:03:49 -0400
commit7d2ba75b834a2e7164f031f295a5e30d97a69155 (patch)
treeccb6bb14340be3f22655c8f796ced29f1581a811
parentruntime: print block names on message buffer overflow discard (diff)
downloadgnuradio-7d2ba75b834a2e7164f031f295a5e30d97a69155.tar.xz
gnuradio-7d2ba75b834a2e7164f031f295a5e30d97a69155.zip
fec/polar decoder: replaced cout/printf with fmt::print
Standardized the use of fmt::prin insetead printf and cout Signed-off-by: SATYA PRAKASH SASINI <satyasasini.39@gmail.com> (cherry picked from commit 2ccb54a33fe5745babcb0f00fdca2aab191402c9) Signed-off-by: Jeff Long <willcode4@gmail.com>
-rw-r--r--gr-fec/lib/polar_decoder_common.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/gr-fec/lib/polar_decoder_common.cc b/gr-fec/lib/polar_decoder_common.cc
index 5fe5fc403..ecc67b679 100644
--- a/gr-fec/lib/polar_decoder_common.cc
+++ b/gr-fec/lib/polar_decoder_common.cc
@@ -16,8 +16,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
-#include <cstdio>
-#include <iostream>
+#include <spdlog/fmt/fmt.h>
namespace gr {
namespace fec {
@@ -167,12 +166,11 @@ void polar_decoder_common::extract_info_bits(unsigned char* output,
void polar_decoder_common::print_pretty_llr_vector(const float* llr_vec) const
{
for (int row = 0; row < block_size(); row++) {
- // FIXME this is an interesting mixture of iostream and stdio
- std::cout << row << "->" << int(bit_reverse(row, block_power())) << ":\t";
+ fmt::print("{}->{}:\t", row, static_cast<int>(bit_reverse(row, block_power())));
for (int stage = 0; stage < block_power() + 1; stage++) {
- printf("%+4.2f, ", llr_vec[(stage * block_size()) + row]);
+ fmt::print("{:+4.2f}, ", llr_vec[(stage * block_size()) + row]);
}
- std::cout << std::endl;
+ fmt::print("{}\n", "");
}
}