[gnome-settings-daemon: 1/3] build: Use config_h.set10 consistently



commit 9173891a910268a6bff9c57f270eefad60fbef3b
Author: Marvin Schmidt <marv exherbo org>
Date:   Fri Jun 22 20:10:32 2018 +0200

    build: Use config_h.set10 consistently
    
    .set() allows to set about any value (strings, integers, ...), for
    strictly boolean data, .set10() seems to be a better fit

 meson.build                                 |  4 ++--
 plugins/media-keys/gsd-media-keys-manager.c | 16 ++++++++--------
 plugins/power/gsd-backlight-linux.c         |  4 ++--
 plugins/sharing/gsd-sharing-manager.c       | 20 ++++++++++----------
 4 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/meson.build b/meson.build
index 2fd30cbd..785094dd 100644
--- a/meson.build
+++ b/meson.build
@@ -123,7 +123,7 @@ if enable_gudev
   assert(enable_gudev, 'GUdev is not optional on Linux platforms')
   gudev_dep = dependency('gudev-1.0')
 endif
-config_h.set('HAVE_GUDEV', enable_gudev)
+config_h.set10('HAVE_GUDEV', enable_gudev)
 
 # Check for libwayland-client
 enable_wayland = get_option('wayland')
@@ -191,7 +191,7 @@ if enable_network_manager
   # network manager
   libnm_dep = dependency('libnm', version: '>= 1.0')
 endif
-config_h.set('HAVE_NETWORK_MANAGER', enable_network_manager)
+config_h.set10('HAVE_NETWORK_MANAGER', enable_network_manager)
 
 gnome = import('gnome')
 i18n = import('i18n')
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 092f0665..36441bf1 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -42,7 +42,7 @@
 #include <libupower-glib/upower.h>
 #include <gdesktop-enums.h>
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
 #include <gudev/gudev.h>
 #endif
 
@@ -165,7 +165,7 @@ struct GsdMediaKeysManagerPrivate
         GSettings       *sound_settings;
         pa_volume_t      max_volume;
         GtkSettings     *gtksettings;
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
         GHashTable      *streams; /* key = X device ID, value = stream id */
         GUdevClient     *udev_client;
 #endif /* HAVE_GUDEV */
@@ -1273,7 +1273,7 @@ update_dialog (GsdMediaKeysManager *manager,
         }
 }
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
 /* PulseAudio gives us /devices/... paths, when udev
  * expects /sys/devices/... paths. */
 static GUdevDevice *
