cam: 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>
This commit is contained in:
Kieran Bingham 2021-11-23 17:23:07 +00:00
parent 0382fcb22b
commit 2c72ca70e2
10 changed files with 20 additions and 40 deletions

View file

@ -4,8 +4,8 @@
* *
* camera_session.h - Camera capture session * camera_session.h - Camera capture session
*/ */
#ifndef __CAM_CAMERA_SESSION_H__
#define __CAM_CAMERA_SESSION_H__ #pragma once
#include <memory> #include <memory>
#include <stdint.h> #include <stdint.h>
@ -74,5 +74,3 @@ private:
std::unique_ptr<libcamera::FrameBufferAllocator> allocator_; std::unique_ptr<libcamera::FrameBufferAllocator> allocator_;
std::vector<std::unique_ptr<libcamera::Request>> requests_; std::vector<std::unique_ptr<libcamera::Request>> requests_;
}; };
#endif /* __CAM_CAMERA_SESSION_H__ */

View file

@ -4,8 +4,8 @@
* *
* drm.h - DRM/KMS Helpers * drm.h - DRM/KMS Helpers
*/ */
#ifndef __CAM_DRM_H__
#define __CAM_DRM_H__ #pragma once
#include <array> #include <array>
#include <list> #include <list>
@ -330,5 +330,3 @@ private:
}; };
} /* namespace DRM */ } /* namespace DRM */
#endif /* __CAM_DRM_H__ */

View file

@ -4,8 +4,8 @@
* *
* event_loop.h - cam - Event loop * event_loop.h - cam - Event loop
*/ */
#ifndef __CAM_EVENT_LOOP_H__
#define __CAM_EVENT_LOOP_H__ #pragma once
#include <functional> #include <functional>
#include <memory> #include <memory>
@ -61,5 +61,3 @@ private:
void *param); void *param);
void dispatchCall(); void dispatchCall();
}; };
#endif /* __CAM_EVENT_LOOP_H__ */

View file

@ -4,8 +4,8 @@
* *
* file_sink.h - File Sink * file_sink.h - File Sink
*/ */
#ifndef __CAM_FILE_SINK_H__
#define __CAM_FILE_SINK_H__ #pragma once
#include <map> #include <map>
#include <memory> #include <memory>
@ -38,5 +38,3 @@ private:
std::string pattern_; std::string pattern_;
std::map<libcamera::FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_; std::map<libcamera::FrameBuffer *, std::unique_ptr<Image>> mappedBuffers_;
}; };
#endif /* __CAM_FILE_SINK_H__ */

View file

@ -4,8 +4,8 @@
* *
* frame_sink.h - Base Frame Sink Class * frame_sink.h - Base Frame Sink Class
*/ */
#ifndef __CAM_FRAME_SINK_H__
#define __CAM_FRAME_SINK_H__ #pragma once
#include <libcamera/base/signal.h> #include <libcamera/base/signal.h>
@ -30,5 +30,3 @@ public:
virtual bool processRequest(libcamera::Request *request) = 0; virtual bool processRequest(libcamera::Request *request) = 0;
libcamera::Signal<libcamera::Request *> requestProcessed; libcamera::Signal<libcamera::Request *> requestProcessed;
}; };
#endif /* __CAM_FRAME_SINK_H__ */

View file

@ -4,8 +4,8 @@
* *
* image.h - Multi-planar image with access to pixel data * image.h - Multi-planar image with access to pixel data
*/ */
#ifndef __CAM_IMAGE_H__
#define __CAM_IMAGE_H__ #pragma once
#include <memory> #include <memory>
#include <stdint.h> #include <stdint.h>
@ -48,5 +48,3 @@ private:
namespace libcamera { namespace libcamera {
LIBCAMERA_FLAGS_ENABLE_OPERATORS(Image::MapMode) LIBCAMERA_FLAGS_ENABLE_OPERATORS(Image::MapMode)
} }
#endif /* __CAM_IMAGE_H__ */

View file

@ -4,8 +4,8 @@
* *
* kms_sink.h - KMS Sink * kms_sink.h - KMS Sink
*/ */
#ifndef __CAM_KMS_SINK_H__
#define __CAM_KMS_SINK_H__ #pragma once
#include <list> #include <list>
#include <memory> #include <memory>
@ -68,5 +68,3 @@ private:
std::unique_ptr<Request> queued_; std::unique_ptr<Request> queued_;
std::unique_ptr<Request> active_; std::unique_ptr<Request> active_;
}; };
#endif /* __CAM_KMS_SINK_H__ */

View file

@ -4,8 +4,8 @@
* *
* main.h - Cam application * main.h - Cam application
*/ */
#ifndef __CAM_MAIN_H__
#define __CAM_MAIN_H__ #pragma once
enum { enum {
OptCamera = 'c', OptCamera = 'c',
@ -22,5 +22,3 @@ enum {
OptStrictFormats = 257, OptStrictFormats = 257,
OptMetadata = 258, OptMetadata = 258,
}; };
#endif /* __CAM_MAIN_H__ */

View file

@ -4,8 +4,8 @@
* *
* options.h - cam - Options parsing * options.h - cam - Options parsing
*/ */
#ifndef __CAM_OPTIONS_H__
#define __CAM_OPTIONS_H__ #pragma once
#include <ctype.h> #include <ctype.h>
#include <list> #include <list>
@ -155,5 +155,3 @@ private:
std::vector<OptionValue> array_; std::vector<OptionValue> array_;
OptionsParser::Options children_; OptionsParser::Options children_;
}; };
#endif /* __CAM_OPTIONS_H__ */

View file

@ -4,8 +4,8 @@
* *
* stream_options.h - Helper to parse options for streams * stream_options.h - Helper to parse options for streams
*/ */
#ifndef __CAM_STREAM_OPTIONS_H__
#define __CAM_STREAM_OPTIONS_H__ #pragma once
#include <libcamera/camera.h> #include <libcamera/camera.h>
@ -26,5 +26,3 @@ private:
static bool parseRole(libcamera::StreamRole *role, static bool parseRole(libcamera::StreamRole *role,
const KeyValueParser::Options &options); const KeyValueParser::Options &options);
}; };
#endif /* __CAM_STREAM_OPTIONS_H__ */