diff options
author | Sergii Piatakov <sergii.piatakov@globallogic.com> | 2018-08-03 17:37:05 +0300 |
---|---|---|
committer | Sergii Piatakov <sergii.piatakov@globallogic.com> | 2018-08-10 14:36:42 +0300 |
commit | a01d1f82332389737d9f1f77e9705c9bdde17ef7 (patch) | |
tree | bc823186f178811654397f750388dc27ab652a01 | |
parent | 2ad591f9ea58c9810c9904e15e3e98af84e3c6c6 (diff) | |
download | libhardware-a01d1f82332389737d9f1f77e9705c9bdde17ef7.tar.gz |
camera: fix `-Wformat` compiler warnings
Test: add `USE_CAMERA_V4L2_HAL := true` to
hardware/libhardware/modules/camera/3_4/Android.mk and build
mmm hardware/libhardware/modules/camera/3_4
Change-Id: Ib1d1fc2de98436dd7e9d15ab324789725bb2002e
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
-rw-r--r-- | modules/camera/3_4/camera.cpp | 4 | ||||
-rw-r--r-- | modules/camera/3_4/format_metadata_factory.cpp | 2 | ||||
-rw-r--r-- | modules/camera/3_4/metadata/metadata_common.h | 6 | ||||
-rw-r--r-- | modules/camera/3_4/metadata/metadata_reader.cpp | 4 | ||||
-rw-r--r-- | modules/camera/3_4/static_properties.cpp | 12 | ||||
-rw-r--r-- | modules/camera/3_4/v4l2_camera_hal.cpp | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp index 01236f3c..35054a03 100644 --- a/modules/camera/3_4/camera.cpp +++ b/modules/camera/3_4/camera.cpp @@ -344,7 +344,7 @@ int Camera::processCaptureRequest(camera3_capture_request_t *temp_request) // Pre-process output buffers. if (request->output_buffers.size() <= 0) { - ALOGE("%s:%d: Invalid number of output buffers: %d", __func__, mId, + ALOGE("%s:%d: Invalid number of output buffers: %zu", __func__, mId, request->output_buffers.size()); return -EINVAL; } @@ -434,7 +434,7 @@ int Camera::flush() completeRequestWithError(request); } - ALOGV("%s:%d: Flushed %u requests.", __func__, mId, requests.size()); + ALOGV("%s:%d: Flushed %zu requests.", __func__, mId, requests.size()); // Call down into the device flushing. return flushBuffers(); diff --git a/modules/camera/3_4/format_metadata_factory.cpp b/modules/camera/3_4/format_metadata_factory.cpp index c6e739d2..5eed134e 100644 --- a/modules/camera/3_4/format_metadata_factory.cpp +++ b/modules/camera/3_4/format_metadata_factory.cpp @@ -104,7 +104,7 @@ int AddFormatComponents( return res; } - HAL_LOGI("Supports %d qualified formats.", qualified_formats.size()); + HAL_LOGI("Supports %zu qualified formats.", qualified_formats.size()); // Find sizes and frame/stall durations for all formats. // We also want to find the smallest max frame duration amongst all formats, diff --git a/modules/camera/3_4/metadata/metadata_common.h b/modules/camera/3_4/metadata/metadata_common.h index 34b77777..d98bd4d4 100644 --- a/modules/camera/3_4/metadata/metadata_common.h +++ b/modules/camera/3_4/metadata/metadata_common.h @@ -180,7 +180,7 @@ static int SingleTagValue(const android::CameraMetadata& metadata, } else if (entry.count != 1) { HAL_LOGE( "Error: expected metadata tag %d to contain exactly 1 value " - "(had %d).", + "(had %zu).", tag, entry.count); return -EINVAL; @@ -211,7 +211,7 @@ static int SingleTagValue(const android::CameraMetadata& metadata, } else if (entry.count != N) { HAL_LOGE( "Error: expected metadata tag %d to contain a single array of " - "exactly %d values (had %d).", + "exactly %zu values (had %zu).", tag, N, entry.count); @@ -284,7 +284,7 @@ static int VectorTagValue(const android::CameraMetadata& metadata, if (entry.count % N != 0) { HAL_LOGE( "Error: expected metadata tag %d to contain a vector of arrays of " - "length %d (had %d entries, which is not divisible by %d).", + "length %zu (had %zu entries, which is not divisible by %zu).", tag, N, entry.count, diff --git a/modules/camera/3_4/metadata/metadata_reader.cpp b/modules/camera/3_4/metadata/metadata_reader.cpp index dfb3adee..6a25127c 100644 --- a/modules/camera/3_4/metadata/metadata_reader.cpp +++ b/modules/camera/3_4/metadata/metadata_reader.cpp @@ -201,9 +201,9 @@ int MetadataReader::StreamStallDurations( } // Must have a non-negative stall. if (stall.duration < 0) { - ALOGE("%s: Invalid stall duration: negative stall %d.", + ALOGE("%s: Invalid stall duration: negative stall %lld.", __func__, - stall.duration); + static_cast<long long>(stall.duration)); return -EINVAL; } // TODO(b/31384253): YUV_420_888, RAW10, RAW12, RAW_OPAQUE, diff --git a/modules/camera/3_4/static_properties.cpp b/modules/camera/3_4/static_properties.cpp index e914567e..d41ac925 100644 --- a/modules/camera/3_4/static_properties.cpp +++ b/modules/camera/3_4/static_properties.cpp @@ -277,11 +277,11 @@ bool StaticProperties::SanityCheckStreamConfiguration( for (size_t i = 0; i < stream_config->num_streams; ++i) { const camera3_stream_t* stream = stream_config->streams[i]; if (stream == nullptr) { - ALOGE("%s: Stream %d is null", __func__, i); + ALOGE("%s: Stream %zu is null", __func__, i); return false; } else if (!IsInputType(stream->stream_type) && !IsOutputType(stream->stream_type)) { - ALOGE("%s: Stream %d type %d is neither an input nor an output type", + ALOGE("%s: Stream %zu type %d is neither an input nor an output type", __func__, i, stream->stream_type); @@ -321,7 +321,7 @@ bool StaticProperties::InputStreamsSupported( // Check the count. if (num_input_streams > max_input_streams_) { ALOGE( - "%s: Requested number of input streams %d is greater than " + "%s: Requested number of input streams %zu is greater than " "the maximum number supported by the device (%d).", __func__, num_input_streams, @@ -406,7 +406,7 @@ bool StaticProperties::OutputStreamsSupported( if (num_raw > max_raw_output_streams_) { ALOGE( "%s: Requested stream configuration exceeds maximum supported " - "raw output streams %d (requested %d).", + "raw output streams %d (requested %zu).", __func__, max_raw_output_streams_, num_raw); @@ -414,7 +414,7 @@ bool StaticProperties::OutputStreamsSupported( } else if (num_stalling > max_stalling_output_streams_) { ALOGE( "%s: Requested stream configuration exceeds maximum supported " - "stalling output streams %d (requested %d).", + "stalling output streams %d (requested %zu).", __func__, max_stalling_output_streams_, num_stalling); @@ -422,7 +422,7 @@ bool StaticProperties::OutputStreamsSupported( } else if (num_non_stalling > max_non_stalling_output_streams_) { ALOGE( "%s: Requested stream configuration exceeds maximum supported " - "non-stalling output streams %d (requested %d).", + "non-stalling output streams %d (requested %zu).", __func__, max_non_stalling_output_streams_, num_non_stalling); diff --git a/modules/camera/3_4/v4l2_camera_hal.cpp b/modules/camera/3_4/v4l2_camera_hal.cpp index 7ab96ac2..8ff8e5d2 100644 --- a/modules/camera/3_4/v4l2_camera_hal.cpp +++ b/modules/camera/3_4/v4l2_camera_hal.cpp @@ -115,7 +115,7 @@ V4L2CameraHAL::~V4L2CameraHAL() { } int V4L2CameraHAL::getNumberOfCameras() { - HAL_LOGV("returns %d", mCameras.size()); + HAL_LOGV("returns %zu", mCameras.size()); return mCameras.size(); } |