Patch Detail
Show a patch.
GET /api/patches/14732/?format=api
{ "id": 14732, "url": "https://patchwork.libcamera.org/api/patches/14732/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14732/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211123224015.3619282-2-kieran.bingham@ideasonboard.com>", "date": "2021-11-23T22:40:01", "name": "[libcamera-devel,01/15] libcamera: Convert to pragma once", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ddfcceaa23656e1b8960b7bfaa99c6beea34801e", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": { "id": 11, "url": "https://patchwork.libcamera.org/api/users/11/?format=api", "username": "kbingham", "first_name": "Kieran", "last_name": "Bingham", "email": "kieran.bingham@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/patch/14732/mbox/", "series": [ { "id": 2749, "url": "https://patchwork.libcamera.org/api/series/2749/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2749", "date": "2021-11-23T22:40:00", "name": "Use pragma once", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2749/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14732/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14732/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 19C22BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 23 Nov 2021 22:40:28 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4BD44603EE;\n\tTue, 23 Nov 2021 23:40:24 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB7CB60228\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Nov 2021 23:40:20 +0100 (CET)", "from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D914F95;\n\tTue, 23 Nov 2021 23:40:20 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Wy7lIL0f\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637707220;\n\tbh=74m8OXe9H9PaYz/jipGEMDd4dO7DHvs9q427ZDBib68=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Wy7lIL0fz7o7GzlJsGwP9iCWgyjWwUHkVY4mAQk5f/2hnWDb+aJnNTSF9AppvS2UV\n\tLrtA45UfTmb6azPZRTeQrxdZILv1P4STnVqGIaFMcGWJKN9hWaFc9oj0gKJ/KWZUBv\n\tq/Q77AwBJZfsA2bcrOHNXl1lMyOG2tFC6QXInhvg=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Tue, 23 Nov 2021 22:40:01 +0000", "Message-Id": "<20211123224015.3619282-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20211123224015.3619282-1-kieran.bingham@ideasonboard.com>", "References": "<20211123224015.3619282-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 01/15] libcamera: Convert to pragma once", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Remove the verbose #ifndef/#define/#endif pattern for maintaining\nheader idempotency, and replace it with a simple #pragma once.\n\nThis simplifies the headers, and prevents redundant changes when\nheader files get moved.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/camera.h | 6 ++----\n include/libcamera/camera_manager.h | 6 ++----\n include/libcamera/compiler.h | 6 ++----\n include/libcamera/control_ids.h.in | 5 +----\n include/libcamera/controls.h | 5 +----\n include/libcamera/file_descriptor.h | 6 ++----\n include/libcamera/formats.h.in | 6 ++----\n include/libcamera/framebuffer.h | 6 ++----\n include/libcamera/framebuffer_allocator.h | 6 ++----\n include/libcamera/geometry.h | 5 +----\n include/libcamera/logging.h | 6 ++----\n include/libcamera/pixel_format.h | 6 ++----\n include/libcamera/property_ids.h.in | 5 +----\n include/libcamera/request.h | 6 ++----\n include/libcamera/stream.h | 6 ++----\n include/libcamera/transform.h | 5 +----\n include/libcamera/version.h.in | 6 ++----\n 17 files changed, 29 insertions(+), 68 deletions(-)", "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 601ee46e415b..a7759ccb957e 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -4,8 +4,8 @@\n *\n * camera.h - Camera object interface\n */\n-#ifndef __LIBCAMERA_CAMERA_H__\n-#define __LIBCAMERA_CAMERA_H__\n+\n+#pragma once\n \n #include <memory>\n #include <set>\n@@ -121,5 +121,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_CAMERA_H__ */\ndiff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h\nindex 744e5a06c78c..7647c2a1c43c 100644\n--- a/include/libcamera/camera_manager.h\n+++ b/include/libcamera/camera_manager.h\n@@ -4,8 +4,8 @@\n *\n * camera_manager.h - Camera management\n */\n-#ifndef __LIBCAMERA_CAMERA_MANAGER_H__\n-#define __LIBCAMERA_CAMERA_MANAGER_H__\n+\n+#pragma once\n \n #include <memory>\n #include <string>\n@@ -51,5 +51,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_CAMERA_MANAGER_H__ */\ndiff --git a/include/libcamera/compiler.h b/include/libcamera/compiler.h\nindex dc56dbb8b792..02564f2f8b5c 100644\n--- a/include/libcamera/compiler.h\n+++ b/include/libcamera/compiler.h\n@@ -4,13 +4,11 @@\n *\n * compiler.h - Compiler support\n */\n-#ifndef __LIBCAMERA_COMPILER_H__\n-#define __LIBCAMERA_COMPILER_H__\n+\n+#pragma once\n \n #if __cplusplus >= 201703L\n #define __nodiscard\t\t[[nodiscard]]\n #else\n #define __nodiscard\n #endif\n-\n-#endif /* __LIBCAMERA_COMPILER_H__ */\ndiff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in\nindex 7edeb6b65e32..0718a8886f6c 100644\n--- a/include/libcamera/control_ids.h.in\n+++ b/include/libcamera/control_ids.h.in\n@@ -7,8 +7,7 @@\n * This file is auto-generated. Do not edit.\n */\n \n-#ifndef __LIBCAMERA_CONTROL_IDS_H__\n-#define __LIBCAMERA_CONTROL_IDS_H__\n+#pragma once\n \n #include <array>\n #include <stdint.h>\n@@ -36,5 +35,3 @@ ${draft_controls}\n } /* namespace controls */\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_CONTROL_IDS_H__ */\ndiff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex af851b4661c8..665bcac1d9aa 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -5,8 +5,7 @@\n * controls.h - Control handling\n */\n \n-#ifndef __LIBCAMERA_CONTROLS_H__\n-#define __LIBCAMERA_CONTROLS_H__\n+#pragma once\n \n #include <assert.h>\n #include <set>\n@@ -421,5 +420,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_CONTROLS_H__ */\ndiff --git a/include/libcamera/file_descriptor.h b/include/libcamera/file_descriptor.h\nindex 988f9b7a3d25..8d764f8b4a26 100644\n--- a/include/libcamera/file_descriptor.h\n+++ b/include/libcamera/file_descriptor.h\n@@ -4,8 +4,8 @@\n *\n * file_descriptor.h - File descriptor wrapper\n */\n-#ifndef __LIBCAMERA_FILE_DESCRIPTOR_H__\n-#define __LIBCAMERA_FILE_DESCRIPTOR_H__\n+\n+#pragma once\n \n #include <memory>\n #include <sys/types.h>\n@@ -47,5 +47,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_FILE_DESCRIPTOR_H__ */\ndiff --git a/include/libcamera/formats.h.in b/include/libcamera/formats.h.in\nindex 8e7b95812afa..ead5287d8299 100644\n--- a/include/libcamera/formats.h.in\n+++ b/include/libcamera/formats.h.in\n@@ -6,8 +6,8 @@\n *\n * This file is auto-generated. Do not edit.\n */\n-#ifndef __LIBCAMERA_FORMATS_H__\n-#define __LIBCAMERA_FORMATS_H__\n+\n+#pragma once\n \n #include <stdint.h>\n \n@@ -40,5 +40,3 @@ ${formats}\n } /* namespace formats */\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_FORMATS_H__ */\ndiff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex 7f2f176af691..4e710e332370 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -4,8 +4,8 @@\n *\n * framebuffer.h - Frame buffer handling\n */\n-#ifndef __LIBCAMERA_FRAMEBUFFER_H__\n-#define __LIBCAMERA_FRAMEBUFFER_H__\n+\n+#pragma once\n \n #include <assert.h>\n #include <limits>\n@@ -81,5 +81,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_FRAMEBUFFER_H__ */\ndiff --git a/include/libcamera/framebuffer_allocator.h b/include/libcamera/framebuffer_allocator.h\nindex cbc9ce101889..45ff232b3d04 100644\n--- a/include/libcamera/framebuffer_allocator.h\n+++ b/include/libcamera/framebuffer_allocator.h\n@@ -4,8 +4,8 @@\n *\n * framebuffer_allocator.h - FrameBuffer allocator\n */\n-#ifndef __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__\n-#define __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__\n+\n+#pragma once\n \n #include <map>\n #include <memory>\n@@ -39,5 +39,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__ */\ndiff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h\nindex fa7ae7bce8db..713f71c180c6 100644\n--- a/include/libcamera/geometry.h\n+++ b/include/libcamera/geometry.h\n@@ -5,8 +5,7 @@\n * geometry.h - Geometry-related classes\n */\n \n-#ifndef __LIBCAMERA_GEOMETRY_H__\n-#define __LIBCAMERA_GEOMETRY_H__\n+#pragma once\n \n #include <algorithm>\n #include <string>\n@@ -293,5 +292,3 @@ static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs)\n }\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_GEOMETRY_H__ */\ndiff --git a/include/libcamera/logging.h b/include/libcamera/logging.h\nindex 2b6dd3f4cff2..c36882b91974 100644\n--- a/include/libcamera/logging.h\n+++ b/include/libcamera/logging.h\n@@ -4,8 +4,8 @@\n *\n * logging.h - Logging infrastructure\n */\n-#ifndef __LIBCAMERA_LOGGING_H__\n-#define __LIBCAMERA_LOGGING_H__\n+\n+#pragma once\n \n namespace libcamera {\n \n@@ -22,5 +22,3 @@ int logSetTarget(LoggingTarget target);\n void logSetLevel(const char *category, const char *level);\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_LOGGING_H__ */\ndiff --git a/include/libcamera/pixel_format.h b/include/libcamera/pixel_format.h\nindex c4ae088397cb..a9d7c03de851 100644\n--- a/include/libcamera/pixel_format.h\n+++ b/include/libcamera/pixel_format.h\n@@ -4,8 +4,8 @@\n *\n * pixel_format.h - libcamera Pixel Format\n */\n-#ifndef __LIBCAMERA_PIXEL_FORMAT_H__\n-#define __LIBCAMERA_PIXEL_FORMAT_H__\n+\n+#pragma once\n \n #include <set>\n #include <stdint.h>\n@@ -46,5 +46,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_PIXEL_FORMAT_H__ */\ndiff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in\nindex 52646c1f78ae..ff0194083af0 100644\n--- a/include/libcamera/property_ids.h.in\n+++ b/include/libcamera/property_ids.h.in\n@@ -7,8 +7,7 @@\n * This file is auto-generated. Do not edit.\n */\n \n-#ifndef __LIBCAMERA_PROPERTY_IDS_H__\n-#define __LIBCAMERA_PROPERTY_IDS_H__\n+#pragma once\n \n #include <stdint.h>\n \n@@ -35,5 +34,3 @@ extern const ControlIdMap properties;\n } /* namespace properties */\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_PROPERTY_IDS_H__ */\ndiff --git a/include/libcamera/request.h b/include/libcamera/request.h\nindex d16904e6b679..f434335b243a 100644\n--- a/include/libcamera/request.h\n+++ b/include/libcamera/request.h\n@@ -4,8 +4,8 @@\n *\n * request.h - Capture request handling\n */\n-#ifndef __LIBCAMERA_REQUEST_H__\n-#define __LIBCAMERA_REQUEST_H__\n+\n+#pragma once\n \n #include <map>\n #include <memory>\n@@ -83,5 +83,3 @@ private:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_REQUEST_H__ */\ndiff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 0c55e7164592..41ec02b17b91 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -4,8 +4,8 @@\n *\n * stream.h - Video stream for a Camera\n */\n-#ifndef __LIBCAMERA_STREAM_H__\n-#define __LIBCAMERA_STREAM_H__\n+\n+#pragma once\n \n #include <map>\n #include <memory>\n@@ -81,5 +81,3 @@ protected:\n };\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_STREAM_H__ */\ndiff --git a/include/libcamera/transform.h b/include/libcamera/transform.h\nindex 71b43da7c89f..2e76b9405b2e 100644\n--- a/include/libcamera/transform.h\n+++ b/include/libcamera/transform.h\n@@ -5,8 +5,7 @@\n * transform.h - 2D plane transforms\n */\n \n-#ifndef __LIBCAMERA_TRANSFORM_H__\n-#define __LIBCAMERA_TRANSFORM_H__\n+#pragma once\n \n #include <string>\n \n@@ -74,5 +73,3 @@ Transform transformFromRotation(int angle, bool *success = nullptr);\n const char *transformToString(Transform t);\n \n } /* namespace libcamera */\n-\n-#endif /* __LIBCAMERA_TRANSFORM_H__ */\ndiff --git a/include/libcamera/version.h.in b/include/libcamera/version.h.in\nindex 5e9a30911d12..6e24d0a89fcb 100644\n--- a/include/libcamera/version.h.in\n+++ b/include/libcamera/version.h.in\n@@ -6,11 +6,9 @@\n *\n * This file is auto-generated. Do not edit.\n */\n-#ifndef __LIBCAMERA_VERSION_H__\n-#define __LIBCAMERA_VERSION_H__\n+\n+#pragma once\n \n #define LIBCAMERA_VERSION_MAJOR\t\t@LIBCAMERA_VERSION_MAJOR@\n #define LIBCAMERA_VERSION_MINOR\t\t@LIBCAMERA_VERSION_MINOR@\n #define LIBCAMERA_VERSION_PATCH\t\t@LIBCAMERA_VERSION_PATCH@\n-\n-#endif /* __LIBCAMERA_VERSION_H__ */\n", "prefixes": [ "libcamera-devel", "01/15" ] }