[libcamera-devel,05/15] libcamera: pipeline: Convert to pragma once
diff mbox series

Message ID 20211123224015.3619282-6-kieran.bingham@ideasonboard.com
State Accepted
Delegated to: Kieran Bingham
Headers show
Series
  • Use pragma once
Related show

Commit Message

Kieran Bingham Nov. 23, 2021, 10:40 p.m. UTC
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>
---
 src/libcamera/pipeline/ipu3/cio2.h              | 6 ++----
 src/libcamera/pipeline/ipu3/frames.h            | 6 ++----
 src/libcamera/pipeline/ipu3/imgu.h              | 6 ++----
 src/libcamera/pipeline/raspberrypi/dma_heaps.h  | 6 ++----
 src/libcamera/pipeline/raspberrypi/rpi_stream.h | 6 ++----
 src/libcamera/pipeline/rkisp1/rkisp1_path.h     | 6 ++----
 src/libcamera/pipeline/simple/converter.h       | 5 +----
 7 files changed, 13 insertions(+), 28 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h
index ba8f0052c5b3..68504a2da89d 100644
--- a/src/libcamera/pipeline/ipu3/cio2.h
+++ b/src/libcamera/pipeline/ipu3/cio2.h
@@ -4,8 +4,8 @@ 
  *
  * cio2.h - Intel IPU3 CIO2
  */
-#ifndef __LIBCAMERA_PIPELINE_IPU3_CIO2_H__
-#define __LIBCAMERA_PIPELINE_IPU3_CIO2_H__
+
+#pragma once
 
 #include <memory>
 #include <queue>
@@ -75,5 +75,3 @@  private:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_IPU3_CIO2_H__ */
diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h
index 614701e2da2d..6e3cb915c7b8 100644
--- a/src/libcamera/pipeline/ipu3/frames.h
+++ b/src/libcamera/pipeline/ipu3/frames.h
@@ -4,8 +4,8 @@ 
  *
  * frames.h - Intel IPU3 Frames helper
  */
-#ifndef __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__
-#define __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__
+
+#pragma once
 
 #include <map>
 #include <memory>
@@ -65,5 +65,3 @@  private:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__ */
diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h
index 2b28d912676a..0af4dd8ae86e 100644
--- a/src/libcamera/pipeline/ipu3/imgu.h
+++ b/src/libcamera/pipeline/ipu3/imgu.h
@@ -4,8 +4,8 @@ 
  *
  * imgu.h - Intel IPU3 ImgU
  */
-#ifndef __LIBCAMERA_PIPELINE_IPU3_IMGU_H__
-#define __LIBCAMERA_PIPELINE_IPU3_IMGU_H__
+
+#pragma once
 
 #include <memory>
 #include <string>
@@ -122,5 +122,3 @@  private:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_IPU3_IMGU_H__ */
diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
index 79f39c5153d3..38dfc242c0b9 100644
--- a/src/libcamera/pipeline/raspberrypi/dma_heaps.h
+++ b/src/libcamera/pipeline/raspberrypi/dma_heaps.h
@@ -4,8 +4,8 @@ 
  *
  * dma_heaps.h - Helper class for dma-heap allocations.
  */
-#ifndef __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__
-#define __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__
+
+#pragma once
 
 #include <libcamera/file_descriptor.h>
 
@@ -28,5 +28,3 @@  private:
 } /* namespace RPi */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ */
diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/raspberrypi/rpi_stream.h
index f1ac715f4221..d6f49d34f8c8 100644
--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.h
+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.h
@@ -4,8 +4,8 @@ 
  *
  * rpi_stream.h - Raspberry Pi device stream abstraction class.
  */
-#ifndef __LIBCAMERA_PIPELINE_RPI_STREAM_H__
-#define __LIBCAMERA_PIPELINE_RPI_STREAM_H__
+
+#pragma once
 
 #include <queue>
 #include <string>
@@ -177,5 +177,3 @@  public:
 } /* namespace RPi */
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_RPI_STREAM_H__ */
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
index 91757600ccdc..f3f1ae391d65 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h
+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
@@ -4,8 +4,8 @@ 
  *
  * rkisp1path.h - Rockchip ISP1 path helper
  */
-#ifndef __LIBCAMERA_PIPELINE_RKISP1_PATH_H__
-#define __LIBCAMERA_PIPELINE_RKISP1_PATH_H__
+
+#pragma once
 
 #include <memory>
 #include <vector>
@@ -84,5 +84,3 @@  public:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_RKISP1_PATH_H__ */
diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h
index 276a2a291c21..f0ebe2e0123d 100644
--- a/src/libcamera/pipeline/simple/converter.h
+++ b/src/libcamera/pipeline/simple/converter.h
@@ -5,8 +5,7 @@ 
  * converter.h - Format converter for simple pipeline handler
  */
 
-#ifndef __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__
-#define __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__
+#pragma once
 
 #include <functional>
 #include <map>
@@ -97,5 +96,3 @@  private:
 };
 
 } /* namespace libcamera */
-
-#endif /* __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ */