Use -Werror in frameworks/native/services/vr
* Fix/remove unused variables, parameters, functions.
* Add missing typedef name.
* Suppress warning of unused return value from release().
* Suppress warnings that are fixed in goog/master, to be exported to AOSP.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If6b539db0a243b44fc6d51d90259f6564f306f6d
diff --git a/services/vr/virtual_touchpad/Android.bp b/services/vr/virtual_touchpad/Android.bp
index 6b11ce3..7196b2b 100644
--- a/services/vr/virtual_touchpad/Android.bp
+++ b/services/vr/virtual_touchpad/Android.bp
@@ -23,7 +23,11 @@
shared_libs: shared_libs,
header_libs: header_libraries,
cppflags: ["-std=c++11"],
- cflags: ["-DLOG_TAG=\"VrVirtualTouchpad\""],
+ cflags: [
+ "-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-Wall",
+ "-Werror",
+ ],
name: "libvirtualtouchpad",
tags: ["optional"],
}
@@ -44,6 +48,10 @@
srcs: test_src_files,
static_libs: test_static_libs,
header_libs: header_libraries,
+ cflags = [
+ "-Wall",
+ "-Werror",
+ ],
cppflags = [
"-std=c++11",
],
@@ -83,6 +91,8 @@
cppflags: ["-std=c++11"],
cflags: [
"-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-Wall",
+ "-Werror",
],
host_ldlibs: ["-llog"],
name: "virtual_touchpad",
@@ -112,7 +122,11 @@
shared_libs: client_shared_libs,
header_libs: header_libraries,
cppflags: ["-std=c++11"],
- cflags: ["-DLOG_TAG=\"VirtualTouchpadClient\""],
+ cflags: [
+ "-DLOG_TAG=\"VirtualTouchpadClient\"",
+ "-Wall",
+ "-Werror",
+ ],
host_ldlibs: ["-llog"],
name: "libvirtualtouchpadclient",
tags: ["optional"],
diff --git a/services/vr/virtual_touchpad/tests/VirtualTouchpad_test.cpp b/services/vr/virtual_touchpad/tests/VirtualTouchpad_test.cpp
index b19b018..198ed06 100644
--- a/services/vr/virtual_touchpad/tests/VirtualTouchpad_test.cpp
+++ b/services/vr/virtual_touchpad/tests/VirtualTouchpad_test.cpp
@@ -110,17 +110,6 @@
EvdevInjectorForTesting injector[kTouchpads];
};
-void DumpDifference(const char* expect, const char* actual) {
- printf(" common: ");
- while (*expect && *expect == *actual) {
- putchar(*expect);
- ++expect;
- ++actual;
- }
- printf("\n expect: %s\n", expect);
- printf(" actual: %s\n", actual);
-}
-
} // anonymous namespace
class VirtualTouchpadTest : public testing::Test {};
@@ -153,7 +142,6 @@
}
const int32_t width = 1 + uidev->absmax[ABS_MT_POSITION_X];
const int32_t height = 1 + uidev->absmax[ABS_MT_POSITION_Y];
- const int32_t slots = uidev->absmax[ABS_MT_SLOT];
for (int t = 0; t < touchpad->GetTouchpadCount(); ++t) {
SCOPED_TRACE(t);