Code clean for libcameraservice
Cleaning compile warnings "variable 'XX' set but not used":
1. Remove the variables which are obviously not used;
2. Add "[[maybe_unused]]" to variable declaration of the ones
which are potentially used.
For the unused function parameters which were cast by "(void)":
We have changed them to the C++17 attribute "[[maybe_unused]]".
This seems not that necessary but it avoids redundant code lines.
Test: mmm frameworks/av/services/camera/libcameraservice,
presubmit check.
Change-Id: Ia68b78c01f8254d76be81b1ce98d2a5c3d7eea46
Signed-off-by: Jing Mike <jingyangliu@eswincomputing.com>
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 5e7fe7f..9a627f3 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -497,9 +497,8 @@
return BAD_VALUE;
}
-status_t Camera3Device::dump(int fd, const Vector<String16> &args) {
+status_t Camera3Device::dump(int fd, [[maybe_unused]] const Vector<String16> &args) {
ATRACE_CALL();
- (void)args;
// Try to lock, but continue in case of failure (to avoid blocking in
// deadlocks)