diff options
author | Tri Pho <tripho@google.com> | 2022-09-13 16:36:40 +0000 |
---|---|---|
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-13 16:36:40 +0000 |
commit | 99fb0e76c2c939dd04c6ddf166852588939c38a9 (patch) | |
tree | e712c330793a71886260a2ca91d592bac6e48cf6 /pw_software_update/update_bundle_accessor.cc | |
parent | 7268723116f5d2e0d4b7a194315906b8af97e223 (diff) | |
download | pigweed-99fb0e76c2c939dd04c6ddf166852588939c38a9.tar.gz |
pw_software_update: Fix some compiler warnings
Tested: Downstream project builds.
Change-Id: Ie6ac4e934149f1a33cf5ee373f472c63e3e7de97
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/110118
Reviewed-by: Fateh Singh <fsingh@google.com>
Commit-Queue: Fateh Singh <fsingh@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
Diffstat (limited to 'pw_software_update/update_bundle_accessor.cc')
-rw-r--r-- | pw_software_update/update_bundle_accessor.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pw_software_update/update_bundle_accessor.cc b/pw_software_update/update_bundle_accessor.cc index fdcb8326c..e134fb6a1 100644 --- a/pw_software_update/update_bundle_accessor.cc +++ b/pw_software_update/update_bundle_accessor.cc @@ -167,7 +167,7 @@ Status VerifyMetadataSignatures(protobuf::Bytes message, } PW_LOG_ERROR("Insufficient signatures. Requires at least %u, verified %zu", - threshold.value(), + static_cast<unsigned>(threshold.value()), verified_count); return Status::Unauthenticated(); } @@ -494,8 +494,8 @@ Status UpdateBundleAccessor::UpgradeRoot() { if (trusted_root_version.value() > new_root_version.value()) { PW_LOG_ERROR("Root attempts to rollback from %u to %u", - trusted_root_version.value(), - new_root_version.value()); + static_cast<unsigned>(trusted_root_version.value()), + static_cast<unsigned>(new_root_version.value())); return Status::Unauthenticated(); } @@ -630,8 +630,8 @@ Status UpdateBundleAccessor::VerifyTargetsMetadata() { PW_TRY(new_version.status()); if (current_version.value() > new_version.value()) { PW_LOG_ERROR("Blocking Targets metadata rollback from %u to %u", - current_version.value(), - new_version.value()); + static_cast<unsigned>(current_version.value()), + static_cast<unsigned>(new_version.value())); return Status::Unauthenticated(); } @@ -725,8 +725,8 @@ Status UpdateBundleAccessor::VerifyTargetPayload( // TODO(alizhang): Add unit tests for all failure conditions. Status UpdateBundleAccessor::VerifyOutOfBundleTargetPayload( std::string_view target_name, - protobuf::Uint64 expected_length, - protobuf::Bytes expected_sha256) { + [[maybe_unused]] protobuf::Uint64 expected_length, + [[maybe_unused]] protobuf::Bytes expected_sha256) { #if PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION // The target payload is "personalized out". We we can't take a measurement // without backend help. For now we will check against the device manifest @@ -782,7 +782,7 @@ Status UpdateBundleAccessor::VerifyOutOfBundleTargetPayload( return OkStatus(); #else - PW_LOG_ERROR("Target file %s not found in bundle", target_name); + PW_LOG_ERROR("Target file %s not found in bundle", target_name.data()); return Status::Unauthenticated(); #endif // PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION } |