core: always use gulong to store signal handler ids
We inconsistently use gulong,guint,int types to store signal handler id, but the type returned by g_signal_connect() is a gulong. This has no practical consequences because a int/guint is enough to store the value, however it is better to use a consistent type, also because nm_clear_g_signal_handler() accepts a pointer to the signal id and thus it must be always called with the same pointer type.
This commit is contained in:
@@ -208,7 +208,7 @@ nm_clear_g_source (guint *id)
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
nm_clear_g_signal_handler (gpointer self, guint *id)
|
||||
nm_clear_g_signal_handler (gpointer self, gulong *id)
|
||||
{
|
||||
if (id && *id) {
|
||||
g_signal_handler_disconnect (self, *id);
|
||||
|
@@ -71,8 +71,8 @@ typedef struct Supplicant {
|
||||
NMSupplicantInterface *iface;
|
||||
|
||||
/* signal handler ids */
|
||||
guint iface_error_id;
|
||||
guint iface_state_id;
|
||||
gulong iface_error_id;
|
||||
gulong iface_state_id;
|
||||
|
||||
/* Timeouts and idles */
|
||||
guint iface_con_error_cb_id;
|
||||
@@ -117,7 +117,7 @@ typedef struct {
|
||||
/* DCB */
|
||||
DcbWait dcb_wait;
|
||||
guint dcb_timeout_id;
|
||||
guint dcb_carrier_id;
|
||||
gulong dcb_carrier_id;
|
||||
} NMDeviceEthernetPrivate;
|
||||
|
||||
enum {
|
||||
|
@@ -47,7 +47,7 @@ G_DEFINE_TYPE (NMDeviceMacvlan, nm_device_macvlan, NM_TYPE_DEVICE)
|
||||
|
||||
typedef struct {
|
||||
int parent_ifindex;
|
||||
guint parent_state_id;
|
||||
gulong parent_state_id;
|
||||
NMDevice *parent;
|
||||
NMPlatformLnkMacvlan props;
|
||||
} NMDeviceMacvlanPrivate;
|
||||
|
@@ -49,8 +49,8 @@ G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
|
||||
|
||||
typedef struct {
|
||||
NMDevice *parent;
|
||||
guint parent_state_id;
|
||||
guint parent_hwaddr_id;
|
||||
gulong parent_state_id;
|
||||
gulong parent_hwaddr_id;
|
||||
int vlan_id;
|
||||
} NMDeviceVlanPrivate;
|
||||
|
||||
|
@@ -174,7 +174,7 @@ typedef struct {
|
||||
NMDevice *slave;
|
||||
gboolean slave_is_enslaved;
|
||||
gboolean configure;
|
||||
guint watch_id;
|
||||
gulong watch_id;
|
||||
} SlaveInfo;
|
||||
|
||||
typedef struct {
|
||||
@@ -354,7 +354,7 @@ typedef struct _NMDevicePrivate {
|
||||
NMDevice * master;
|
||||
gboolean is_enslaved;
|
||||
gboolean master_ready_handled;
|
||||
guint master_ready_id;
|
||||
gulong master_ready_id;
|
||||
|
||||
/* slave management */
|
||||
gboolean is_master;
|
||||
|
@@ -39,8 +39,8 @@
|
||||
|
||||
typedef struct {
|
||||
NMBusManager * dbus_mgr;
|
||||
guint new_conn_id;
|
||||
guint dis_conn_id;
|
||||
gulong new_conn_id;
|
||||
gulong dis_conn_id;
|
||||
GHashTable * signal_handlers;
|
||||
} NMDhcpListenerPrivate;
|
||||
|
||||
|
@@ -61,7 +61,7 @@ typedef struct {
|
||||
|
||||
GDBusProxy *proxy;
|
||||
|
||||
guint bus_closed_id;
|
||||
gulong bus_closed_id;
|
||||
guint reconnect_id;
|
||||
} NMBusManagerPrivate;
|
||||
|
||||
|
@@ -1726,20 +1726,20 @@ static void
|
||||
_connect_manager_signal (NMPolicy *policy, const char *name, gpointer callback)
|
||||
{
|
||||
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
|
||||
guint id;
|
||||
gulong id;
|
||||
|
||||
id = g_signal_connect (priv->manager, name, callback, policy);
|
||||
priv->manager_ids = g_slist_prepend (priv->manager_ids, GUINT_TO_POINTER (id));
|
||||
priv->manager_ids = g_slist_prepend (priv->manager_ids, (gpointer) id);
|
||||
}
|
||||
|
||||
static void
|
||||
_connect_settings_signal (NMPolicy *policy, const char *name, gpointer callback)
|
||||
{
|
||||
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE (policy);
|
||||
guint id;
|
||||
gulong id;
|
||||
|
||||
id = g_signal_connect (priv->settings, name, callback, policy);
|
||||
priv->settings_ids = g_slist_prepend (priv->settings_ids, GUINT_TO_POINTER (id));
|
||||
priv->settings_ids = g_slist_prepend (priv->settings_ids, (gpointer) id);
|
||||
}
|
||||
|
||||
NMPolicy *
|
||||
@@ -1889,11 +1889,11 @@ dispose (GObject *object)
|
||||
}
|
||||
|
||||
for (iter = priv->manager_ids; iter; iter = g_slist_next (iter))
|
||||
g_signal_handler_disconnect (priv->manager, GPOINTER_TO_UINT (iter->data));
|
||||
g_signal_handler_disconnect (priv->manager, (gulong) iter->data);
|
||||
g_clear_pointer (&priv->manager_ids, g_slist_free);
|
||||
|
||||
for (iter = priv->settings_ids; iter; iter = g_slist_next (iter))
|
||||
g_signal_handler_disconnect (priv->settings, GPOINTER_TO_UINT (iter->data));
|
||||
g_signal_handler_disconnect (priv->settings, (gulong) iter->data);
|
||||
g_clear_pointer (&priv->settings_ids, g_slist_free);
|
||||
|
||||
for (iter = priv->dev_ids; iter; iter = g_slist_next (iter)) {
|
||||
|
@@ -322,7 +322,7 @@ nmtstp_wait_for_signal (guint timeout_ms)
|
||||
{
|
||||
WaitForSignalData data = { 0 };
|
||||
|
||||
guint id_link, id_ip4_address, id_ip6_address, id_ip4_route, id_ip6_route;
|
||||
gulong id_link, id_ip4_address, id_ip6_address, id_ip4_route, id_ip6_route;
|
||||
|
||||
data.loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
/*********************************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
int handler_id;
|
||||
gulong handler_id;
|
||||
const char *name;
|
||||
NMPlatformSignalChangeType change_type;
|
||||
gint received_count;
|
||||
|
@@ -73,7 +73,7 @@ typedef struct {
|
||||
NMBusManager *bus_mgr;
|
||||
GDBusConnection *connection;
|
||||
gboolean connection_is_private;
|
||||
guint on_disconnected_id;
|
||||
gulong on_disconnected_id;
|
||||
|
||||
GHashTable *requests;
|
||||
} NMSecretAgentPrivate;
|
||||
|
@@ -152,8 +152,8 @@ typedef struct {
|
||||
char *file;
|
||||
GFileMonitor *monitor;
|
||||
GFileMonitor *dhcp_monitor;
|
||||
guint monitor_id;
|
||||
guint dhcp_monitor_id;
|
||||
gulong monitor_id;
|
||||
gulong dhcp_monitor_id;
|
||||
GDBusProxy *hostnamed_proxy;
|
||||
} hostname;
|
||||
} NMSettingsPrivate;
|
||||
|
@@ -89,14 +89,14 @@ typedef struct {
|
||||
GDBusConnection *connection;
|
||||
GDBusInterfaceSkeleton *interface;
|
||||
GCancellable *cancellable;
|
||||
guint signal_id;
|
||||
gulong signal_id;
|
||||
} dbus;
|
||||
|
||||
GHashTable *connections; /* uuid::connection */
|
||||
gboolean initialized;
|
||||
|
||||
GFileMonitor *ifcfg_monitor;
|
||||
guint ifcfg_monitor_id;
|
||||
gulong ifcfg_monitor_id;
|
||||
} SettingsPluginIfcfgPrivate;
|
||||
|
||||
static SettingsPluginIfcfg *settings_plugin_ifcfg_get (void);
|
||||
|
@@ -56,7 +56,7 @@ typedef struct {
|
||||
|
||||
gboolean initialized;
|
||||
GFileMonitor *monitor;
|
||||
guint monitor_id;
|
||||
gulong monitor_id;
|
||||
|
||||
NMConfig *config;
|
||||
} SettingsPluginKeyfilePrivate;
|
||||
|
@@ -40,8 +40,8 @@ typedef struct {
|
||||
GSList *plugins;
|
||||
GFileMonitor *monitor_etc;
|
||||
GFileMonitor *monitor_lib;
|
||||
guint monitor_id_etc;
|
||||
guint monitor_id_lib;
|
||||
gulong monitor_id_etc;
|
||||
gulong monitor_id_lib;
|
||||
|
||||
/* This is only used for services that don't support multiple
|
||||
* connections, to guard access to them. */
|
||||
|
Reference in New Issue
Block a user