drm_hwcomposer: clang-tidy: enable cppcoreguidelines-* checks
Our code isn't ready for the following checks therefore keep disabled
-cppcoreguidelines-pro-bounds-array-to-pointer-decay
-cppcoreguidelines-pro-bounds-constant-array-index
-cppcoreguidelines-pro-bounds-pointer-arithmetic
-cppcoreguidelines-pro-type-cstyle-cast
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-avoid-magic-numbers
-cppcoreguidelines-macro-usage
-cppcoreguidelines-avoid-c-arrays
+ fixed existing tidy warnings for these checks.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
diff --git a/backend/Backend.cpp b/backend/Backend.cpp
index 15a9ff1..16e2859 100644
--- a/backend/Backend.cpp
+++ b/backend/Backend.cpp
@@ -63,7 +63,7 @@
size_t extra_client = (z_map.size() - client_size) - avail_planes;
if (extra_client > 0) {
int start = 0;
- size_t steps;
+ size_t steps = 0;
if (client_size != 0) {
size_t prepend = std::min((size_t)client_start, extra_client);
size_t append = std::min(z_map.size() - (client_start + client_size),
@@ -136,6 +136,7 @@
display->resource_manager()->ForcedScalingWithGpu());
}
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
REGISTER_BACKEND("generic", Backend);
} // namespace android
diff --git a/backend/BackendClient.cpp b/backend/BackendClient.cpp
index 033a35c..bef536a 100644
--- a/backend/BackendClient.cpp
+++ b/backend/BackendClient.cpp
@@ -30,6 +30,7 @@
return HWC2::Error::HasChanges;
}
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
REGISTER_BACKEND("client", BackendClient);
} // namespace android
diff --git a/backend/BackendRCarDu.cpp b/backend/BackendRCarDu.cpp
index e85fa71..6585406 100644
--- a/backend/BackendRCarDu.cpp
+++ b/backend/BackendRCarDu.cpp
@@ -40,6 +40,7 @@
return Backend::IsClientLayer(display, layer);
}
+// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
REGISTER_BACKEND("rcar-du", BackendRCarDu);
} // namespace android
\ No newline at end of file