Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e27d5eb7 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

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
parent 07463524
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -13,7 +13,7 @@ __BEGIN_DECLS
#ifndef __FLOAT32X4T_86
#ifndef __FLOAT32X4T_86
#define __FLOAT32X4T_86
#define __FLOAT32X4T_86
typedef float float32x4_t __attribute__((__vector_size__(16)));
typedef float float32x4_t __attribute__((__vector_size__(16)));
typedef struct float32x4x4_t { float32x4_t val[4]; };
typedef struct float32x4x4_t { float32x4_t val[4]; } float32x4x4_t;
#endif
#endif
#endif
#endif


+23 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,13 @@ cc_library_shared {


  cflags: [
  cflags: [
    "-DLOG_TAG=\"vr_hwc\"",
    "-DLOG_TAG=\"vr_hwc\"",
    "-Wall",
    "-Werror",
    // mVrClient unused in vr_composer_client.cpp
    "-Wno-error=unused-private-field",
    // Warnings in vr_hwc.cpp to be fixed after sync of goog/master.
    "-Wno-sign-compare",
    "-Wno-unused-parameter",
  ],
  ],


}
}
@@ -63,6 +70,11 @@ cc_library_static {
  },
  },
  export_include_dirs: ["aidl"],
  export_include_dirs: ["aidl"],


  cflags: [
    "-Wall",
    "-Werror",
  ],

  shared_libs: [
  shared_libs: [
    "libbinder",
    "libbinder",
    "libui",
    "libui",
@@ -92,6 +104,8 @@ cc_library_static {
  ],
  ],
  cflags: [
  cflags: [
    "-DLOG_TAG=\"vr_hwc\"",
    "-DLOG_TAG=\"vr_hwc\"",
    "-Wall",
    "-Werror",
  ],
  ],
}
}


@@ -120,6 +134,8 @@ cc_binary {
  ],
  ],
  cflags: [
  cflags: [
    "-DLOG_TAG=\"vr_hwc\"",
    "-DLOG_TAG=\"vr_hwc\"",
    "-Wall",
    "-Werror",
  ],
  ],
  init_rc: [
  init_rc: [
    "vr_hwc.rc",
    "vr_hwc.rc",
@@ -137,6 +153,13 @@ cc_test {
    // symbols in the *-binder library get optimized out.
    // symbols in the *-binder library get optimized out.
    "libvr_hwc-binder",
    "libvr_hwc-binder",
  ],
  ],
  cflags: [
    "-Wall",
    "-Werror",
    // warnings in vr_composer_test.cpp to be fixed after merge of goog/master
    "-Wno-sign-compare",
    "-Wno-unused-parameter",
  ],
  shared_libs: [
  shared_libs: [
    "libbase",
    "libbase",
    "libbinder",
    "libbinder",
+1 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(sourceFiles)
LOCAL_SRC_FILES := $(sourceFiles)
LOCAL_CFLAGS := -DLOG_TAG=\"performanced\"
LOCAL_CFLAGS := -DLOG_TAG=\"performanced\"
LOCAL_CFLAGS += -DTRACE=0
LOCAL_CFLAGS += -DTRACE=0
LOCAL_CFLAGS += -Wall -Werror
LOCAL_STATIC_LIBRARIES := $(staticLibraries)
LOCAL_STATIC_LIBRARIES := $(staticLibraries)
LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
LOCAL_SHARED_LIBRARIES := $(sharedLibraries)
LOCAL_MODULE := performanced
LOCAL_MODULE := performanced
+1 −1
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ class DirectoryReader {
    directory_ = fdopendir(directory_fd.get());
    directory_ = fdopendir(directory_fd.get());
    error_ = errno;
    error_ = errno;
    if (directory_ != nullptr)
    if (directory_ != nullptr)
      directory_fd.release();
      (void) directory_fd.release(); // ignore return result?
  }
  }


  ~DirectoryReader() {
  ~DirectoryReader() {
+16 −2
Original line number Original line Diff line number Diff line
@@ -23,7 +23,11 @@ cc_library {
    shared_libs: shared_libs,
    shared_libs: shared_libs,
    header_libs: header_libraries,
    header_libs: header_libraries,
    cppflags: ["-std=c++11"],
    cppflags: ["-std=c++11"],
    cflags: ["-DLOG_TAG=\"VrVirtualTouchpad\""],
    cflags: [
        "-DLOG_TAG=\"VrVirtualTouchpad\"",
        "-Wall",
        "-Werror",
    ],
    name: "libvirtualtouchpad",
    name: "libvirtualtouchpad",
    tags: ["optional"],
    tags: ["optional"],
}
}
@@ -44,6 +48,10 @@ cc_test {
    srcs: test_src_files,
    srcs: test_src_files,
    static_libs: test_static_libs,
    static_libs: test_static_libs,
    header_libs: header_libraries,
    header_libs: header_libraries,
    cflags = [
        "-Wall",
        "-Werror",
    ],
    cppflags = [
    cppflags = [
        "-std=c++11",
        "-std=c++11",
    ],
    ],
@@ -83,6 +91,8 @@ cc_binary {
    cppflags: ["-std=c++11"],
    cppflags: ["-std=c++11"],
    cflags: [
    cflags: [
        "-DLOG_TAG=\"VrVirtualTouchpad\"",
        "-DLOG_TAG=\"VrVirtualTouchpad\"",
        "-Wall",
        "-Werror",
    ],
    ],
    host_ldlibs: ["-llog"],
    host_ldlibs: ["-llog"],
    name: "virtual_touchpad",
    name: "virtual_touchpad",
@@ -112,7 +122,11 @@ cc_library {
    shared_libs: client_shared_libs,
    shared_libs: client_shared_libs,
    header_libs: header_libraries,
    header_libs: header_libraries,
    cppflags: ["-std=c++11"],
    cppflags: ["-std=c++11"],
    cflags: ["-DLOG_TAG=\"VirtualTouchpadClient\""],
    cflags: [
        "-DLOG_TAG=\"VirtualTouchpadClient\"",
        "-Wall",
        "-Werror",
    ],
    host_ldlibs: ["-llog"],
    host_ldlibs: ["-llog"],
    name: "libvirtualtouchpadclient",
    name: "libvirtualtouchpadclient",
    tags: ["optional"],
    tags: ["optional"],
Loading