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/bufferinfo/legacy/BufferInfoLibdrm.cpp b/bufferinfo/legacy/BufferInfoLibdrm.cpp
index 1634f8a..1953e36 100644
--- a/bufferinfo/legacy/BufferInfoLibdrm.cpp
+++ b/bufferinfo/legacy/BufferInfoLibdrm.cpp
@@ -84,9 +84,9 @@
bool BufferInfoLibdrm::GetYuvPlaneInfo(int num_fds, buffer_handle_t handle,
hwc_drm_bo_t *bo) {
- struct android_ycbcr ycbcr;
- enum chroma_order chroma_order;
- int ret;
+ struct android_ycbcr ycbcr {};
+ enum chroma_order chroma_order {};
+ int ret = 0;
if (!gralloc_->lock_ycbcr) {
static std::once_flag once;
diff --git a/bufferinfo/legacy/BufferInfoMaliHisi.cpp b/bufferinfo/legacy/BufferInfoMaliHisi.cpp
index 559cb5c..ddb12ab 100644
--- a/bufferinfo/legacy/BufferInfoMaliHisi.cpp
+++ b/bufferinfo/legacy/BufferInfoMaliHisi.cpp
@@ -68,9 +68,9 @@
int BufferInfoMaliHisi::ConvertBoInfo(buffer_handle_t handle,
hwc_drm_bo_t *bo) {
- bool is_rgb;
+ bool is_rgb = false;
- auto const *hnd = reinterpret_cast<private_handle_t const *>(handle);
+ auto *hnd = (private_handle_t const *)handle;
if (!hnd)
return -EINVAL;
diff --git a/bufferinfo/legacy/BufferInfoMaliMediatek.cpp b/bufferinfo/legacy/BufferInfoMaliMediatek.cpp
index 13c7a34..f6e0ac5 100644
--- a/bufferinfo/legacy/BufferInfoMaliMediatek.cpp
+++ b/bufferinfo/legacy/BufferInfoMaliMediatek.cpp
@@ -34,7 +34,7 @@
int BufferInfoMaliMediatek::ConvertBoInfo(buffer_handle_t handle,
hwc_drm_bo_t *bo) {
- auto const *hnd = reinterpret_cast<private_handle_t const *>(handle);
+ auto *hnd = (private_handle_t const *)handle;
if (!hnd)
return -EINVAL;
diff --git a/bufferinfo/legacy/BufferInfoMaliMeson.cpp b/bufferinfo/legacy/BufferInfoMaliMeson.cpp
index 1dfe4d2..ad10203 100644
--- a/bufferinfo/legacy/BufferInfoMaliMeson.cpp
+++ b/bufferinfo/legacy/BufferInfoMaliMeson.cpp
@@ -63,7 +63,7 @@
int BufferInfoMaliMeson::ConvertBoInfo(buffer_handle_t handle,
hwc_drm_bo_t *bo) {
- auto const *hnd = reinterpret_cast<private_handle_t const *>(handle);
+ auto *hnd = (private_handle_t const *)handle;
if (!hnd)
return -EINVAL;