Use -Werror in hardware/interfaces/audio
authorChih-Hung Hsieh <chh@google.com>
Mon, 20 Nov 2017 23:36:52 +0000 (15:36 -0800)
committerChih-hung Hsieh <chh@google.com>
Tue, 28 Nov 2017 17:11:33 +0000 (17:11 +0000)
* Remove unused variables, lambda function parameters..

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I28e8eb1af434f62cab6f41285b9a400f7f57cd13

audio/2.0/default/Android.mk
audio/2.0/default/StreamIn.cpp
audio/2.0/default/StreamOut.cpp
audio/effect/2.0/default/Android.bp
audio/effect/2.0/default/Effect.cpp

index 621853cb0e391287859674df2ca80b3c7daa1a69..70fa75056dc3c619f0e81c276117c635673d0354 100644 (file)
@@ -30,6 +30,8 @@ LOCAL_SRC_FILES := \
     StreamIn.cpp \
     StreamOut.cpp \
 
+LOCAL_CFLAGS := -Wall -Werror
+
 LOCAL_SHARED_LIBRARIES := \
     libbase \
     libcutils \
@@ -65,6 +67,8 @@ LOCAL_PROPRIETARY_MODULE := true
 LOCAL_SRC_FILES := \
     service.cpp
 
+LOCAL_CFLAGS := -Wall -Werror
+
 LOCAL_SHARED_LIBRARIES := \
     libhidlbase \
     libhidltransport \
index b81cbb924f5990cf8fadfb5846ce6a5f9083214e..575a4f47f505b0de9d18f217029b394b7e2f7f5d 100644 (file)
@@ -87,7 +87,6 @@ void ReadThread::doRead() {
     }
     ssize_t readResult = mStream->read(mStream, &mBuffer[0], requestedToRead);
     mStatus.retval = Result::OK;
-    uint64_t read = 0;
     if (readResult >= 0) {
         mStatus.reply.read = readResult;
         if (!mDataMQ->write(&mBuffer[0], readResult)) {
@@ -326,7 +325,7 @@ Return<void> StreamIn::prepareForReading(uint32_t frameSize,
     ThreadInfo threadInfo = {0, 0};
 
     // Wrap the _hidl_cb to return an error
-    auto sendError = [this, &threadInfo, &_hidl_cb](Result result) {
+    auto sendError = [&threadInfo, &_hidl_cb](Result result) {
         _hidl_cb(result, CommandMQ::Descriptor(), DataMQ::Descriptor(),
                  StatusMQ::Descriptor(), threadInfo);
 
index 290d0b103cd8ff21f24820ecc9e619d1a814dd9b..242e8fc5c7f642ba4a8858272f74a7abc74f32a8 100644 (file)
@@ -302,7 +302,7 @@ Return<void> StreamOut::prepareForWriting(uint32_t frameSize,
     ThreadInfo threadInfo = {0, 0};
 
     // Wrap the _hidl_cb to return an error
-    auto sendError = [this, &threadInfo, &_hidl_cb](Result result) {
+    auto sendError = [&threadInfo, &_hidl_cb](Result result) {
         _hidl_cb(result, CommandMQ::Descriptor(), DataMQ::Descriptor(),
                  StatusMQ::Descriptor(), threadInfo);
 
index 79bb8b0d6bc0073b50e92e36c20945683cfe8fc0..e1072b466d48deac63df0610d564e2e24f31c7ea 100644 (file)
@@ -1,5 +1,6 @@
 cc_library_shared {
     name: "android.hardware.audio.effect@2.0-impl",
+    defaults: ["hidl_defaults"],
     vendor: true,
     relative_install_path: "hw",
     srcs: [
index 2d36604d5bd09c106774df8dc9f046be1529d888..184607e5dfabbed2268b266409d2cbc935dd69c7 100644 (file)
@@ -610,10 +610,8 @@ Return<void> Effect::getSupportedAuxChannelsConfigs(
 }
 
 Return<void> Effect::getAuxChannelsConfig(getAuxChannelsConfig_cb _hidl_cb)  {
-    uint32_t halCmd = EFFECT_FEATURE_AUX_CHANNELS;
     uint32_t halResult[alignedSizeIn<uint32_t>(sizeof(uint32_t) + sizeof(channel_config_t))];
     memset(halResult, 0, sizeof(halResult));
-    uint32_t halResultSize = 0;
     EffectAuxChannelsConfig result;
     Result retval = getCurrentConfigImpl(
             EFFECT_FEATURE_AUX_CHANNELS,