[gnome-bluetooth/wip/hadess/cleanups: 13/24] lib: Simplify single-include




commit 1421fc73dd8402df9fd80537a1750ae8c00ef54e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 10 16:38:10 2021 +0100

    lib: Simplify single-include

 lib/bluetooth-agent.h                     |  9 +--------
 lib/bluetooth-chooser-button.h            |  9 +--------
 lib/bluetooth-chooser-combo.h             |  9 +--------
 lib/bluetooth-chooser-private.h           |  9 +--------
 lib/bluetooth-chooser.h                   |  9 +--------
 lib/bluetooth-client-private.h            |  9 +--------
 lib/bluetooth-client.h                    |  9 +--------
 lib/bluetooth-enums.h                     |  9 +--------
 lib/bluetooth-filter-widget.h             |  9 +--------
 lib/bluetooth-hdy-column.h                |  4 ----
 lib/bluetooth-pairing-dialog.h            |  9 +--------
 lib/bluetooth-settings-obexpush.h         |  9 +--------
 lib/bluetooth-settings-row.h              |  9 +--------
 lib/bluetooth-settings-widget.h           |  9 +--------
 lib/bluetooth-utils.h                     |  9 +--------
 lib/gnome-bluetooth-enum-types.h.template | 13 +------------
 lib/pin.h                                 |  2 ++
 17 files changed, 17 insertions(+), 128 deletions(-)
---
diff --git a/lib/bluetooth-agent.h b/lib/bluetooth-agent.h
index 077d6e59..41073432 100644
--- a/lib/bluetooth-agent.h
+++ b/lib/bluetooth-agent.h
@@ -21,14 +21,11 @@
  *
  */
 
-#ifndef __BLUETOOTH_AGENT_H
-#define __BLUETOOTH_AGENT_H
+#pragma once
 
 #include <glib-object.h>
 #include <gio/gio.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_AGENT (bluetooth_agent_get_type())
 #define BLUETOOTH_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                        BLUETOOTH_TYPE_AGENT, BluetoothAgent))
@@ -121,7 +118,3 @@ typedef enum {
 
 GType  bluetooth_agent_error_get_type (void);
 GQuark bluetooth_agent_error_quark    (void);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_AGENT_H */
diff --git a/lib/bluetooth-chooser-button.h b/lib/bluetooth-chooser-button.h
index 363738b6..7e6c8e41 100644
--- a/lib/bluetooth-chooser-button.h
+++ b/lib/bluetooth-chooser-button.h
@@ -16,13 +16,10 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __BLUETOOTH_CHOOSER_BUTTON_H__
-#define __BLUETOOTH_CHOOSER_BUTTON_H__
+#pragma once
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_CHOOSER_BUTTON     (bluetooth_chooser_button_get_type ())
 #define BLUETOOTH_CHOOSER_BUTTON(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUETOOTH_TYPE_CHOOSER_BUTTON, 
BluetoothChooserButton))
 #define BLUETOOTH_IS_CHOOSER_BUTTON(obj)  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUETOOTH_TYPE_CHOOSER_BUTTON))
@@ -47,7 +44,3 @@ GType         bluetooth_chooser_button_get_type       (void);
 
 GtkWidget *    bluetooth_chooser_button_new            (void);
 gboolean       bluetooth_chooser_button_available      (BluetoothChooserButton *button);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CHOOSER_BUTTON_H__ */
diff --git a/lib/bluetooth-chooser-combo.h b/lib/bluetooth-chooser-combo.h
index 8da966b4..f7f19b69 100644
--- a/lib/bluetooth-chooser-combo.h
+++ b/lib/bluetooth-chooser-combo.h
@@ -16,13 +16,10 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __BLUETOOTH_CHOOSER_COMBO_H__
-#define __BLUETOOTH_CHOOSER_COMBO_H__
+#pragma once
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_CHOOSER_COMBO     (bluetooth_chooser_combo_get_type ())
 #define BLUETOOTH_CHOOSER_COMBO(obj)     (G_TYPE_CHECK_INSTANCE_CAST ((obj), BLUETOOTH_TYPE_CHOOSER_COMBO, 
BluetoothChooserCombo))
 #define BLUETOOTH_IS_CHOOSER_COMBO(obj)  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BLUETOOTH_TYPE_CHOOSER_COMBO))
@@ -61,7 +58,3 @@ struct _BluetoothChooserComboClass {
 GType          bluetooth_chooser_combo_get_type        (void);
 
 GtkWidget *    bluetooth_chooser_combo_new             (void);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CHOOSER_COMBO_H__ */
diff --git a/lib/bluetooth-chooser-private.h b/lib/bluetooth-chooser-private.h
index 19f549de..3f9faa8e 100644
--- a/lib/bluetooth-chooser-private.h
+++ b/lib/bluetooth-chooser-private.h
@@ -21,19 +21,12 @@
  *
  */
 
-#ifndef __BLUETOOTH_CHOOSER_PRIVATE_H
-#define __BLUETOOTH_CHOOSER_PRIVATE_H
+#pragma once
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
 #include <bluetooth-enums.h>
 
-G_BEGIN_DECLS
-
 GtkTreeModel *bluetooth_chooser_get_model (BluetoothChooser *self);
 GtkWidget *bluetooth_chooser_get_treeview (BluetoothChooser *self);
 gboolean bluetooth_chooser_remove_selected_device (BluetoothChooser *self);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CHOOSER_PRIVATE_H */
diff --git a/lib/bluetooth-chooser.h b/lib/bluetooth-chooser.h
index c36db2dc..bb182add 100644
--- a/lib/bluetooth-chooser.h
+++ b/lib/bluetooth-chooser.h
@@ -22,14 +22,11 @@
  *
  */
 
-#ifndef __BLUETOOTH_CHOOSER_H
-#define __BLUETOOTH_CHOOSER_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include <bluetooth-enums.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_CHOOSER (bluetooth_chooser_get_type())
 #define BLUETOOTH_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                BLUETOOTH_TYPE_CHOOSER, BluetoothChooser))
@@ -80,7 +77,3 @@ GtkWidget *bluetooth_chooser_get_scrolled_window (BluetoothChooser *self);
 
 void bluetooth_chooser_start_discovery (BluetoothChooser *self);
 void bluetooth_chooser_stop_discovery (BluetoothChooser *self);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CHOOSER_H */
diff --git a/lib/bluetooth-client-private.h b/lib/bluetooth-client-private.h
index 191821ac..c8cdfc3d 100644
--- a/lib/bluetooth-client-private.h
+++ b/lib/bluetooth-client-private.h
@@ -21,15 +21,12 @@
  *
  */
 
-#ifndef __BLUETOOTH_CLIENT_PRIVATE_H
-#define __BLUETOOTH_CLIENT_PRIVATE_H
+#pragma once
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
 #include <bluetooth-enums.h>
 
-G_BEGIN_DECLS
-
 typedef void (*BluetoothClientSetupFunc) (BluetoothClient *client,
                                          const GError    *error,
                                          const char      *device_path);
@@ -57,7 +54,3 @@ void bluetooth_client_dump_device (GtkTreeModel *model,
 gboolean bluetooth_client_get_connectable(const char **uuids);
 
 GDBusProxy *_bluetooth_client_get_default_adapter (BluetoothClient *client);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CLIENT_PRIVATE_H */
diff --git a/lib/bluetooth-client.h b/lib/bluetooth-client.h
index ab4cfa25..571b31d1 100644
--- a/lib/bluetooth-client.h
+++ b/lib/bluetooth-client.h
@@ -21,15 +21,12 @@
  *
  */
 
-#ifndef __BLUETOOTH_CLIENT_H
-#define __BLUETOOTH_CLIENT_H
+#pragma once
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
 #include <bluetooth-enums.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_CLIENT (bluetooth_client_get_type())
 #define BLUETOOTH_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                        BLUETOOTH_TYPE_CLIENT, BluetoothClient))
@@ -81,7 +78,3 @@ void bluetooth_client_connect_service (BluetoothClient     *client,
 gboolean bluetooth_client_connect_service_finish (BluetoothClient *client,
                                                  GAsyncResult    *res,
                                                  GError         **error);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_CLIENT_H */
diff --git a/lib/bluetooth-enums.h b/lib/bluetooth-enums.h
index 3c8b72c3..06d26b6f 100644
--- a/lib/bluetooth-enums.h
+++ b/lib/bluetooth-enums.h
@@ -21,13 +21,10 @@
  *
  */
 
-#ifndef __BLUETOOTH_ENUMS_H
-#define __BLUETOOTH_ENUMS_H
+#pragma once
 
 #include <glib.h>
 
-G_BEGIN_DECLS
-
 /**
  * SECTION:bluetooth-enums
  * @short_description: Bluetooth related enumerations
@@ -183,7 +180,3 @@ typedef enum {
        BLUETOOTH_STATUS_CONNECTING,
        BLUETOOTH_STATUS_PLAYING
 } BluetoothStatus;
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_ENUMS_H */
diff --git a/lib/bluetooth-filter-widget.h b/lib/bluetooth-filter-widget.h
index 05912e44..e053b6c0 100644
--- a/lib/bluetooth-filter-widget.h
+++ b/lib/bluetooth-filter-widget.h
@@ -22,15 +22,12 @@
  *
  */
 
-#ifndef __BLUETOOTH_FILTER_WIDGET_H
-#define __BLUETOOTH_FILTER_WIDGET_H
+#pragma once
 
 #include <gtk/gtk.h>
 #include <bluetooth-enums.h>
 #include <bluetooth-chooser.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_FILTER_WIDGET (bluetooth_filter_widget_get_type())
 #define BLUETOOTH_FILTER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                BLUETOOTH_TYPE_FILTER_WIDGET, BluetoothFilterWidget))
@@ -61,7 +58,3 @@ GtkWidget *bluetooth_filter_widget_new (void);
 void bluetooth_filter_widget_set_title (BluetoothFilterWidget *self, gchar *title);
 
 void bluetooth_filter_widget_bind_filter (BluetoothFilterWidget *self, BluetoothChooser *chooser);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_FILTER_WIDGET_H */
diff --git a/lib/bluetooth-hdy-column.h b/lib/bluetooth-hdy-column.h
index 2ed80bc3..4036b1b2 100644
--- a/lib/bluetooth-hdy-column.h
+++ b/lib/bluetooth-hdy-column.h
@@ -8,8 +8,6 @@
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_HDY_COLUMN (bluetooth_hdy_column_get_type())
 
 G_DECLARE_FINAL_TYPE (BluetoothHdyColumn, bluetooth_hdy_column, BLUETOOTH, HDY_COLUMN, GtkBin)
@@ -21,5 +19,3 @@ void bluetooth_hdy_column_set_maximum_width (BluetoothHdyColumn *self,
 gint bluetooth_hdy_column_get_linear_growth_width (BluetoothHdyColumn *self);
 void bluetooth_hdy_column_set_linear_growth_width (BluetoothHdyColumn *self,
                                                    gint                linear_growth_width);
-
-G_END_DECLS
diff --git a/lib/bluetooth-pairing-dialog.h b/lib/bluetooth-pairing-dialog.h
index 85a46026..8133b713 100644
--- a/lib/bluetooth-pairing-dialog.h
+++ b/lib/bluetooth-pairing-dialog.h
@@ -18,13 +18,10 @@
  *
  */
 
-#ifndef __BLUETOOTH_PAIRING_DIALOG_H
-#define __BLUETOOTH_PAIRING_DIALOG_H
+#pragma once
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_PAIRING_DIALOG (bluetooth_pairing_dialog_get_type())
 #define BLUETOOTH_PAIRING_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                BLUETOOTH_TYPE_PAIRING_DIALOG, BluetoothPairingDialog))
@@ -79,7 +76,3 @@ void bluetooth_pairing_dialog_set_pin_entered (BluetoothPairingDialog *self,
                                               guint                   entered);
 
 char *bluetooth_pairing_dialog_get_pin (BluetoothPairingDialog *self);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_PAIRING_DIALOG_H */
diff --git a/lib/bluetooth-settings-obexpush.h b/lib/bluetooth-settings-obexpush.h
index 272968ef..97ca4334 100644
--- a/lib/bluetooth-settings-obexpush.h
+++ b/lib/bluetooth-settings-obexpush.h
@@ -23,13 +23,10 @@
  *
  */
 
-#ifndef __OBEX_AGENT_H__
-#define __OBEX_AGENT_H__
+#pragma once
 
 #include <glib-object.h>
 
-G_BEGIN_DECLS
-
 typedef struct _ObexAgent {
        GObject parent;
        guint owner_id;
@@ -54,7 +51,3 @@ GType obex_agent_get_type (void);
 void     obex_agent_up (void);
 void     obex_agent_down (void);
 char    *lookup_download_dir (void);
-
-G_END_DECLS
-
-#endif
diff --git a/lib/bluetooth-settings-row.h b/lib/bluetooth-settings-row.h
index ed0db01d..0d3cb1ee 100644
--- a/lib/bluetooth-settings-row.h
+++ b/lib/bluetooth-settings-row.h
@@ -18,13 +18,10 @@
  *
  */
 
-#ifndef __BLUETOOTH_SETTINGS_ROW_H
-#define __BLUETOOTH_SETTINGS_ROW_H
+#pragma once
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_SETTINGS_ROW (bluetooth_settings_row_get_type())
 #define BLUETOOTH_SETTINGS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                BLUETOOTH_TYPE_SETTINGS_ROW, BluetoothSettingsRow))
@@ -57,7 +54,3 @@ struct _BluetoothSettingsRowClass {
 GType bluetooth_settings_row_get_type (void);
 
 GtkWidget *bluetooth_settings_row_new (void);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_SETTINGS_ROW_H */
diff --git a/lib/bluetooth-settings-widget.h b/lib/bluetooth-settings-widget.h
index 8b722956..395a985e 100644
--- a/lib/bluetooth-settings-widget.h
+++ b/lib/bluetooth-settings-widget.h
@@ -18,13 +18,10 @@
  *
  */
 
-#ifndef __BLUETOOTH_SETTINGS_WIDGET_H
-#define __BLUETOOTH_SETTINGS_WIDGET_H
+#pragma once
 
 #include <gtk/gtk.h>
 
-G_BEGIN_DECLS
-
 #define BLUETOOTH_TYPE_SETTINGS_WIDGET (bluetooth_settings_widget_get_type())
 #define BLUETOOTH_SETTINGS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
                                BLUETOOTH_TYPE_SETTINGS_WIDGET, BluetoothSettingsWidget))
@@ -59,7 +56,3 @@ GType bluetooth_settings_widget_get_type (void);
 GtkWidget *bluetooth_settings_widget_new (void);
 
 gboolean bluetooth_settings_widget_get_default_adapter_powered (BluetoothSettingsWidget *widget);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_SETTINGS_WIDGET_H */
diff --git a/lib/bluetooth-utils.h b/lib/bluetooth-utils.h
index a5108dd8..4781909b 100644
--- a/lib/bluetooth-utils.h
+++ b/lib/bluetooth-utils.h
@@ -22,14 +22,11 @@
  *
  */
 
-#ifndef __BLUETOOTH_UTILS_H
-#define __BLUETOOTH_UTILS_H
+#pragma once
 
 #include <gio/gio.h>
 #include <bluetooth-enums.h>
 
-G_BEGIN_DECLS
-
 /*
  * The profile UUID list is provided by the Bluetooth SIG:
  * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
@@ -69,7 +66,3 @@ const char    *bluetooth_uuid_to_string        (const char *uuid);
 
 void bluetooth_send_to_address (const char *address,
                                const char *alias);
-
-G_END_DECLS
-
-#endif /* __BLUETOOTH_UTILS_H */
diff --git a/lib/gnome-bluetooth-enum-types.h.template b/lib/gnome-bluetooth-enum-types.h.template
index 1915ac92..a1f9fc6f 100644
--- a/lib/gnome-bluetooth-enum-types.h.template
+++ b/lib/gnome-bluetooth-enum-types.h.template
@@ -1,12 +1,8 @@
 /*** BEGIN file-header ***/
-#ifndef __GNOME_BLUETOOTH_ENUM_TYPES_H__
-#define __GNOME_BLUETOOTH_ENUM_TYPES_H__
-
+#pragma once
 
 #include <glib-object.h>
 
-G_BEGIN_DECLS
-
 /*** END file-header ***/
 
 /*** BEGIN file-production ***/
@@ -19,10 +15,3 @@ G_BEGIN_DECLS
 GType @enum_name@_get_type     (void) G_GNUC_CONST;
 
 /*** END enumeration-production ***/
-
-/*** BEGIN file-tail ***/
-G_END_DECLS
-
-#endif /* __GNOME_BLUETOOTH_ENUM_TYPES_H__ */
-/*** END file-tail ***/
-
diff --git a/lib/pin.h b/lib/pin.h
index db7d3234..31ddf909 100644
--- a/lib/pin.h
+++ b/lib/pin.h
@@ -21,6 +21,8 @@
  *
  */
 
+#pragma once
+
 #include <glib.h>
 
 #define PIN_NUM_DIGITS 6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]