diff --git a/src/app/cli/interpreter.cpp b/src/app/cli/interpreter.cpp index 613b2208a..dc5ccf928 100644 --- a/src/app/cli/interpreter.cpp +++ b/src/app/cli/interpreter.cpp @@ -654,7 +654,7 @@ Interpreter::Value Interpreter::ValidateMultiNetworkSyntax(const Expression &aEx error = status == RegistryStatus::kNotFound ? ERROR_REGISTRY_ERROR("domain '{}' not found", mContext.mDomAliases[0]) : ERROR_REGISTRY_ERROR("domain '{}' failed to resolve with status={}", - mContext.mDomAliases.front(), status)); + mContext.mDomAliases.front(), static_cast(status))); } else { @@ -1034,7 +1034,7 @@ Interpreter::Value Interpreter::ProcessToken(const Expression &aExpr) SuccessOrExit(value = mJobManager->GetSelectedCommissioner(commissioner)); VerifyOrExit(aExpr.size() >= 2, value = ERROR_INVALID_ARGS(SYNTAX_FEW_ARGS)); VerifyOrExit((status = mRegistry->GetCurrentNetwork(curNwk)) == RegistryStatus::kSuccess, - value = ERROR_REGISTRY_ERROR(RUNTIME_CUR_NETWORK_FAILED " with status={}", status)); + value = ERROR_REGISTRY_ERROR(RUNTIME_CUR_NETWORK_FAILED " with status={}", static_cast(status))); if (CaseInsensitiveEqual(aExpr[1], "request")) { diff --git a/src/app/cli/job_manager.cpp b/src/app/cli/job_manager.cpp index 345920c85..321851b49 100644 --- a/src/app/cli/job_manager.cpp +++ b/src/app/cli/job_manager.cpp @@ -277,7 +277,7 @@ Error JobManager::PrepareDtlsConfig(const XpanId aNid, Config &aConfig) RegistryStatus status = mInterpreter.mRegistry->GetBorderRoutersInNetwork(aNid, brs); VerifyOrExit(status == RegistryStatus::kSuccess, - error = ERROR_REGISTRY_ERROR("br lookup failed with status={}", status)); + error = ERROR_REGISTRY_ERROR("br lookup failed with status={}", static_cast(status))); // review the network BRs connection modes that may require // certain supported type of credentials @@ -308,7 +308,8 @@ Error JobManager::PrepareDtlsConfig(const XpanId aNid, Config &aConfig) status = mInterpreter.mRegistry->GetDomainNameByXpan(aNid, domainName); if (status != RegistryStatus::kSuccess) { - LOG_DEBUG(LOG_REGION_JOB_MANAGER, "{}: domain resolution failed with status={}", XpanId(aNid).str(), status); + LOG_DEBUG(LOG_REGION_JOB_MANAGER, "{}: domain resolution failed with status={}", XpanId(aNid).str(), + static_cast(status)); } aConfig.mEnableCcm = isCCM; @@ -423,7 +424,7 @@ Error JobManager::MakeBorderRouterChoice(const XpanId aNid, BorderRouter &br) RegistryStatus status = mInterpreter.mRegistry->GetBorderRoutersInNetwork(aNid, brs); VerifyOrExit(status == RegistryStatus::kSuccess, - error = ERROR_REGISTRY_ERROR("br lookup failed with status={}", status)); + error = ERROR_REGISTRY_ERROR("br lookup failed with status={}", static_cast(status))); if (brs.size() == 1) { // looks like not much of a choice diff --git a/src/app/ps/registry.cpp b/src/app/ps/registry.cpp index 917ae4677..280b7ecc9 100644 --- a/src/app/ps/registry.cpp +++ b/src/app/ps/registry.cpp @@ -31,8 +31,9 @@ * The file implements JSON-based Thread networks/domains registry. */ -#include "registry.hpp" -#include "persistent_storage_json.hpp" +#include "app/ps/registry.hpp" + +#include "app/ps/persistent_storage_json.hpp" #include "common/error_macros.hpp" #include "common/utils.hpp" diff --git a/src/app/ps/registry.hpp b/src/app/ps/registry.hpp index 8f1d4b30e..cd04cd420 100644 --- a/src/app/ps/registry.hpp +++ b/src/app/ps/registry.hpp @@ -34,11 +34,9 @@ #ifndef _REGISTRY_HPP_ #define _REGISTRY_HPP_ -#include "persistent_storage.hpp" -#include "registry_entries.hpp" #include "app/border_agent.hpp" - -#include +#include "app/ps/persistent_storage.hpp" +#include "app/ps/registry_entries.hpp" namespace ot { namespace commissioner { diff --git a/src/library/coap.cpp b/src/library/coap.cpp index d11785596..c7a067bbb 100644 --- a/src/library/coap.cpp +++ b/src/library/coap.cpp @@ -33,9 +33,6 @@ #include "library/coap.hpp" -#include - -#include #include #include "common/error_macros.hpp" @@ -1343,7 +1340,7 @@ auto fmt::formatter::format(ot::commissioner name = "kSize1"; break; default: - name = "unknown"; + name = fmt::format(FMT_STRING("unknown({})"), static_cast(optionType)); } return formatter::format(name, ctx); } diff --git a/src/library/coap.hpp b/src/library/coap.hpp index b8f60034d..22adcdaba 100644 --- a/src/library/coap.hpp +++ b/src/library/coap.hpp @@ -783,7 +783,7 @@ class Coap } // namespace ot -/** Makes `OptionType` formattable as a string. */ +/** Makes `coap::OptionType` formattable as a string. */ template <> struct fmt::formatter : formatter { auto format(ot::commissioner::coap::OptionType optionType, format_context &ctx) -> decltype(ctx.out()); diff --git a/src/library/cose.cpp b/src/library/cose.cpp index 946df8140..e9c1931af 100644 --- a/src/library/cose.cpp +++ b/src/library/cose.cpp @@ -310,7 +310,8 @@ Error MakeCoseKey(ByteArray &aEncodedCoseKey, const mbedtls_pk_context &aKey, co ec2Curve = kKeyEC2CurveP521; break; default: - ExitNow(error = ERROR_INVALID_ARGS("make COSE key with invalid EC2 curve group ID {}", eckey->grp.id)); + ExitNow(error = ERROR_INVALID_ARGS("make COSE key with invalid EC2 curve group ID {}", + static_cast(eckey->grp.id))); } SuccessOrExit(error = coseKey.Put(kKeyEC2Curve, ec2Curve)); diff --git a/src/library/token_manager.cpp b/src/library/token_manager.cpp index 2ee7e6dae..8c39a8d2f 100644 --- a/src/library/token_manager.cpp +++ b/src/library/token_manager.cpp @@ -177,8 +177,8 @@ void TokenManager::SendTokenRequest(Commissioner::Handler aHandler) VerifyOrDie(aResponse != nullptr); VerifyOrExit(aResponse->GetCode() == coap::Code::kChanged, - error = - ERROR_BAD_FORMAT("expect response code as CoAP::CHANGED, but got {}", aResponse->GetCode())); + error = ERROR_BAD_FORMAT("expect response code as CoAP::CHANGED, but got {}", + static_cast(aResponse->GetCode()))); VerifyOrExit(aResponse->GetContentFormat(contentFormat) == ErrorCode::kNone, error = ERROR_BAD_FORMAT("cannot find valid CoAP Content Format option")); VerifyOrExit( diff --git a/third_party/fmtlib/repo b/third_party/fmtlib/repo index cef1e4354..e69e5f977 160000 --- a/third_party/fmtlib/repo +++ b/third_party/fmtlib/repo @@ -1 +1 @@ -Subproject commit cef1e4354bd95f72f2a874cca867fbca44980c66 +Subproject commit e69e5f977d458f2650bb346dadf2ad30c5320281