universal7904: camera: Resolve all clang compilation warnings
Change-Id: I37fd31b141f36589e0dd1034a279746e8c0f6436
Signed-off-by: SamarV-121 <samarvispute121@pm.me>
diff --git a/hardware/camera/CallbackWorkerThread.cpp b/hardware/camera/CallbackWorkerThread.cpp
index 4d04917..44ca598 100644
--- a/hardware/camera/CallbackWorkerThread.cpp
+++ b/hardware/camera/CallbackWorkerThread.cpp
@@ -126,7 +126,7 @@
/* Lock the mutex and clear the message queue */
std::unique_lock<std::mutex> lk(m_mutex);
- ALOGV("%s: Clearing %i messages", __FUNCTION__, m_queue.size());
+ ALOGV("%s: Clearing %zu messages", __FUNCTION__, m_queue.size());
/* Whilst the queue is not empty */
while (!m_queue.empty()) {
diff --git a/hardware/camera/Camera2Wrapper.cpp b/hardware/camera/Camera2Wrapper.cpp
index b172c52..1217c89 100644
--- a/hardware/camera/Camera2Wrapper.cpp
+++ b/hardware/camera/Camera2Wrapper.cpp
@@ -78,10 +78,6 @@
static char * camera2_fixup_getparams(int id __unused, const char * settings)
{
- bool videoMode = false;
- const char* isoMode;
- char *manipBuf;
-
android::CameraParameters params;
params.unflatten(android::String8(settings));
@@ -105,9 +101,6 @@
static char * camera2_fixup_setparams(int id __unused, const char * settings)
{
- bool videoMode = false;
- const char* isoMode;
-
android::CameraParameters params;
params.unflatten(android::String8(settings));
@@ -134,7 +127,7 @@
static int camera2_set_preview_window(struct camera_device * device,
struct preview_stream_ops *window)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -207,7 +200,7 @@
camera_request_memory get_memory,
void *user)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -226,7 +219,7 @@
static void camera2_enable_msg_type(struct camera_device * device, int32_t msg_type)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -236,7 +229,7 @@
static void camera2_disable_msg_type(struct camera_device * device, int32_t msg_type)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -246,7 +239,7 @@
static int camera2_msg_type_enabled(struct camera_device * device, int32_t msg_type)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return 0;
@@ -256,8 +249,7 @@
static int camera2_start_preview(struct camera_device * device)
{
- int rc = 0;
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -267,7 +259,7 @@
static void camera2_stop_preview(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -286,7 +278,7 @@
static int camera2_preview_enabled(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -296,7 +288,7 @@
static int camera2_store_meta_data_in_buffers(struct camera_device * device, int enable)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -306,7 +298,7 @@
static int camera2_start_recording(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -316,7 +308,7 @@
static void camera2_stop_recording(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -326,7 +318,7 @@
static int camera2_recording_enabled(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -337,7 +329,7 @@
static void camera2_release_recording_frame(struct camera_device * device,
const void *opaque)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -350,7 +342,7 @@
static int camera2_auto_focus(struct camera_device * device)
{
int Ret;
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -370,7 +362,7 @@
static int camera2_cancel_auto_focus(struct camera_device * device)
{
int Ret;
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -400,7 +392,7 @@
static int camera2_take_picture(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -410,7 +402,7 @@
static int camera2_cancel_picture(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -420,7 +412,7 @@
static int camera2_set_parameters(struct camera_device * device, const char *params)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -435,7 +427,7 @@
static char* camera2_get_parameters(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return NULL;
@@ -451,7 +443,7 @@
static void camera2_put_parameters(struct camera_device *device, char *params)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(params)
free(params);
@@ -460,7 +452,7 @@
static int camera2_send_command(struct camera_device * device,
int32_t cmd, int32_t arg1, int32_t arg2)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -470,7 +462,7 @@
static void camera2_release(struct camera_device * device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return;
@@ -480,7 +472,7 @@
static int camera2_dump(struct camera_device * device, int fd)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device, (uintptr_t)(((wrapper_camera2_device_t*)device)->vendor));
if(!device)
return -EINVAL;
@@ -573,7 +565,7 @@
ALOGE("vendor camera open fail");
goto fail;
}
- ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, (uintptr_t)(camera2_device->vendor));
+ ALOGV("%s: got vendor camera device 0x%zu", __FUNCTION__, (uintptr_t)(camera2_device->vendor));
camera2_ops = (camera_device_ops_t*)malloc(sizeof(*camera2_ops));
if (!camera2_ops) {
diff --git a/hardware/camera/Camera3Wrapper.cpp b/hardware/camera/Camera3Wrapper.cpp
index 79518dc..1478460 100644
--- a/hardware/camera/Camera3Wrapper.cpp
+++ b/hardware/camera/Camera3Wrapper.cpp
@@ -57,7 +57,7 @@
static int camera3_initialize(const camera3_device_t *device, const camera3_callback_ops_t *callback_ops)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -68,7 +68,7 @@
static int camera3_configure_streams(const camera3_device *device, camera3_stream_configuration_t *stream_list)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -77,9 +77,9 @@
return VENDOR_CALL(device, configure_streams, stream_list);
}
-static int camera3_register_stream_buffers(const camera3_device *device, const camera3_stream_buffer_set_t *buffer_set)
+__unused static int camera3_register_stream_buffers(const camera3_device *device, const camera3_stream_buffer_set_t *buffer_set)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -90,7 +90,7 @@
static const camera_metadata_t *camera3_construct_default_request_settings(const camera3_device_t *device, int type)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -101,7 +101,7 @@
static int camera3_process_capture_request(const camera3_device_t *device, camera3_capture_request_t *request)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -112,7 +112,7 @@
static void camera3_get_metadata_vendor_tag_ops(const camera3_device *device, vendor_tag_query_ops_t* ops)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -123,7 +123,7 @@
static void camera3_dump(const camera3_device_t *device, int fd)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -134,7 +134,7 @@
static int camera3_flush(const camera3_device_t* device)
{
- ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
+ ALOGV("%s->%zu->%zu", __FUNCTION__, (uintptr_t)device,
(uintptr_t)(((wrapper_camera3_device_t*)device)->vendor));
if (!device)
@@ -220,7 +220,7 @@
ALOGE("vendor camera open fail");
goto fail;
}
- ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__, (uintptr_t)(camera3_device->vendor));
+ ALOGV("%s: got vendor camera device 0x%zu", __FUNCTION__, (uintptr_t)(camera3_device->vendor));
camera3_ops = (camera3_device_ops_t*)malloc(sizeof(*camera3_ops));
if (!camera3_ops) {
diff --git a/hardware/camera/CameraWrapper.cpp b/hardware/camera/CameraWrapper.cpp
index 4e6ea09..cb969ff 100644
--- a/hardware/camera/CameraWrapper.cpp
+++ b/hardware/camera/CameraWrapper.cpp
@@ -123,7 +123,7 @@
return gVendorModule->get_vendor_tag_ops(ops);
}
-static int camera_open_legacy(const struct hw_module_t* module, const char* id, uint32_t halVersion, struct hw_device_t** device)
+static int camera_open_legacy(const struct hw_module_t* module, const char* id, uint32_t halVersion __unused, struct hw_device_t** device)
{
ALOGV("%s", __FUNCTION__);
if (check_vendor_module())