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/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index 0887ced..8e3f609 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -1332,21 +1332,18 @@
|| l.mParameters.state == Parameters::VIDEO_SNAPSHOT);
}
-void Camera2Client::releaseRecordingFrame(const sp<IMemory>& mem) {
- (void)mem;
+void Camera2Client::releaseRecordingFrame([[maybe_unused]] const sp<IMemory>& mem) {
ATRACE_CALL();
ALOGW("%s: Not supported in buffer queue mode.", __FUNCTION__);
}
-void Camera2Client::releaseRecordingFrameHandle(native_handle_t *handle) {
- (void)handle;
+void Camera2Client::releaseRecordingFrameHandle([[maybe_unused]] native_handle_t *handle) {
ATRACE_CALL();
ALOGW("%s: Not supported in buffer queue mode.", __FUNCTION__);
}
void Camera2Client::releaseRecordingFrameHandleBatch(
- const std::vector<native_handle_t*>& handles) {
- (void)handles;
+ [[maybe_unused]] const std::vector<native_handle_t*>& handles) {
ATRACE_CALL();
ALOGW("%s: Not supported in buffer queue mode.", __FUNCTION__);
}