update_engine: Use portable string format functions.
Replace usage of %zu by PRIuS or calls to std::to_string when possible.
This patch includes other minor linter fixes.
BUG=None
TEST=emerge-link update_engine
Change-Id: I9ff2b3677ed4218a140f9e91a2389cc756941b03
Reviewed-on: https://chromium-review.googlesource.com/293629
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/p2p_manager.cc b/p2p_manager.cc
index daebe91..9b6a659 100644
--- a/p2p_manager.cc
+++ b/p2p_manager.cc
@@ -30,6 +30,7 @@
#include <base/bind.h>
#include <base/files/file_enumerator.h>
#include <base/files/file_path.h>
+#include <base/format_macros.h>
#include <base/logging.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
@@ -90,7 +91,7 @@
vector<string> args;
args.push_back("p2p-client");
args.push_back(string("--get-url=") + file_id);
- args.push_back(StringPrintf("--minimum-size=%zu", minimum_size));
+ args.push_back(StringPrintf("--minimum-size=%" PRIuS, minimum_size));
return args;
}
@@ -553,7 +554,7 @@
}
}
- string decimal_size = StringPrintf("%zu", expected_size);
+ string decimal_size = std::to_string(expected_size);
if (fsetxattr(fd, kCrosP2PFileSizeXAttrName,
decimal_size.c_str(), decimal_size.size(), 0) != 0) {
PLOG(ERROR) << "Error setting xattr " << path.value();