This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 74f3ff9624a8c9b54cf0bc224f7ccca30adb1d4b Author: Pavel Vazharov <[email protected]> AuthorDate: Thu May 30 10:49:18 2024 +0300 Fix unused parameters in tsutil (#11394) (cherry picked from commit c4a1eeb7da10b948798a0e2f5b6f3d4abaa5c2eb) --- include/tsutil/ts_unit_parser.h | 2 +- src/tsutil/DbgCtl.cc | 2 +- src/tsutil/YamlCfg.cc | 2 +- src/tsutil/unit_tests/test_PostScript.cc | 4 +++- src/tsutil/unit_tests/test_ts_meta.cc | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/tsutil/ts_unit_parser.h b/include/tsutil/ts_unit_parser.h index 610007a90a..29c15610c4 100644 --- a/include/tsutil/ts_unit_parser.h +++ b/include/tsutil/ts_unit_parser.h @@ -94,7 +94,7 @@ inline UnitParser::UnitParser(UnitParser::Units &&units, bool unit_required_p) n } inline UnitParser::self_type & -UnitParser::unit_required(bool flag) +UnitParser::unit_required([[maybe_unused]] bool flag) { _unit_required_p = false; return *this; diff --git a/src/tsutil/DbgCtl.cc b/src/tsutil/DbgCtl.cc index 164d2ceaa7..99f35a0b1a 100644 --- a/src/tsutil/DbgCtl.cc +++ b/src/tsutil/DbgCtl.cc @@ -338,7 +338,7 @@ struct DiagTimestamp { }; swoc::BufferWriter & -bwformat(swoc::BufferWriter &w, swoc::bwf::Spec const &spec, DiagTimestamp const &ts) +bwformat(swoc::BufferWriter &w, [[maybe_unused]] swoc::bwf::Spec const &spec, DiagTimestamp const &ts) { auto epoch = std::chrono::system_clock::to_time_t(ts.ts); swoc::LocalBufferWriter<48> lw; diff --git a/src/tsutil/YamlCfg.cc b/src/tsutil/YamlCfg.cc index 61c698e0de..2aa3a031f1 100644 --- a/src/tsutil/YamlCfg.cc +++ b/src/tsutil/YamlCfg.cc @@ -84,7 +84,7 @@ namespace Yaml namespace swoc { BufferWriter & -bwformat(BufferWriter &w, bwf::Spec const &spec, YAML::Mark const &mark) +bwformat(BufferWriter &w, [[maybe_unused]] bwf::Spec const &spec, YAML::Mark const &mark) { return w.print("Line {}", mark.line); } diff --git a/src/tsutil/unit_tests/test_PostScript.cc b/src/tsutil/unit_tests/test_PostScript.cc index 8f08119c28..a5abca2e1f 100644 --- a/src/tsutil/unit_tests/test_PostScript.cc +++ b/src/tsutil/unit_tests/test_PostScript.cc @@ -47,6 +47,8 @@ void f2(double a) { ++f2Called; + + REQUIRE(a == 4.0); } void @@ -65,7 +67,7 @@ TEST_CASE("PostScript", "[PSC]") { int *p = &dummy; ts::PostScript g1([&]() -> void { f1(1, 2.0, p, dummy); }); - ts::PostScript g2([=]() -> void { f2(4); }); + ts::PostScript g2([=]() -> void { f2(4.0); }); ts::PostScript g3([=]() -> void { f3(5, 6.0); }); g2.release(); diff --git a/src/tsutil/unit_tests/test_ts_meta.cc b/src/tsutil/unit_tests/test_ts_meta.cc index 96320aa42e..3203dfba4c 100644 --- a/src/tsutil/unit_tests/test_ts_meta.cc +++ b/src/tsutil/unit_tests/test_ts_meta.cc @@ -80,7 +80,7 @@ namespace { template <typename T> auto -detect(T &&t, ts::meta::CaseTag<0>) -> std::string_view +detect([[maybe_unused]] T &&t, ts::meta::CaseTag<0>) -> std::string_view { return "none"; }
