aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/histogram/adaptive/block_histogram.cpp
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-05-20 12:16:11 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-05-20 12:33:16 +0300
commit73d783fe0b096861111e19b63fa2259296050916 (patch)
treea507f65155934186eab5aba8ecc3db09f21dbc83 /library/cpp/histogram/adaptive/block_histogram.cpp
parent46c0bf458366293d3fff860ead4d1a3a34272df6 (diff)
downloadydb-73d783fe0b096861111e19b63fa2259296050916.tar.gz
Switch to std::format to fix -Wformat
e2d3a54377ea6268a39c35989c259720c10edefa
Diffstat (limited to 'library/cpp/histogram/adaptive/block_histogram.cpp')
-rw-r--r--library/cpp/histogram/adaptive/block_histogram.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/library/cpp/histogram/adaptive/block_histogram.cpp b/library/cpp/histogram/adaptive/block_histogram.cpp
index 55337488ac..ff0383761f 100644
--- a/library/cpp/histogram/adaptive/block_histogram.cpp
+++ b/library/cpp/histogram/adaptive/block_histogram.cpp
@@ -10,6 +10,8 @@
#include <util/generic/ymath.h>
#include <util/string/printf.h>
+#include <format>
+
namespace {
struct TEmpty {
};
@@ -138,7 +140,10 @@ namespace NKiwiAggr {
void TBlockHistogram::Merge(const THistogram& histo, double multiplier) {
if (!IsValidFloat(histo.GetMinValue()) || !IsValidFloat(histo.GetMaxValue())) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad histo with minvalue %f maxvalue %f\n", Id, histo.GetMinValue(), histo.GetMaxValue());
+ Cerr << std::format(
+ "Merging in histogram id {}: skip bad histo with minvalue {} maxvalue {}\n",
+ Id, histo.GetMinValue(), histo.GetMaxValue()
+ );
return;
}
if (histo.FreqSize() == 0) {
@@ -154,7 +159,10 @@ namespace NKiwiAggr {
double value = histo.GetPosition(j);
double weight = histo.GetFreq(j);
if (!IsValidFloat(value) || !IsValidFloat(weight)) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
+ Cerr << std::format(
+ "Merging in histogram id {}: skip bad value {} weight {}\n",
+ Id, value, weight
+ );
continue;
}
Add(value, weight * multiplier);
@@ -167,7 +175,10 @@ namespace NKiwiAggr {
for (size_t j = 0; j < histo.FreqSize(); ++j) {
double weight = histo.GetFreq(j);
if (!IsValidFloat(pos) || !IsValidFloat(weight)) {
- fprintf(stderr, "Merging in histogram id %lu: skip bad value %f weight %f\n", Id, pos, weight);
+ Cerr << std::format(
+ "Merging in histogram id {}: skip bad value {} weight {}\n",
+ Id, pos, weight
+ );
pos += histo.GetBinRange();
continue;
}
@@ -229,7 +240,10 @@ namespace NKiwiAggr {
double value = histo.GetPosition(i);
double weight = histo.GetFreq(i);
if (!IsValidFloat(value) || !IsValidFloat(weight)) {
- fprintf(stderr, "FromProto in histogram id %lu: skip bad value %f weight %f\n", Id, value, weight);
+ Cerr << std::format(
+ "FromProto in histogram id {}: skip bad value {} weight {}\n",
+ Id, value, weight
+ );
continue;
}
Bins[i].first = value;