Browse Source

Drop -Wno-unused-parameter.

The only one left is libedify. Will handle that in a separate CL.

Test: mmma bootable/recovery
Change-Id: I732a5f85229da90fd767bee2e46c5c95f529c396
Tao Bao 4 years ago
parent
commit
99f0d9e52b
10 changed files with 62 additions and 49 deletions
  1. 2
    4
      Android.mk
  2. 1
    2
      boot_control/Android.mk
  3. 16
    1
      minadbd/Android.mk
  4. 15
    15
      minadbd/minadbd_services.cpp
  5. 5
    0
      minui/Android.mk
  6. 10
    11
      recovery.cpp
  7. 11
    11
      stub_ui.h
  8. 0
    2
      updater/Android.mk
  9. 1
    1
      vr_ui.cpp
  10. 1
    2
      wear_ui.cpp

+ 2
- 4
Android.mk View File

@@ -94,7 +94,7 @@ endif
94 94
 endif
95 95
 
96 96
 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
97
-LOCAL_CFLAGS += -Wall -Wno-unused-parameter -Werror
97
+LOCAL_CFLAGS += -Wall -Werror
98 98
 
99 99
 ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
100 100
 LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
@@ -173,9 +173,7 @@ LOCAL_STATIC_LIBRARIES := \
173 173
     libcutils \
174 174
     libutils \
175 175
     liblog \
176
-    libselinux \
177
-    libm \
178
-    libc
176
+    libselinux
179 177
 
180 178
 LOCAL_HAL_STATIC_LIBRARIES := libhealthd
181 179
 

+ 1
- 2
boot_control/Android.mk View File

@@ -24,8 +24,7 @@ LOCAL_CFLAGS := \
24 24
   -D_FILE_OFFSET_BITS=64 \
25 25
   -Werror \
26 26
   -Wall \
27
-  -Wextra \
28
-  -Wno-unused-parameter
27
+  -Wextra
29 28
 LOCAL_SHARED_LIBRARIES := liblog
30 29
 LOCAL_STATIC_LIBRARIES := libbootloader_message libfs_mgr libbase
31 30
 LOCAL_POST_INSTALL_CMD := \

+ 16
- 1
minadbd/Android.mk View File

@@ -1,13 +1,26 @@
1 1
 # Copyright 2005 The Android Open Source Project
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License");
4
+# you may not use this file except in compliance with the License.
5
+# You may obtain a copy of the License at
6
+#
7
+#      http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS,
11
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+# See the License for the specific language governing permissions and
13
+# limitations under the License.
2 14
 
3 15
 LOCAL_PATH:= $(call my-dir)
4 16
 
5 17
 minadbd_cflags := \
6 18
     -Wall -Werror \
7
-    -Wno-unused-parameter \
8 19
     -Wno-missing-field-initializers \
9 20
     -DADB_HOST=0 \
10 21
 
22
+# libadbd (static library)
23
+# ===============================
11 24
 include $(CLEAR_VARS)
12 25
 
13 26
 LOCAL_SRC_FILES := \
@@ -24,6 +37,8 @@ LOCAL_STATIC_LIBRARIES := libcrypto libbase
24 37
 
25 38
 include $(BUILD_STATIC_LIBRARY)
26 39
 
40
+# minadbd_test (native test)
41
+# ===============================
27 42
 include $(CLEAR_VARS)
28 43
 
29 44
 LOCAL_MODULE := minadbd_test

+ 15
- 15
minadbd/minadbd_services.cpp View File

@@ -58,20 +58,20 @@ static int create_service_thread(void (*func)(int, const std::string&), const st
58 58
     return s[0];
59 59
 }
60 60
 
61
-int service_to_fd(const char* name, const atransport* transport) {
62
-    int ret = -1;
61
+int service_to_fd(const char* name, const atransport* /* transport */) {
62
+  int ret = -1;
63 63
 
64
-    if (!strncmp(name, "sideload:", 9)) {
65
-        // this exit status causes recovery to print a special error
66
-        // message saying to use a newer adb (that supports
67
-        // sideload-host).
68
-        exit(3);
69
-    } else if (!strncmp(name, "sideload-host:", 14)) {
70
-        std::string arg(name + 14);
71
-        ret = create_service_thread(sideload_host_service, arg);
72
-    }
73
-    if (ret >= 0) {
74
-        close_on_exec(ret);
75
-    }
76
-    return ret;
64
+  if (!strncmp(name, "sideload:", 9)) {
65
+    // this exit status causes recovery to print a special error
66
+    // message saying to use a newer adb (that supports
67
+    // sideload-host).
68
+    exit(3);
69
+  } else if (!strncmp(name, "sideload-host:", 14)) {
70
+    std::string arg(name + 14);
71
+    ret = create_service_thread(sideload_host_service, arg);
72
+  }
73
+  if (ret >= 0) {
74
+    close_on_exec(ret);
75
+  }
76
+  return ret;
77 77
 }

+ 5
- 0
minui/Android.mk View File

@@ -13,6 +13,9 @@
13 13
 # limitations under the License.
14 14
 
15 15
 LOCAL_PATH := $(call my-dir)
16
+
17
+# libminui (static library)
18
+# ===============================
16 19
 include $(CLEAR_VARS)
17 20
 
18 21
 LOCAL_SRC_FILES := \
@@ -66,6 +69,8 @@ endif
66 69
 
67 70
 include $(BUILD_STATIC_LIBRARY)
68 71
 
72
+# libminui (shared library)
73
+# ===============================
69 74
 # Used by OEMs for factory test images.
70 75
 include $(CLEAR_VARS)
71 76
 LOCAL_MODULE := libminui

+ 10
- 11
recovery.cpp View File

@@ -1214,9 +1214,8 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) {
1214 1214
   }
1215 1215
 }
1216 1216
 
1217
-static void
1218
-print_property(const char *key, const char *name, void *cookie) {
1219
-    printf("%s=%s\n", key, name);
1217
+static void print_property(const char* key, const char* name, void* /* cookie */) {
1218
+  printf("%s=%s\n", key, name);
1220 1219
 }
1221 1220
 
1222 1221
 static std::string load_locale_from_cache() {
@@ -1250,14 +1249,14 @@ void ui_print(const char* format, ...) {
1250 1249
 
1251 1250
 static constexpr char log_characters[] = "VDIWEF";
1252 1251
 
1253
-void UiLogger(android::base::LogId id, android::base::LogSeverity severity,
1254
-               const char* tag, const char* file, unsigned int line,
1255
-               const char* message) {
1256
-    if (severity >= android::base::ERROR && ui != nullptr) {
1257
-        ui->Print("E:%s\n", message);
1258
-    } else {
1259
-        fprintf(stdout, "%c:%s\n", log_characters[severity], message);
1260
-    }
1252
+void UiLogger(android::base::LogId /* id */, android::base::LogSeverity severity,
1253
+              const char* /* tag */, const char* /* file */, unsigned int /* line */,
1254
+              const char* message) {
1255
+  if (severity >= android::base::ERROR && ui != nullptr) {
1256
+    ui->Print("E:%s\n", message);
1257
+  } else {
1258
+    fprintf(stdout, "%c:%s\n", log_characters[severity], message);
1259
+  }
1261 1260
 }
1262 1261
 
1263 1262
 static bool is_battery_ok() {

+ 11
- 11
stub_ui.h View File

@@ -24,18 +24,18 @@ class StubRecoveryUI : public RecoveryUI {
24 24
  public:
25 25
   StubRecoveryUI() = default;
26 26
 
27
-  void SetBackground(Icon icon) override {}
28
-  void SetSystemUpdateText(bool security_update) override {}
27
+  void SetBackground(Icon /* icon */) override {}
28
+  void SetSystemUpdateText(bool /* security_update */) override {}
29 29
 
30 30
   // progress indicator
31
-  void SetProgressType(ProgressType type) override {}
32
-  void ShowProgress(float portion, float seconds) override {}
33
-  void SetProgress(float fraction) override {}
31
+  void SetProgressType(ProgressType /* type */) override {}
32
+  void ShowProgress(float /* portion */, float /* seconds */) override {}
33
+  void SetProgress(float /* fraction */) override {}
34 34
 
35
-  void SetStage(int current, int max) override {}
35
+  void SetStage(int /* current */, int /* max */) override {}
36 36
 
37 37
   // text log
38
-  void ShowText(bool visible) override {}
38
+  void ShowText(bool /* visible */) override {}
39 39
   bool IsTextVisible() override {
40 40
     return false;
41 41
   }
@@ -50,12 +50,12 @@ class StubRecoveryUI : public RecoveryUI {
50 50
     vprintf(fmt, ap);
51 51
     va_end(ap);
52 52
   }
53
-  void PrintOnScreenOnly(const char* fmt, ...) override {}
54
-  void ShowFile(const char* filename) override {}
53
+  void PrintOnScreenOnly(const char* /* fmt */, ...) override {}
54
+  void ShowFile(const char* /* filename */) override {}
55 55
 
56 56
   // menu display
57
-  void StartMenu(const char* const* headers, const char* const* items,
58
-                 int initial_selection) override {}
57
+  void StartMenu(const char* const* /* headers */, const char* const* /* items */,
58
+                 int /* initial_selection */) override {}
59 59
   int SelectMenu(int sel) override {
60 60
     return sel;
61 61
   }

+ 0
- 2
updater/Android.mk View File

@@ -67,7 +67,6 @@ LOCAL_C_INCLUDES := \
67 67
 
68 68
 LOCAL_CFLAGS := \
69 69
     -Wall \
70
-    -Wno-unused-parameter \
71 70
     -Werror
72 71
 
73 72
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
@@ -93,7 +92,6 @@ LOCAL_C_INCLUDES := \
93 92
 
94 93
 LOCAL_CFLAGS := \
95 94
     -Wall \
96
-    -Wno-unused-parameter \
97 95
     -Werror
98 96
 
99 97
 LOCAL_STATIC_LIBRARIES := \

+ 1
- 1
vr_ui.cpp View File

@@ -53,7 +53,7 @@ int VrRecoveryUI::DrawHorizontalRule(int y) const {
53 53
   return y + 4;
54 54
 }
55 55
 
56
-void VrRecoveryUI::DrawHighlightBar(int x, int y, int width, int height) const {
56
+void VrRecoveryUI::DrawHighlightBar(int /* x */, int y, int /* width */, int height) const {
57 57
   gr_fill(kMarginWidth + kStereoOffset, y, ScreenWidth() - kMarginWidth + kStereoOffset, y + height);
58 58
   gr_fill(ScreenWidth() + kMarginWidth - kStereoOffset, y,
59 59
           gr_fb_width() - kMarginWidth - kStereoOffset, y + height);

+ 1
- 2
wear_ui.cpp View File

@@ -150,8 +150,7 @@ void WearRecoveryUI::update_progress_locked() {
150 150
   gr_flip();
151 151
 }
152 152
 
153
-void WearRecoveryUI::SetStage(int current, int max) {
154
-}
153
+void WearRecoveryUI::SetStage(int /* current */, int /* max */) {}
155 154
 
156 155
 void WearRecoveryUI::StartMenu(const char* const* headers, const char* const* items,
157 156
                                int initial_selection) {