Loading cmds/atrace/atrace.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -481,8 +481,8 @@ static bool setClock() newClock = "global"; } size_t begin = clockStr.find("[") + 1; size_t end = clockStr.find("]"); size_t begin = clockStr.find('[') + 1; size_t end = clockStr.find(']'); if (newClock.compare(0, std::string::npos, clockStr, begin, end-begin) == 0) { return true; } Loading Loading @@ -543,7 +543,7 @@ static void pokeHalServices() auto listRet = sm->list([&](const auto &interfaces) { for (size_t i = 0; i < interfaces.size(); i++) { string fqInstanceName = interfaces[i]; string::size_type n = fqInstanceName.find("/"); string::size_type n = fqInstanceName.find('/'); if (n == std::string::npos || interfaces[i].size() == n+1) continue; hidl_string fqInterfaceName = fqInstanceName.substr(0, n); Loading cmds/dumpstate/dumpstate.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -691,7 +691,7 @@ bool Dumpstate::AddZipEntryFromFd(const std::string& entry_name, int fd) { std::string valid_name = entry_name; // Rename extension if necessary. size_t idx = entry_name.rfind("."); size_t idx = entry_name.rfind('.'); if (idx != std::string::npos) { std::string extension = entry_name.substr(idx); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); Loading Loading @@ -1432,7 +1432,7 @@ bool Dumpstate::FinishZipFile() { return true; } static std::string SHA256_file_hash(std::string filepath) { static std::string SHA256_file_hash(const std::string& filepath) { android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(filepath.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC | O_NOFOLLOW))); if (fd == -1) { Loading cmds/dumpsys/dumpsys.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ int Dumpsys::main(int argc, char* const argv[]) { } for (size_t i = 0; i < N; i++) { String16 service_name = std::move(services[i]); const String16& service_name = std::move(services[i]); if (IsSkipped(skippedServices, service_name)) continue; sp<IBinder> service = sm_->checkService(service_name); Loading cmds/dumpsys/tests/dumpsys_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ MATCHER_P(AndroidElementsAre, expected, "") { } int i = 0; std::ostringstream actual_stream, expected_stream; for (String16 actual : arg) { for (const String16& actual : arg) { std::string actual_str = String8(actual).c_str(); std::string expected_str = expected[i]; actual_stream << "'" << actual_str << "' "; Loading cmds/installd/CacheTracker.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ void CacheTracker::loadStats() { ATRACE_BEGIN("loadStats tree"); cacheUsed = 0; for (auto path : mDataPaths) { for (const auto& path : mDataPaths) { auto cachePath = read_path_inode(path, "cache", kXattrInodeCache); auto codeCachePath = read_path_inode(path, "code_cache", kXattrInodeCodeCache); calculate_tree_size(cachePath, &cacheUsed); Loading Loading @@ -170,7 +170,7 @@ void CacheTracker::loadItems() { items.clear(); ATRACE_BEGIN("loadItems"); for (auto path : mDataPaths) { for (const auto& path : mDataPaths) { loadItemsFrom(read_path_inode(path, "cache", kXattrInodeCache)); loadItemsFrom(read_path_inode(path, "code_cache", kXattrInodeCodeCache)); } Loading Loading
cmds/atrace/atrace.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -481,8 +481,8 @@ static bool setClock() newClock = "global"; } size_t begin = clockStr.find("[") + 1; size_t end = clockStr.find("]"); size_t begin = clockStr.find('[') + 1; size_t end = clockStr.find(']'); if (newClock.compare(0, std::string::npos, clockStr, begin, end-begin) == 0) { return true; } Loading Loading @@ -543,7 +543,7 @@ static void pokeHalServices() auto listRet = sm->list([&](const auto &interfaces) { for (size_t i = 0; i < interfaces.size(); i++) { string fqInstanceName = interfaces[i]; string::size_type n = fqInstanceName.find("/"); string::size_type n = fqInstanceName.find('/'); if (n == std::string::npos || interfaces[i].size() == n+1) continue; hidl_string fqInterfaceName = fqInstanceName.substr(0, n); Loading
cmds/dumpstate/dumpstate.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -691,7 +691,7 @@ bool Dumpstate::AddZipEntryFromFd(const std::string& entry_name, int fd) { std::string valid_name = entry_name; // Rename extension if necessary. size_t idx = entry_name.rfind("."); size_t idx = entry_name.rfind('.'); if (idx != std::string::npos) { std::string extension = entry_name.substr(idx); std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); Loading Loading @@ -1432,7 +1432,7 @@ bool Dumpstate::FinishZipFile() { return true; } static std::string SHA256_file_hash(std::string filepath) { static std::string SHA256_file_hash(const std::string& filepath) { android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(filepath.c_str(), O_RDONLY | O_NONBLOCK | O_CLOEXEC | O_NOFOLLOW))); if (fd == -1) { Loading
cmds/dumpsys/dumpsys.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ int Dumpsys::main(int argc, char* const argv[]) { } for (size_t i = 0; i < N; i++) { String16 service_name = std::move(services[i]); const String16& service_name = std::move(services[i]); if (IsSkipped(skippedServices, service_name)) continue; sp<IBinder> service = sm_->checkService(service_name); Loading
cmds/dumpsys/tests/dumpsys_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ MATCHER_P(AndroidElementsAre, expected, "") { } int i = 0; std::ostringstream actual_stream, expected_stream; for (String16 actual : arg) { for (const String16& actual : arg) { std::string actual_str = String8(actual).c_str(); std::string expected_str = expected[i]; actual_stream << "'" << actual_str << "' "; Loading
cmds/installd/CacheTracker.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ void CacheTracker::loadStats() { ATRACE_BEGIN("loadStats tree"); cacheUsed = 0; for (auto path : mDataPaths) { for (const auto& path : mDataPaths) { auto cachePath = read_path_inode(path, "cache", kXattrInodeCache); auto codeCachePath = read_path_inode(path, "code_cache", kXattrInodeCodeCache); calculate_tree_size(cachePath, &cacheUsed); Loading Loading @@ -170,7 +170,7 @@ void CacheTracker::loadItems() { items.clear(); ATRACE_BEGIN("loadItems"); for (auto path : mDataPaths) { for (const auto& path : mDataPaths) { loadItemsFrom(read_path_inode(path, "cache", kXattrInodeCache)); loadItemsFrom(read_path_inode(path, "code_cache", kXattrInodeCodeCache)); } Loading