summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yurii Zubrytskyi <zyy@google.com> 2020-04-22 15:46:21 -0700
committer Yurii Zubrytskyi <zyy@google.com> 2020-04-22 22:34:24 -0700
commit510037b064fd5a9bc4f9c6516b55c1787709c62d (patch)
tree4af8d3173001d97f67314642e0b86862e041bd7f
parent1e52a093ae88a972be0a61863c9d21c75d006095 (diff)
[cleanup] Enable clang-tidy and fix warnings
Moving out of a const variable doesn't really work, apparently Bug: 153704006 Test: builds & boots Change-Id: Id7322f7045c08a20d72dda50808c0be427064cdd
-rw-r--r--services/incremental/Android.bp15
-rw-r--r--services/incremental/IncrementalService.cpp2
-rw-r--r--services/incremental/ServiceWrappers.cpp2
3 files changed, 17 insertions, 2 deletions
diff --git a/services/incremental/Android.bp b/services/incremental/Android.bp
index b8bd3b4a4563..de639c5d0760 100644
--- a/services/incremental/Android.bp
+++ b/services/incremental/Android.bp
@@ -19,6 +19,21 @@ cc_defaults {
proto: {
type: "lite",
},
+ tidy: true,
+ tidy_checks: [
+ "android-*",
+ "cert-*",
+ "clang-analyzer-security*",
+ "-cert-err34-c",
+ "clang-analyzer-security*",
+ // Disabling due to many unavoidable warnings from POSIX API usage.
+ "-google-runtime-int",
+ "-google-explicit-constructor",
+ // do not define variadic C function - JNI headers
+ "-cert-dcl50-cpp",
+ // operator=() does not handle self-assignment properly - all protobuf-generated classes
+ "-cert-oop54-cpp",
+ ],
}
cc_defaults {
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index dc05cb69d4c5..a6c45cc6c26f 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -1395,7 +1395,7 @@ bool IncrementalService::configureNativeBinaries(StorageId storage, std::string_
auto startFileTs = Clock::now();
const auto libName = path::basename(fileName);
- const auto targetLibPath = path::join(libDirRelativePath, libName);
+ auto targetLibPath = path::join(libDirRelativePath, libName);
const auto targetLibPathAbsolute = normalizePathToStorage(*ifs, storage, targetLibPath);
// If the extract file already exists, skip
if (access(targetLibPathAbsolute.c_str(), F_OK) == 0) {
diff --git a/services/incremental/ServiceWrappers.cpp b/services/incremental/ServiceWrappers.cpp
index 32aa849c03b9..1e8c3a1f814b 100644
--- a/services/incremental/ServiceWrappers.cpp
+++ b/services/incremental/ServiceWrappers.cpp
@@ -36,7 +36,7 @@ static constexpr auto kDataLoaderManagerName = "dataloader_manager"sv;
class RealVoldService : public VoldServiceWrapper {
public:
- RealVoldService(const sp<os::IVold> vold) : mInterface(std::move(vold)) {}
+ RealVoldService(sp<os::IVold> vold) : mInterface(std::move(vold)) {}
~RealVoldService() = default;
binder::Status mountIncFs(
const std::string& backingPath, const std::string& targetDir, int32_t flags,