Skip to content

Commit

Permalink
[modules] update fmtlib to 1.2.1 to resolve build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtdkp committed Apr 11, 2024
1 parent 7c936cb commit d50b0b2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/app/cli/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(status)));
}
else
{
Expand Down Expand Up @@ -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<int>(status)));

if (CaseInsensitiveEqual(aExpr[1], "request"))
{
Expand Down
7 changes: 4 additions & 3 deletions src/app/cli/job_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(status)));

// review the network BRs connection modes that may require
// certain supported type of credentials
Expand Down Expand Up @@ -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<int>(status));
}

aConfig.mEnableCcm = isCCM;
Expand Down Expand Up @@ -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<int>(status)));
if (brs.size() == 1)
{
// looks like not much of a choice
Expand Down
5 changes: 3 additions & 2 deletions src/app/ps/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 2 additions & 4 deletions src/app/ps/registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@
#ifndef _REGISTRY_HPP_
#define _REGISTRY_HPP_

#include "persistent_storage.hpp"
#include "registry_entries.hpp"
#include "app/border_agent.hpp"

#include <vector>
#include "app/ps/persistent_storage.hpp"
#include "app/ps/registry_entries.hpp"

namespace ot {
namespace commissioner {
Expand Down
5 changes: 1 addition & 4 deletions src/library/coap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@

#include "library/coap.hpp"

#include <algorithm>

#include <ctype.h>
#include <memory.h>

#include "common/error_macros.hpp"
Expand Down Expand Up @@ -1343,7 +1340,7 @@ auto fmt::formatter<ot::commissioner::coap::OptionType>::format(ot::commissioner
name = "kSize1";
break;
default:
name = "unknown";
name = fmt::format(FMT_STRING("unknown({})"), static_cast<int>(optionType));
}
return formatter<string_view>::format(name, ctx);
}
2 changes: 1 addition & 1 deletion src/library/coap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ot::commissioner::coap::OptionType> : formatter<string_view>
{
auto format(ot::commissioner::coap::OptionType optionType, format_context &ctx) -> decltype(ctx.out());
Expand Down
3 changes: 2 additions & 1 deletion src/library/cose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(eckey->grp.id)));
}
SuccessOrExit(error = coseKey.Put(kKeyEC2Curve, ec2Curve));

Expand Down
4 changes: 2 additions & 2 deletions src/library/token_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ void TokenManager::SendTokenRequest(Commissioner::Handler<ByteArray> 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<int>(aResponse->GetCode())));
VerifyOrExit(aResponse->GetContentFormat(contentFormat) == ErrorCode::kNone,
error = ERROR_BAD_FORMAT("cannot find valid CoAP Content Format option"));
VerifyOrExit(
Expand Down
2 changes: 1 addition & 1 deletion third_party/fmtlib/repo
Submodule repo updated 143 files

0 comments on commit d50b0b2

Please sign in to comment.