From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: eudev@lists.gentoo.org
Cc: marcus.folkesson@gmail.com
Subject: [eudev] [PATCH] use #pragma once for header files
Date: Mon, 4 Dec 2017 12:34:09 +0100 [thread overview]
Message-ID: <20171204113409.14829-1-marcus.folkesson@gmail.com> (raw)
Some headerfiles are missing "#pragma once" or corresponding
"#ifndef..." which may result in build error if multiple source files
include the same file.
Add "#pragma once" for concerned files.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
src/mtd_probe/mtd_probe.h | 2 ++
src/scsi_id/scsi.h | 2 ++
src/scsi_id/scsi_id.h | 2 ++
src/shared/device-nodes.h | 2 ++
src/shared/fileio.h | 2 ++
src/shared/path-util.h | 2 ++
src/shared/siphash24.h | 3 +++
src/shared/socket-util.h | 2 ++
src/udev/udevadm-util.h | 2 ++
9 files changed, 19 insertions(+)
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/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/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/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
next reply other threads:[~2017-12-04 11:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 11:34 Marcus Folkesson [this message]
2017-12-05 18:15 ` [eudev] [PATCH] use #pragma once for header files Anthony G. Basile
2017-12-05 18:28 ` Marcus Folkesson
2017-12-06 12:27 ` Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171204113409.14829-1-marcus.folkesson@gmail.com \
--to=marcus.folkesson@gmail.com \
--cc=eudev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox