diff options
author | Sergii Piatakov <sergii.piatakov@globallogic.com> | 2018-08-03 11:41:06 +0300 |
---|---|---|
committer | Sergii Piatakov <sergii.piatakov@globallogic.com> | 2018-08-10 14:16:05 +0300 |
commit | 2ad591f9ea58c9810c9904e15e3e98af84e3c6c6 (patch) | |
tree | 63f12914a31172a9a454678b4841802625223795 | |
parent | 06939479d62c19f41dd629dabebcab8acac98028 (diff) | |
download | libhardware-2ad591f9ea58c9810c9904e15e3e98af84e3c6c6.tar.gz |
camera: fix `-Wmacro-redefined` 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: Ida00d842007e2a589907bc4fd1887076fd8b5b2a
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
21 files changed, 49 insertions, 25 deletions
diff --git a/modules/camera/3_4/camera.cpp b/modules/camera/3_4/camera.cpp index 79dca0b8..01236f3c 100644 --- a/modules/camera/3_4/camera.cpp +++ b/modules/camera/3_4/camera.cpp @@ -16,6 +16,9 @@ // Modified from hardware/libhardware/modules/camera/Camera.cpp +//#define LOG_NDEBUG 0 +#define LOG_TAG "Camera" + #include <cstdlib> #include <memory> #include <vector> @@ -28,8 +31,6 @@ #include "metadata/metadata_common.h" -//#define LOG_NDEBUG 0 -#define LOG_TAG "Camera" #include <cutils/log.h> #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) diff --git a/modules/camera/3_4/common.h b/modules/camera/3_4/common.h index ca5151d5..48cf2bd4 100644 --- a/modules/camera/3_4/common.h +++ b/modules/camera/3_4/common.h @@ -17,11 +17,8 @@ #ifndef V4L2_CAMERA_HAL_COMMON_H_ #define V4L2_CAMERA_HAL_COMMON_H_ -// #define LOG_NDEBUG 0 #include <cutils/log.h> -#define LOG_TAG "V4L2CameraHAL" - // Helpers of logging (showing function name and line number). #define HAL_LOGE(fmt, args...) do { \ ALOGE("%s:%d: " fmt, __func__, __LINE__, ##args); \ @@ -59,11 +56,4 @@ #define HAL_LOG_ENTER() HAL_LOGV("enter") #define HAL_LOG_EXIT() HAL_LOGV("exit") -// Fix confliction in case it's defined elsewhere. -#ifndef DISALLOW_COPY_AND_ASSIGN -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - void operator=(const TypeName&); -#endif - #endif // V4L2_CAMERA_HAL_COMMON_H_ diff --git a/modules/camera/3_4/format_metadata_factory.cpp b/modules/camera/3_4/format_metadata_factory.cpp index db03678d..c6e739d2 100644 --- a/modules/camera/3_4/format_metadata_factory.cpp +++ b/modules/camera/3_4/format_metadata_factory.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "FormatMetadataFactory" + #include "format_metadata_factory.h" #include "arc/image_processor.h" diff --git a/modules/camera/3_4/metadata/boottime_state_delegate.cpp b/modules/camera/3_4/metadata/boottime_state_delegate.cpp index 5024cb2e..3508e852 100644 --- a/modules/camera/3_4/metadata/boottime_state_delegate.cpp +++ b/modules/camera/3_4/metadata/boottime_state_delegate.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "BoottimeStateDelegate" + #include <errno.h> #include <string.h> diff --git a/modules/camera/3_4/metadata/control.h b/modules/camera/3_4/metadata/control.h index ad3f87b6..902a60c0 100644 --- a/modules/camera/3_4/metadata/control.h +++ b/modules/camera/3_4/metadata/control.h @@ -19,9 +19,9 @@ #include <vector> +#include <android-base/macros.h> #include <system/camera_metadata.h> -#include "../common.h" #include "metadata_common.h" #include "partial_metadata_interface.h" #include "tagged_control_delegate.h" diff --git a/modules/camera/3_4/metadata/enum_converter.cpp b/modules/camera/3_4/metadata/enum_converter.cpp index d5e0a876..14da006d 100644 --- a/modules/camera/3_4/metadata/enum_converter.cpp +++ b/modules/camera/3_4/metadata/enum_converter.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "EnumConverter" + #include "enum_converter.h" #include <errno.h> diff --git a/modules/camera/3_4/metadata/enum_converter.h b/modules/camera/3_4/metadata/enum_converter.h index df5cabb1..83f4daae 100644 --- a/modules/camera/3_4/metadata/enum_converter.h +++ b/modules/camera/3_4/metadata/enum_converter.h @@ -19,7 +19,8 @@ #include <map> -#include "../common.h" +#include <android-base/macros.h> + #include "converter_interface.h" namespace v4l2_camera_hal { diff --git a/modules/camera/3_4/metadata/map_converter.h b/modules/camera/3_4/metadata/map_converter.h index b1734b5b..2324d744 100644 --- a/modules/camera/3_4/metadata/map_converter.h +++ b/modules/camera/3_4/metadata/map_converter.h @@ -22,7 +22,8 @@ #include <map> #include <memory> -#include "../common.h" +#include <android-base/macros.h> + #include "converter_interface.h" namespace v4l2_camera_hal { diff --git a/modules/camera/3_4/metadata/metadata.cpp b/modules/camera/3_4/metadata/metadata.cpp index efc99592..c5106c71 100644 --- a/modules/camera/3_4/metadata/metadata.cpp +++ b/modules/camera/3_4/metadata/metadata.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "Metadata" + #include "metadata.h" #include <camera/CameraMetadata.h> diff --git a/modules/camera/3_4/metadata/metadata.h b/modules/camera/3_4/metadata/metadata.h index e2232b5f..615b5899 100644 --- a/modules/camera/3_4/metadata/metadata.h +++ b/modules/camera/3_4/metadata/metadata.h @@ -19,10 +19,10 @@ #include <set> +#include <android-base/macros.h> #include <camera/CameraMetadata.h> #include <hardware/camera3.h> -#include "../common.h" #include "metadata_common.h" namespace v4l2_camera_hal { diff --git a/modules/camera/3_4/metadata/metadata_reader.cpp b/modules/camera/3_4/metadata/metadata_reader.cpp index fe2ff859..dfb3adee 100644 --- a/modules/camera/3_4/metadata/metadata_reader.cpp +++ b/modules/camera/3_4/metadata/metadata_reader.cpp @@ -14,10 +14,11 @@ * limitations under the License. */ -#include "metadata_reader.h" - // #define LOG_NDEBUG 0 #define LOG_TAG "MetadataReader" + +#include "metadata_reader.h" + #include <cutils/log.h> #include <system/camera.h> diff --git a/modules/camera/3_4/metadata/metadata_reader.h b/modules/camera/3_4/metadata/metadata_reader.h index 996bf8b4..8e05079e 100644 --- a/modules/camera/3_4/metadata/metadata_reader.h +++ b/modules/camera/3_4/metadata/metadata_reader.h @@ -22,9 +22,9 @@ #include <set> #include <vector> +#include <android-base/macros.h> #include <camera/CameraMetadata.h> -#include "../common.h" #include "types.h" namespace default_camera_hal { diff --git a/modules/camera/3_4/metadata/ranged_converter.h b/modules/camera/3_4/metadata/ranged_converter.h index 115ac2a7..bc48767f 100644 --- a/modules/camera/3_4/metadata/ranged_converter.h +++ b/modules/camera/3_4/metadata/ranged_converter.h @@ -19,7 +19,8 @@ #include <memory> -#include "../common.h" +#include <android-base/macros.h> + #include "converter_interface.h" namespace v4l2_camera_hal { diff --git a/modules/camera/3_4/request_tracker.cpp b/modules/camera/3_4/request_tracker.cpp index 09f634d1..d4cbe47c 100644 --- a/modules/camera/3_4/request_tracker.cpp +++ b/modules/camera/3_4/request_tracker.cpp @@ -14,10 +14,11 @@ * limitations under the License. */ -#include "request_tracker.h" - // #define LOG_NDEBUG 0 #define LOG_TAG "RequestTracker" + +#include "request_tracker.h" + #include <cutils/log.h> namespace default_camera_hal { diff --git a/modules/camera/3_4/request_tracker.h b/modules/camera/3_4/request_tracker.h index a632a614..e0bb4b52 100644 --- a/modules/camera/3_4/request_tracker.h +++ b/modules/camera/3_4/request_tracker.h @@ -22,9 +22,9 @@ #include <set> #include <hardware/camera3.h> +#include <android-base/macros.h> #include "capture_request.h" -#include "common.h" namespace default_camera_hal { diff --git a/modules/camera/3_4/static_properties.cpp b/modules/camera/3_4/static_properties.cpp index 5be9dcdd..e914567e 100644 --- a/modules/camera/3_4/static_properties.cpp +++ b/modules/camera/3_4/static_properties.cpp @@ -14,10 +14,11 @@ * limitations under the License. */ -#include "static_properties.h" - // #define LOG_NDEBUG 0 #define LOG_TAG "StaticProperties" + +#include "static_properties.h" + #include <cutils/log.h> #include <hardware/camera3.h> #include <system/camera.h> diff --git a/modules/camera/3_4/stream_format.cpp b/modules/camera/3_4/stream_format.cpp index 5f35e425..89b58bd3 100644 --- a/modules/camera/3_4/stream_format.cpp +++ b/modules/camera/3_4/stream_format.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "StreamFormat" + #include "stream_format.h" #include <linux/videodev2.h> diff --git a/modules/camera/3_4/v4l2_camera.cpp b/modules/camera/3_4/v4l2_camera.cpp index 98b80622..62d790e5 100644 --- a/modules/camera/3_4/v4l2_camera.cpp +++ b/modules/camera/3_4/v4l2_camera.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "V4L2Camera" + #include "v4l2_camera.h" #include <fcntl.h> diff --git a/modules/camera/3_4/v4l2_camera_hal.cpp b/modules/camera/3_4/v4l2_camera_hal.cpp index 83746ceb..7ab96ac2 100644 --- a/modules/camera/3_4/v4l2_camera_hal.cpp +++ b/modules/camera/3_4/v4l2_camera_hal.cpp @@ -16,6 +16,9 @@ // Modified from hardware/libhardware/modules/camera/CameraHAL.cpp +//#define LOG_NDEBUG 0 +#define LOG_TAG "V4L2CameraHAL" + #include "v4l2_camera_hal.h" #include <dirent.h> diff --git a/modules/camera/3_4/v4l2_metadata_factory.cpp b/modules/camera/3_4/v4l2_metadata_factory.cpp index bc8806f7..535f5629 100644 --- a/modules/camera/3_4/v4l2_metadata_factory.cpp +++ b/modules/camera/3_4/v4l2_metadata_factory.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "V4L2MetadataFactory" + #include "v4l2_metadata_factory.h" #include <camera/CameraMetadata.h> diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp index d715e7ec..085683d6 100644 --- a/modules/camera/3_4/v4l2_wrapper.cpp +++ b/modules/camera/3_4/v4l2_wrapper.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ +//#define LOG_NDEBUG 0 +#define LOG_TAG "V4L2Wrapper" + #include "v4l2_wrapper.h" #include <algorithm> |