Fix a number of clang-tidy warnings
No functional changes. There are still plenty of atoi() warnings,
but most of those should go away as we convert all remaining
commands to binder.
Test: atest netd_integration_test netd_utils_test netd_integration_test
Change-Id: I15d6fd9523debf996dec9d0b3c3d7c11ae6444f3
diff --git a/server/TcpSocketMonitor.cpp b/server/TcpSocketMonitor.cpp
index 3e620b1..9439d77 100644
--- a/server/TcpSocketMonitor.cpp
+++ b/server/TcpSocketMonitor.cpp
@@ -16,7 +16,8 @@
#define LOG_TAG "TcpSocketMonitor"
-#include <iomanip>
+#include <chrono>
+#include <cinttypes>
#include <thread>
#include <vector>
@@ -110,7 +111,7 @@
if (!mNetworkStats.empty()) {
dw.blankline();
dw.println("Network stats:");
- for (const auto& stats : mNetworkStats) {
+ for (const std::pair<uint32_t, TcpStats>& stats : mNetworkStats) {
if (stats.second.nSockets == 0) {
continue;
}
@@ -126,9 +127,9 @@
if (!mSocketEntries.empty()) {
dw.blankline();
dw.println("Socket entries:");
- for (const auto& stats : mSocketEntries) {
- dw.println("netId=%u uid=%u cookie=%llu",
- stats.second.mark.netId, stats.second.uid, (unsigned long long) stats.first);
+ for (const std::pair<uint64_t, SocketEntry>& stats : mSocketEntries) {
+ dw.println("netId=%u uid=%u cookie=%" PRIu64, stats.second.mark.netId, stats.second.uid,
+ stats.first);
}
}