@@ -1401,7 +1401,7 @@ do_sound_action (GsdMediaKeysManager *manager,
 
         /* Find the stream that corresponds to the device, if any */
         stream = NULL;
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
         stream = get_stream_for_device_id (manager,
                                            flags & SOUND_ACTION_FLAG_IS_OUTPUT,
                                            deviceid);
@@ -1524,7 +1524,7 @@ on_control_default_source_changed (GvcMixerControl     *control,
         update_default_source (manager);
 }
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
 static gboolean
 remove_stream (gpointer key,
               gpointer value,
@@ -1550,7 +1550,7 @@ on_control_stream_removed (GvcMixerControl     *control,
                        g_clear_object (&manager->priv->source);
         }
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
        g_hash_table_foreach_remove (manager->priv->streams, (GHRFunc) remove_stream, GUINT_TO_POINTER (id));
 #endif
 }
@@ -3006,7 +3006,7 @@ gsd_media_keys_manager_start (GsdMediaKeysManager *manager,
 
         gnome_settings_profile_start (NULL);
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
         manager->priv->streams = g_hash_table_new (g_direct_hash, g_direct_equal);
         manager->priv->udev_client = g_udev_client_new (subsystems);
 #endif
@@ -3073,7 +3073,7 @@ gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
 
         g_clear_pointer (&manager->priv->ca, ca_context_destroy);
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
         g_clear_pointer (&priv->streams, g_hash_table_destroy);
         g_clear_object (&priv->udev_client);
 #endif /* HAVE_GUDEV */
diff --git a/plugins/power/gsd-backlight-linux.c b/plugins/power/gsd-backlight-linux.c
index 27b56ae9..c1dfefd0 100644
--- a/plugins/power/gsd-backlight-linux.c
+++ b/plugins/power/gsd-backlight-linux.c
@@ -27,7 +27,7 @@
 
 #include <stdlib.h>
 
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
 #include <gudev/gudev.h>
 
 static gchar *
@@ -82,7 +82,7 @@ gsd_backlight_helper_get_raw (GList *devices)
 char *
 gsd_backlight_helper_get_best_backlight (GsdBacklightType *type)
 {
-#ifdef HAVE_GUDEV
+#if HAVE_GUDEV
        gchar *path = NULL;
        GList *devices;
        GUdevClient *client;
diff --git a/plugins/sharing/gsd-sharing-manager.c b/plugins/sharing/gsd-sharing-manager.c
index a90df9a6..8690dbf1 100644
--- a/plugins/sharing/gsd-sharing-manager.c
+++ b/plugins/sharing/gsd-sharing-manager.c
@@ -25,7 +25,7 @@
 #include <gio/gdesktopappinfo.h>
 #include <glib/gstdio.h>
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 #include <NetworkManager.h>
 #endif /* HAVE_NETWORK_MANAGER */
 
@@ -47,7 +47,7 @@ struct GsdSharingManagerPrivate
         GDBusConnection         *connection;
 
         GCancellable            *cancellable;
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
         NMClient                *client;
 #endif /* HAVE_NETWORK_MANAGER */
 
@@ -169,7 +169,7 @@ gsd_sharing_manager_stop_service (GsdSharingManager *manager,
         gsd_sharing_manager_handle_service (manager, "StopUnit", service);
 }
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 static gboolean
 service_is_enabled_on_current_connection (GsdSharingManager *manager,
                                           ServiceInfo       *service)
@@ -221,7 +221,7 @@ gsd_sharing_manager_sync_services (GsdSharingManager *manager)
         g_list_free (services);
 }
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 static void
 properties_changed (GsdSharingManager *manager)
 {
@@ -362,7 +362,7 @@ gsd_sharing_manager_disable_service (GsdSharingManager  *manager,
         return TRUE;
 }
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 static const char *
 get_type_and_name_for_connection_uuid (GsdSharingManager *manager,
                                        const char        *uuid,
@@ -392,7 +392,7 @@ get_type_and_name_for_connection_uuid (GsdSharingManager *manager,
 }
 #endif /* HAVE_NETWORK_MANAGER */
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 static gboolean
 connection_is_low_security (GsdSharingManager *manager,
                             const char        *uuid)
@@ -424,7 +424,7 @@ gsd_sharing_manager_list_networks (GsdSharingManager  *manager,
         if (!check_service (manager, service_name, error))
                 return NULL;
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
         if (!manager->priv->client) {
                 g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED, "Not ready yet");
                 return NULL;
@@ -580,7 +580,7 @@ on_bus_gotten (GObject               *source_object,
                                                                NULL);
 }
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
 static void
 primary_connection_changed (GObject    *gobject,
                             GParamSpec *pspec,
@@ -702,7 +702,7 @@ gsd_sharing_manager_start (GsdSharingManager *manager,
         gsd_sharing_manager_disable_rygel ();
 
         manager->priv->cancellable = g_cancellable_new ();
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
         nm_client_new_async (manager->priv->cancellable, nm_client_ready, manager);
 #endif /* HAVE_NETWORK_MANAGER */
 
@@ -732,7 +732,7 @@ gsd_sharing_manager_stop (GsdSharingManager *manager)
                 g_clear_object (&manager->priv->cancellable);
         }
 
-#ifdef HAVE_NETWORK_MANAGER
+#if HAVE_NETWORK_MANAGER
         g_clear_object (&manager->priv->client);
 #endif /* HAVE_NETWORK_MANAGER */
 


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