Commit ba90c960 authored by Thomas Haller's avatar Thomas Haller

all: replace nm_unauto() by g_steal_pointer()

They do essentially the same.
parent 5d1c4ca6
......@@ -945,7 +945,7 @@ _nm_setting_new_from_dbus (GType setting_type,
}
}
return nm_unauto (&setting);
return g_steal_pointer (&setting);
}
/**
......
......@@ -207,7 +207,7 @@ _nm_vpn_editor_plugin_load (const char *plugin_name,
return NULL;
}
return nm_unauto (&editor_plugin);
return g_steal_pointer (&editor_plugin);
}
/**
......
......@@ -327,18 +327,6 @@ _notify (obj_type *obj, _PropertyEnums prop) \
/*****************************************************************************/
#define nm_unauto(pp) \
({ \
G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \
gpointer *_pp = (gpointer *) (pp); \
gpointer _p = *_pp; \
\
*_pp = NULL; \
_p; \
})
/*****************************************************************************/
static inline gpointer
nm_g_object_ref (gpointer obj)
{
......
......@@ -531,7 +531,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
neigh->valid = TRUE;
out:
return nm_unauto (&neigh);
return g_steal_pointer (&neigh);
}
static GVariant *
......@@ -694,7 +694,7 @@ process_lldp_neighbor (NMLldpListener *self, sd_lldp_neighbor *neighbor_sd, gboo
LOG_NEIGH_ARG (neigh));
changed = TRUE;
g_hash_table_add (priv->lldp_neighbors, nm_unauto (&neigh));
g_hash_table_add (priv->lldp_neighbors, g_steal_pointer (&neigh));
done:
if (changed)
......
......@@ -224,7 +224,7 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self,
_LOGD ("%s started with pid %d", progname, pid);
priv->watch_id = g_child_watch_add (pid, (GChildWatchFunc) watch_cb, self);
priv->pid = pid;
priv->progname = nm_unauto (&progname);
priv->progname = g_steal_pointer (&progname);
priv->pidfile = g_strdup (pidfile);
return pid;
......
......@@ -2695,7 +2695,7 @@ nm_utils_machine_id_read (void)
if (contents[i] != '\0')
return FALSE;
return nm_unauto (&contents);
return g_steal_pointer (&contents);
}
/*****************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment