summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2020-01-21 10:11:56 +0000
committerRichard Hughes <richard@hughsie.com>2020-01-21 10:33:11 +0000
commit050707179012e4ce3a24886b008537c99c77809f (patch)
tree26e3d3ae96ea7b8213e30e31669c4a9fa3bf6423
parentdfaec95d34f6f066d191cc286192c8c09b4686a8 (diff)
downloadgusb-050707179012e4ce3a24886b008537c99c77809f.tar.gz
Use '#pragma once' to reduce boilerplate
-rw-r--r--gusb/gusb-autocleanups.h5
-rw-r--r--gusb/gusb-context-private.h5
-rw-r--r--gusb/gusb-context.h5
-rw-r--r--gusb/gusb-device-list.h5
-rw-r--r--gusb/gusb-device-private.h5
-rw-r--r--gusb/gusb-device.h5
-rw-r--r--gusb/gusb-endpoint-private.h5
-rw-r--r--gusb/gusb-endpoint.h5
-rw-r--r--gusb/gusb-interface-private.h5
-rw-r--r--gusb/gusb-interface.h5
-rw-r--r--gusb/gusb-private.h6
-rw-r--r--gusb/gusb-source.h5
-rw-r--r--gusb/gusb-util.h5
-rw-r--r--gusb/gusb-version.h.in5
-rw-r--r--gusb/gusb.h6
15 files changed, 15 insertions, 62 deletions
diff --git a/gusb/gusb-autocleanups.h b/gusb/gusb-autocleanups.h
index 63f3b11..ad71b57 100644
--- a/gusb/gusb-autocleanups.h
+++ b/gusb/gusb-autocleanups.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_AUTOCLEANUPS_H__
-#define __GUSB_AUTOCLEANUPS_H__
+#pragma once
#include <gusb/gusb-context.h>
#include <gusb/gusb-device.h>
@@ -19,5 +18,3 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUsbDevice, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUsbDeviceList, g_object_unref)
#endif
-
-#endif /* __GUSB_AUTOCLEANUPS_H__ */
diff --git a/gusb/gusb-context-private.h b/gusb/gusb-context-private.h
index f5e60de..c3ef226 100644
--- a/gusb/gusb-context-private.h
+++ b/gusb/gusb-context-private.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_CONTEXT_PRIVATE_H__
-#define __GUSB_CONTEXT_PRIVATE_H__
+#pragma once
#include <libusb.h>
@@ -25,5 +24,3 @@ const gchar *_g_usb_context_lookup_product (GUsbContext *context,
GError **error);
G_END_DECLS
-
-#endif /* __GUSB_CONTEXT_PRIVATE_H__ */
diff --git a/gusb/gusb-context.h b/gusb/gusb-context.h
index e447c29..27b337d 100644
--- a/gusb/gusb-context.h
+++ b/gusb/gusb-context.h
@@ -6,8 +6,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_CONTEXT_H__
-#define __GUSB_CONTEXT_H__
+#pragma once
#include <glib-object.h>
@@ -103,5 +102,3 @@ GUsbDevice *g_usb_context_wait_for_replug (GUsbContext *context,
GError **error);
G_END_DECLS
-
-#endif /* __GUSB_CONTEXT_H__ */
diff --git a/gusb/gusb-device-list.h b/gusb/gusb-device-list.h
index 1c9688f..cbc735b 100644
--- a/gusb/gusb-device-list.h
+++ b/gusb/gusb-device-list.h
@@ -6,8 +6,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_DEVICE_LIST_H__
-#define __GUSB_DEVICE_LIST_H__
+#pragma once
#include <glib-object.h>
@@ -70,5 +69,3 @@ GUsbDevice *g_usb_device_list_find_by_vid_pid (GUsbDeviceList *list,
GError **error);
G_END_DECLS
-
-#endif /* __GUSB_DEVICE_LIST_H__ */
diff --git a/gusb/gusb-device-private.h b/gusb/gusb-device-private.h
index b07ba94..0e05a54 100644
--- a/gusb/gusb-device-private.h
+++ b/gusb/gusb-device-private.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_DEVICE_PRIVATE_H__
-#define __GUSB_DEVICE_PRIVATE_H__
+#pragma once
#include <gusb/gusb-device.h>
@@ -21,5 +20,3 @@ gboolean _g_usb_device_open_internal (GUsbDevice *device,
GError **error);
G_END_DECLS
-
-#endif /* __GUSB_DEVICE_PRIVATE_H__ */
diff --git a/gusb/gusb-device.h b/gusb/gusb-device.h
index 97201c3..8f5a4f1 100644
--- a/gusb/gusb-device.h
+++ b/gusb/gusb-device.h
@@ -6,8 +6,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_DEVICE_H__
-#define __GUSB_DEVICE_H__
+#pragma once
#include <glib-object.h>
#include <gio/gio.h>
@@ -281,5 +280,3 @@ gssize g_usb_device_interrupt_transfer_finish (GUsbDevice *device,
GError **error);
G_END_DECLS
-
-#endif /* __GUSB_DEVICE_H__ */
diff --git a/gusb/gusb-endpoint-private.h b/gusb/gusb-endpoint-private.h
index a8b12b2..2646bb9 100644
--- a/gusb/gusb-endpoint-private.h
+++ b/gusb/gusb-endpoint-private.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_ENDPOINT_PRIVATE_H__
-#define __GUSB_ENDPOINT_PRIVATE_H__
+#pragma once
#include <libusb.h>
@@ -17,5 +16,3 @@ G_BEGIN_DECLS
GUsbEndpoint *_g_usb_endpoint_new (const struct libusb_endpoint_descriptor *endpoint);
G_END_DECLS
-
-#endif /* __GUSB_ENDPOINT_PRIVATE_H__ */
diff --git a/gusb/gusb-endpoint.h b/gusb/gusb-endpoint.h
index 21cbcb1..b6d32ee 100644
--- a/gusb/gusb-endpoint.h
+++ b/gusb/gusb-endpoint.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_ENDPOINT_H__
-#define __GUSB_ENDPOINT_H__
+#pragma once
#include <glib-object.h>
#include <gio/gio.h>
@@ -28,5 +27,3 @@ GUsbDeviceDirection g_usb_endpoint_get_direction (GUsbEndpoint *endpoint);
GBytes * g_usb_endpoint_get_extra (GUsbEndpoint *endpoint);
G_END_DECLS
-
-#endif /* __GUSB_ENDPOINT_H__ */
diff --git a/gusb/gusb-interface-private.h b/gusb/gusb-interface-private.h
index b92628b..7e5c992 100644
--- a/gusb/gusb-interface-private.h
+++ b/gusb/gusb-interface-private.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_INTERFACE_PRIVATE_H__
-#define __GUSB_INTERFACE_PRIVATE_H__
+#pragma once
#include <libusb.h>
@@ -17,5 +16,3 @@ G_BEGIN_DECLS
GUsbInterface *_g_usb_interface_new (const struct libusb_interface_descriptor *iface);
G_END_DECLS
-
-#endif /* __GUSB_INTERFACE_PRIVATE_H__ */
diff --git a/gusb/gusb-interface.h b/gusb/gusb-interface.h
index 02f8501..00592e3 100644
--- a/gusb/gusb-interface.h
+++ b/gusb/gusb-interface.h
@@ -6,8 +6,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_INTERFACE_H__
-#define __GUSB_INTERFACE_H__
+#pragma once
#include <glib-object.h>
#include <gio/gio.h>
@@ -29,5 +28,3 @@ GBytes *g_usb_interface_get_extra (GUsbInterface *interface);
GPtrArray *g_usb_interface_get_endpoints (GUsbInterface *interface);
G_END_DECLS
-
-#endif /* __GUSB_INTERFACE_H__ */
diff --git a/gusb/gusb-private.h b/gusb/gusb-private.h
index 4c32459..95ffacf 100644
--- a/gusb/gusb-private.h
+++ b/gusb/gusb-private.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_PRIVATE_H__
-#define __GUSB_PRIVATE_H__
+#pragma once
#define __GUSB_INSIDE__
@@ -15,6 +14,3 @@
#include <gusb/gusb-device-private.h>
#undef __GUSB_INSIDE__
-
-#endif /* __GUSB_PRIVATE_H__ */
-
diff --git a/gusb/gusb-source.h b/gusb/gusb-source.h
index 5085f0d..060cf21 100644
--- a/gusb/gusb-source.h
+++ b/gusb/gusb-source.h
@@ -6,8 +6,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_SOURCE_H__
-#define __GUSB_SOURCE_H__
+#pragma once
#include <glib.h>
@@ -36,5 +35,3 @@ void g_usb_source_set_callback (GUsbSource *source,
GDestroyNotify notify);
G_END_DECLS
-
-#endif /* __GUSB_SOURCE_H__ */
diff --git a/gusb/gusb-util.h b/gusb/gusb-util.h
index 2958e54..0db697e 100644
--- a/gusb/gusb-util.h
+++ b/gusb/gusb-util.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_UTIL_H__
-#define __GUSB_UTIL_H__
+#pragma once
#include <glib.h>
@@ -15,5 +14,3 @@ G_BEGIN_DECLS
const gchar* g_usb_strerror(gint error_code);
G_END_DECLS
-
-#endif /* __GUSB_UTIL_H__ */
diff --git a/gusb/gusb-version.h.in b/gusb/gusb-version.h.in
index b8a5639..cbede81 100644
--- a/gusb/gusb-version.h.in
+++ b/gusb/gusb-version.h.in
@@ -17,8 +17,7 @@
#error "Only <gusb.h> can be included directly."
#endif
-#ifndef __GUSB_VERSION_H
-#define __GUSB_VERSION_H
+#pragma once
#include <glib.h>
@@ -56,5 +55,3 @@
G_USB_MICRO_VERSION >= (micro)))
const gchar *g_usb_version_string (void);
-
-#endif /* __GUSB_VERSION_H */
diff --git a/gusb/gusb.h b/gusb/gusb.h
index cf5afad..e547285 100644
--- a/gusb/gusb.h
+++ b/gusb/gusb.h
@@ -5,8 +5,7 @@
* SPDX-License-Identifier: LGPL-2.1+
*/
-#ifndef __GUSB_H__
-#define __GUSB_H__
+#pragma once
#define __GUSB_INSIDE__
@@ -21,6 +20,3 @@
#include <gusb/gusb-util.h>
#undef __GUSB_INSIDE__
-
-#endif /* __GUSB_H__ */
-