From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <eudev+bounces-52-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AE304139083 for <garchives@archives.gentoo.org>; Wed, 6 Dec 2017 12:56:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE104E0F92; Wed, 6 Dec 2017 12:56:16 +0000 (UTC) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A5B59E0F92 for <eudev@lists.gentoo.org>; Wed, 6 Dec 2017 12:56:16 +0000 (UTC) Received: by mail-lf0-x244.google.com with SMTP id t197so4113029lfe.7 for <eudev@lists.gentoo.org>; Wed, 06 Dec 2017 04:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=AfSMFeQwSdPgQYT6mUtnnOFDKj7/CdUzupQnJ8585Xs=; b=kjuHD9acLaRtFbbRWCQtmq0UwF96xR9NxBEkaGyd9yV0zQZ1UZezJoA7yXC1hRUOhY yQe9VP6PkzsNxDW9cRoY0p/vDJYNFbbHsqXxi9gh0OuAj6ZqZ4RMbtSxyXjIg8XA0Qjm +TkOkG5V42ZpGHJMZY/p0h2g9lZtBZmo2uek6Lx0IzNR9qAOkt8Gj4aMcavTqaet3Uhd 0qhjFG8+NhR44zW0hMJOiCdjTXoQFTuy+Y4fiFvKQYUOl77eVzFfXOmzmgzUv4T/cXW0 3CtuoCWuRmSih6Efk7Qur8g7PVjjAFrsbrRDx7zfr3ChW4zUwnCTLpPaph4AGYSMXEiy l4NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AfSMFeQwSdPgQYT6mUtnnOFDKj7/CdUzupQnJ8585Xs=; b=EHNDuHXHmIPu0uYAHJKNmvMT2+GP+d8OjJlS/FxWPkSblnhTmaZDlctAx2DWhx9Q/r nDWf42wY2B/0DZfafeByo2dzv3fSpXPpAT3GUbLD35cE576xU/KZ+9yEbMPx6eXtOIvu RluwxXzAKar0fPT4v0Mwp4NCVIofKx1lPGJ/QEBDgdcPfGDRe5FoIyWVO9X4slRzqQvv rhgBk3H279bbsxchywfs0nmk4ScnlXCVGPNkhwPn+dJOkiFDMTh7AW04l0MBwuPAjEhU m2YvBhKdytDjKJnFB72CQ0yvFPkcL2eGPSSQmTdrC2XGJQTUeDXD/pwqssUy5ptY5Lj9 ZDiQ== X-Gm-Message-State: AJaThX7/taEfB2eCiFsRisHfjtat11rBH8eX66Nj5HNBbG76y5Lq+0zF Ab7cg+AMV7bDG/PD20jqgnrkJtN2iFQ= X-Google-Smtp-Source: AGs4zMYfsV/lVeFOw4ZkoAexUZRrZdHwSdp3RMGdSc6NvkB5NOcBGfGrsSG892bzG9wBdqZwm1uZLA== X-Received: by 10.46.66.140 with SMTP id h12mr12200107ljf.140.1512564974747; Wed, 06 Dec 2017 04:56:14 -0800 (PST) Received: from localhost.localdomain (c-5eea33aa-74736162.cust.telenor.se. [94.234.51.170]) by smtp.gmail.com with ESMTPSA id z10sm539171ljb.75.2017.12.06.04.56.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 04:56:13 -0800 (PST) From: Marcus Folkesson <marcus.folkesson@gmail.com> To: eudev@lists.gentoo.org Cc: blueness@gentoo.org, Marcus Folkesson <marcus.folkesson@gmail.com> Subject: [eudev] [PATCH v2] consistently use #pragma once for header files Date: Wed, 6 Dec 2017 13:56:04 +0100 Message-Id: <20171206125604.18125-1-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.0 Precedence: bulk List-Post: <mailto:eudev@lists.gentoo.org> List-Help: <mailto:eudev+help@lists.gentoo.org> List-Unsubscribe: <mailto:eudev+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:eudev+subscribe@lists.gentoo.org> List-Id: eudev mailing list <eudev.gentoo.org> X-BeenThere: eudev@gentoo.org X-BeenThere: eudev@lists.gentoo.org X-Archives-Salt: a24dd020-e956-4a4e-a125-5350a0787035 X-Archives-Hash: 609b9d4eb16fa30de6e11ed142e2117c Some headerfiles are missing "#pragma once" or corresponding "#ifndef..." which may result in build error if multiple source files include the same file. Use "#pragma once" for all header files. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> --- v2: - Convert all #ifndef... to #pragma once - Add *consistently* to patch description src/libudev/libudev-hwdb-def.h | 5 +---- src/libudev/libudev-private.h | 5 +---- src/libudev/libudev.h | 5 +---- src/mtd_probe/mtd_probe.h | 2 ++ src/scsi_id/scsi.h | 2 ++ src/scsi_id/scsi_id.h | 2 ++ src/shared/MurmurHash2.h | 5 +---- src/shared/device-nodes.h | 2 ++ src/shared/fileio.h | 2 ++ src/shared/ioprio.h | 5 +---- src/shared/path-util.h | 2 ++ src/shared/siphash24.h | 3 +++ src/shared/socket-util.h | 2 ++ src/shared/sparse-endian.h | 6 ++---- src/udev/udevadm-util.h | 2 ++ 15 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/libudev/libudev-hwdb-def.h b/src/libudev/libudev-hwdb-def.h index b76a13f3e..9fc60d258 100644 --- a/src/libudev/libudev-hwdb-def.h +++ b/src/libudev/libudev-hwdb-def.h @@ -17,8 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#ifndef _LIBUDEV_HWDB_DEF_H_ -#define _LIBUDEV_HWDB_DEF_H_ +#pragma once #include "sparse-endian.h" @@ -70,5 +69,3 @@ struct trie_value_entry_f { le64_t key_off; le64_t value_off; } _packed_; - -#endif diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index 514bdde14..8d05994b6 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -17,8 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#ifndef _LIBUDEV_PRIVATE_H_ -#define _LIBUDEV_PRIVATE_H_ +#pragma once #include <signal.h> #include <stdint.h> @@ -150,5 +149,3 @@ uint64_t util_string_bloom64(const char *str); /* libudev-util-private.c */ int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value); - -#endif diff --git a/src/libudev/libudev.h b/src/libudev/libudev.h index 0da4c9214..8491d2b81 100644 --- a/src/libudev/libudev.h +++ b/src/libudev/libudev.h @@ -17,8 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#ifndef _LIBUDEV_H_ -#define _LIBUDEV_H_ +#pragma once #include <stdarg.h> #include <sys/sysmacros.h> @@ -205,5 +204,3 @@ int udev_util_encode_string(const char *str, char *str_enc, size_t len); #ifdef __cplusplus } /* extern "C" */ #endif - -#endif diff --git a/src/mtd_probe/mtd_probe.h b/src/mtd_probe/mtd_probe.h index e048a0122..caea5c269 100644 --- a/src/mtd_probe/mtd_probe.h +++ b/src/mtd_probe/mtd_probe.h @@ -17,6 +17,8 @@ * Boston, MA 02110-1301 USA */ +#pragma once + #include <mtd/mtd-user.h> #include "macro.h" diff --git a/src/scsi_id/scsi.h b/src/scsi_id/scsi.h index c423cac57..3f99ae772 100644 --- a/src/scsi_id/scsi.h +++ b/src/scsi_id/scsi.h @@ -10,6 +10,8 @@ * Free Software Foundation version 2 of the License. */ +#pragma once + #include <scsi/scsi.h> struct scsi_ioctl_command { diff --git a/src/scsi_id/scsi_id.h b/src/scsi_id/scsi_id.h index 648b5ce42..141b116a8 100644 --- a/src/scsi_id/scsi_id.h +++ b/src/scsi_id/scsi_id.h @@ -15,6 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#pragma once + #define MAX_PATH_LEN 512 /* diff --git a/src/shared/MurmurHash2.h b/src/shared/MurmurHash2.h index 93362dd48..7dc0b8365 100644 --- a/src/shared/MurmurHash2.h +++ b/src/shared/MurmurHash2.h @@ -2,8 +2,7 @@ // MurmurHash2 was written by Austin Appleby, and is placed in the public // domain. The author hereby disclaims copyright to this source code. -#ifndef _MURMURHASH2_H_ -#define _MURMURHASH2_H_ +#pragma once //----------------------------------------------------------------------------- // Platform-specific functions and macros @@ -29,5 +28,3 @@ typedef unsigned __int64 uint64_t; uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed ); //----------------------------------------------------------------------------- - -#endif // _MURMURHASH2_H_ diff --git a/src/shared/device-nodes.h b/src/shared/device-nodes.h index d27ac0906..5df53e8c0 100644 --- a/src/shared/device-nodes.h +++ b/src/shared/device-nodes.h @@ -17,5 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#pragma once + int encode_devnode_name(const char *str, char *str_enc, size_t len); int whitelisted_char_for_devnode(char c, const char *additional); diff --git a/src/shared/fileio.h b/src/shared/fileio.h index 641bf0230..7beed2eb8 100644 --- a/src/shared/fileio.h +++ b/src/shared/fileio.h @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#pragma once + #include <stddef.h> #include <stdio.h> diff --git a/src/shared/ioprio.h b/src/shared/ioprio.h index 950e59b23..7f047d255 100644 --- a/src/shared/ioprio.h +++ b/src/shared/ioprio.h @@ -1,5 +1,4 @@ -#ifndef IOPRIO_H -#define IOPRIO_H +#pragma once /* This is minimal version of Linux' linux/ioprio.h header file, which * is licensed GPL2 */ @@ -16,5 +15,3 @@ enum { IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, }; - -#endif diff --git a/src/shared/path-util.h b/src/shared/path-util.h index 0123c2609..1d15d4c0f 100644 --- a/src/shared/path-util.h +++ b/src/shared/path-util.h @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#pragma once + #include <stdbool.h> #include "macro.h" diff --git a/src/shared/siphash24.h b/src/shared/siphash24.h index 3253c179b..c2c19b437 100644 --- a/src/shared/siphash24.h +++ b/src/shared/siphash24.h @@ -1,3 +1,6 @@ + +#pragma once + #include <inttypes.h> #include <sys/types.h> diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h index 2daa3279f..52b8dff66 100644 --- a/src/shared/socket-util.h +++ b/src/shared/socket-util.h @@ -17,6 +17,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#pragma once + #include <sys/socket.h> #include <netinet/in.h> #include <sys/un.h> diff --git a/src/shared/sparse-endian.h b/src/shared/sparse-endian.h index c913fda8c..7b7fa52dd 100644 --- a/src/shared/sparse-endian.h +++ b/src/shared/sparse-endian.h @@ -18,8 +18,8 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ -#ifndef SPARSE_ENDIAN_H -#define SPARSE_ENDIAN_H + +#pragma once #include <byteswap.h> #include <endian.h> @@ -84,5 +84,3 @@ static inline uint64_t le64toh(le64_t value) { return bswap_64_on_be((uint64_t _ static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __force)value); } static inline uint32_t be32toh(be32_t value) { return bswap_32_on_le((uint32_t __force)value); } static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t __force)value); } - -#endif /* SPARSE_ENDIAN_H */ diff --git a/src/udev/udevadm-util.h b/src/udev/udevadm-util.h index dba651fdd..37e4fe836 100644 --- a/src/udev/udevadm-util.h +++ b/src/udev/udevadm-util.h @@ -15,6 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#pragma once + #include "udev.h" struct udev_device *find_device(struct udev *udev, -- 2.15.0