diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-11-23 17:23:07 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-11-24 12:18:29 +0000 |
commit | 0382fcb22b40e9f8b94b9ea3fc41716b011d5162 (patch) | |
tree | f0d9ddab6fabc98c9be7de59d17302c2164cb9eb | |
parent | b426b778c680a266d3c67e866fa07d81011bd16d (diff) |
android: Convert to pragma once
Remove the verbose #ifndef/#define/#endif pattern for maintaining
header idempotency, and replace it with a simple #pragma once.
This simplifies the headers, and prevents redundant changes when
header files get moved.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
-rw-r--r-- | src/android/camera_buffer.h | 5 | ||||
-rw-r--r-- | src/android/camera_capabilities.h | 6 | ||||
-rw-r--r-- | src/android/camera_device.h | 6 | ||||
-rw-r--r-- | src/android/camera_hal_config.h | 5 | ||||
-rw-r--r-- | src/android/camera_hal_manager.h | 6 | ||||
-rw-r--r-- | src/android/camera_metadata.h | 6 | ||||
-rw-r--r-- | src/android/camera_ops.h | 6 | ||||
-rw-r--r-- | src/android/camera_request.h | 6 | ||||
-rw-r--r-- | src/android/camera_stream.h | 6 | ||||
-rw-r--r-- | src/android/camera_worker.h | 6 | ||||
-rw-r--r-- | src/android/jpeg/encoder.h | 6 | ||||
-rw-r--r-- | src/android/jpeg/encoder_libjpeg.h | 6 | ||||
-rw-r--r-- | src/android/jpeg/exif.h | 6 | ||||
-rw-r--r-- | src/android/jpeg/post_processor_jpeg.h | 6 | ||||
-rw-r--r-- | src/android/jpeg/thumbnailer.h | 6 | ||||
-rw-r--r-- | src/android/post_processor.h | 6 | ||||
-rw-r--r-- | src/android/yuv/post_processor_yuv.h | 6 |
17 files changed, 34 insertions, 66 deletions
diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h index 226a8f5c..b4531c80 100644 --- a/src/android/camera_buffer.h +++ b/src/android/camera_buffer.h @@ -4,8 +4,8 @@ * * camera_buffer.h - Frame buffer handling interface definition */ -#ifndef __ANDROID_CAMERA_BUFFER_H__ -#define __ANDROID_CAMERA_BUFFER_H__ + +#pragma once #include <hardware/camera3.h> @@ -82,4 +82,3 @@ size_t CameraBuffer::jpegBufferSize(size_t maxJpegBufferSize) const \ { \ return _d()->jpegBufferSize(maxJpegBufferSize); \ } -#endif /* __ANDROID_CAMERA_BUFFER_H__ */ diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index 2cf97ae8..6f66f221 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -4,8 +4,8 @@ * * camera_capabilities.h - Camera static properties manager */ -#ifndef __ANDROID_CAMERA_CAPABILITIES_H__ -#define __ANDROID_CAMERA_CAPABILITIES_H__ + +#pragma once #include <map> #include <memory> @@ -84,5 +84,3 @@ private: std::set<int32_t> availableRequestKeys_; std::set<int32_t> availableResultKeys_; }; - -#endif /* __ANDROID_CAMERA_CAPABILITIES_H__ */ diff --git a/src/android/camera_device.h b/src/android/camera_device.h index 2a414020..51fe7da2 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -4,8 +4,8 @@ * * camera_device.h - libcamera Android Camera Device */ -#ifndef __ANDROID_CAMERA_DEVICE_H__ -#define __ANDROID_CAMERA_DEVICE_H__ + +#pragma once #include <map> #include <memory> @@ -130,5 +130,3 @@ private: CameraMetadata lastSettings_; }; - -#endif /* __ANDROID_CAMERA_DEVICE_H__ */ diff --git a/src/android/camera_hal_config.h b/src/android/camera_hal_config.h index a79d5d6c..9df554f9 100644 --- a/src/android/camera_hal_config.h +++ b/src/android/camera_hal_config.h @@ -4,8 +4,8 @@ * * camera_hal_config.h - Camera HAL configuration file manager */ -#ifndef __ANDROID_CAMERA_HAL_CONFIG_H__ -#define __ANDROID_CAMERA_HAL_CONFIG_H__ + +#pragma once #include <map> #include <string> @@ -36,4 +36,3 @@ private: int parseConfigurationFile(); }; -#endif /* __ANDROID_CAMERA_HAL_CONFIG_H__ */ diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index 3f6d302a..192f2fc5 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -4,8 +4,8 @@ * * camera_hal_manager.h - libcamera Android Camera Manager */ -#ifndef __ANDROID_CAMERA_MANAGER_H__ -#define __ANDROID_CAMERA_MANAGER_H__ + +#pragma once #include <map> #include <mutex> @@ -69,5 +69,3 @@ private: unsigned int numInternalCameras_; unsigned int nextExternalCameraId_; }; - -#endif /* __ANDROID_CAMERA_MANAGER_H__ */ diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 8555c7c3..e70f60af 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -4,8 +4,8 @@ * * camera_metadata.h - libcamera Android Camera Metadata Helper */ -#ifndef __ANDROID_CAMERA_METADATA_H__ -#define __ANDROID_CAMERA_METADATA_H__ + +#pragma once #include <stdint.h> #include <vector> @@ -99,5 +99,3 @@ private: bool valid_; bool resized_; }; - -#endif /* __ANDROID_CAMERA_METADATA_H__ */ diff --git a/src/android/camera_ops.h b/src/android/camera_ops.h index 304e7b85..b501bb7e 100644 --- a/src/android/camera_ops.h +++ b/src/android/camera_ops.h @@ -4,12 +4,10 @@ * * camera_ops.h - Android Camera HAL Operations */ -#ifndef __ANDROID_CAMERA_OPS_H__ -#define __ANDROID_CAMERA_OPS_H__ + +#pragma once #include <hardware/camera3.h> int hal_dev_close(hw_device_t *hw_device); extern camera3_device_ops hal_dev_ops; - -#endif /* __ANDROID_CAMERA_OPS_H__ */ diff --git a/src/android/camera_request.h b/src/android/camera_request.h index 8d1204e5..f3cb6d64 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -4,8 +4,8 @@ * * camera_request.h - libcamera Android Camera Request Descriptor */ -#ifndef __ANDROID_CAMERA_REQUEST_H__ -#define __ANDROID_CAMERA_REQUEST_H__ + +#pragma once #include <map> #include <memory> @@ -80,5 +80,3 @@ public: private: LIBCAMERA_DISABLE_COPY(Camera3RequestDescriptor) }; - -#endif /* __ANDROID_CAMERA_REQUEST_H__ */ diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h index 0c402deb..e9da75f0 100644 --- a/src/android/camera_stream.h +++ b/src/android/camera_stream.h @@ -4,8 +4,8 @@ * * camera_stream.h - Camera HAL stream */ -#ifndef __ANDROID_CAMERA_STREAM_H__ -#define __ANDROID_CAMERA_STREAM_H__ + +#pragma once #include <condition_variable> #include <memory> @@ -179,5 +179,3 @@ private: std::unique_ptr<PostProcessorWorker> worker_; }; - -#endif /* __ANDROID_CAMERA_STREAM__ */ diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h index c94f1632..26ecc273 100644 --- a/src/android/camera_worker.h +++ b/src/android/camera_worker.h @@ -4,8 +4,8 @@ * * camera_worker.h - Process capture requests on behalf of the Camera HAL */ -#ifndef __ANDROID_CAMERA_WORKER_H__ -#define __ANDROID_CAMERA_WORKER_H__ + +#pragma once #include <memory> #include <stdint.h> @@ -68,5 +68,3 @@ private: Worker worker_; }; - -#endif /* __ANDROID_CAMERA_WORKER_H__ */ diff --git a/src/android/jpeg/encoder.h b/src/android/jpeg/encoder.h index a28522f4..b974d367 100644 --- a/src/android/jpeg/encoder.h +++ b/src/android/jpeg/encoder.h @@ -4,8 +4,8 @@ * * encoder.h - Image encoding interface */ -#ifndef __ANDROID_JPEG_ENCODER_H__ -#define __ANDROID_JPEG_ENCODER_H__ + +#pragma once #include <libcamera/base/span.h> @@ -23,5 +23,3 @@ public: libcamera::Span<const uint8_t> exifData, unsigned int quality) = 0; }; - -#endif /* __ANDROID_JPEG_ENCODER_H__ */ diff --git a/src/android/jpeg/encoder_libjpeg.h b/src/android/jpeg/encoder_libjpeg.h index 45ffbd7f..1b3ac067 100644 --- a/src/android/jpeg/encoder_libjpeg.h +++ b/src/android/jpeg/encoder_libjpeg.h @@ -4,8 +4,8 @@ * * encoder_libjpeg.h - JPEG encoding using libjpeg */ -#ifndef __ANDROID_JPEG_ENCODER_LIBJPEG_H__ -#define __ANDROID_JPEG_ENCODER_LIBJPEG_H__ + +#pragma once #include "encoder.h" @@ -43,5 +43,3 @@ private: bool nv_; bool nvSwap_; }; - -#endif /* __ANDROID_JPEG_ENCODER_LIBJPEG_H__ */ diff --git a/src/android/jpeg/exif.h b/src/android/jpeg/exif.h index 23b0e097..2ff8fb78 100644 --- a/src/android/jpeg/exif.h +++ b/src/android/jpeg/exif.h @@ -4,8 +4,8 @@ * * exif.h - EXIF tag creator using libexif */ -#ifndef __ANDROID_JPEG_EXIF_H__ -#define __ANDROID_JPEG_EXIF_H__ + +#pragma once #include <chrono> #include <string> @@ -107,5 +107,3 @@ private: unsigned char *exifData_; unsigned int size_; }; - -#endif /* __ANDROID_JPEG_EXIF_H__ */ diff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h index 43fcbe60..98309b01 100644 --- a/src/android/jpeg/post_processor_jpeg.h +++ b/src/android/jpeg/post_processor_jpeg.h @@ -4,8 +4,8 @@ * * post_processor_jpeg.h - JPEG Post Processor */ -#ifndef __ANDROID_POST_PROCESSOR_JPEG_H__ -#define __ANDROID_POST_PROCESSOR_JPEG_H__ + +#pragma once #include "../post_processor.h" #include "encoder_libjpeg.h" @@ -36,5 +36,3 @@ private: EncoderLibJpeg thumbnailEncoder_; Thumbnailer thumbnailer_; }; - -#endif /* __ANDROID_POST_PROCESSOR_JPEG_H__ */ diff --git a/src/android/jpeg/thumbnailer.h b/src/android/jpeg/thumbnailer.h index 4d086c49..d933cf0e 100644 --- a/src/android/jpeg/thumbnailer.h +++ b/src/android/jpeg/thumbnailer.h @@ -4,8 +4,8 @@ * * thumbnailer.h - Simple image thumbnailer */ -#ifndef __ANDROID_JPEG_THUMBNAILER_H__ -#define __ANDROID_JPEG_THUMBNAILER_H__ + +#pragma once #include <libcamera/framebuffer.h> #include <libcamera/geometry.h> @@ -30,5 +30,3 @@ private: bool valid_; }; - -#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */ diff --git a/src/android/post_processor.h b/src/android/post_processor.h index 5ec71c93..1a205b05 100644 --- a/src/android/post_processor.h +++ b/src/android/post_processor.h @@ -4,8 +4,8 @@ * * post_processor.h - CameraStream Post Processing Interface */ -#ifndef __ANDROID_POST_PROCESSOR_H__ -#define __ANDROID_POST_PROCESSOR_H__ + +#pragma once #include <libcamera/base/signal.h> @@ -31,5 +31,3 @@ public: libcamera::Signal<Camera3RequestDescriptor::StreamBuffer *, Status> processComplete; }; - -#endif /* __ANDROID_POST_PROCESSOR_H__ */ diff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h index 39ec7994..a7ac17c5 100644 --- a/src/android/yuv/post_processor_yuv.h +++ b/src/android/yuv/post_processor_yuv.h @@ -4,8 +4,8 @@ * * post_processor_yuv.h - Post Processor using libyuv */ -#ifndef __ANDROID_POST_PROCESSOR_YUV_H__ -#define __ANDROID_POST_PROCESSOR_YUV_H__ + +#pragma once #include "../post_processor.h" @@ -33,5 +33,3 @@ private: unsigned int sourceStride_[2] = {}; unsigned int destinationStride_[2] = {}; }; - -#endif /* __ANDROID_POST_PROCESSOR_YUV_H__ */ |