platform/trivial: rename "auto_nmp_obj" macro to "nm_auto_nmpobj"
A define in a header file should have an "NM" prefix. Also, let's have "nm_auto_" as a prefix for cleanup macros beside libgsystem's "gs_".
This commit is contained in:
@@ -1533,7 +1533,7 @@ static void
|
||||
delayed_action_handle_MASTER_CONNECTED (NMPlatform *platform, int master_ifindex)
|
||||
{
|
||||
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
|
||||
auto_nmp_obj NMPObject *obj_cache = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj_cache = NULL;
|
||||
gboolean was_visible;
|
||||
NMPCacheOpsType cache_op;
|
||||
|
||||
@@ -1780,7 +1780,7 @@ cache_prune_candidates_prune (NMPlatform *platform)
|
||||
|
||||
g_hash_table_iter_init (&iter, prune_candidates);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)&obj, NULL)) {
|
||||
auto_nmp_obj NMPObject *obj_cache = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj_cache = NULL;
|
||||
|
||||
_LOGT ("cache-prune: prune %s", nmp_object_to_string (obj, NMP_OBJECT_TO_STRING_ALL, NULL, 0));
|
||||
cache_op = nmp_cache_remove (priv->cache, obj, TRUE, &obj_cache, &was_visible, cache_pre_hook, platform);
|
||||
@@ -2373,7 +2373,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
|
||||
NMPlatform *platform = NM_PLATFORM (user_data);
|
||||
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (user_data);
|
||||
auto_nl_object struct nl_object *nlo = NULL;
|
||||
auto_nmp_obj NMPObject *obj = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj = NULL;
|
||||
struct nlmsghdr *msghdr;
|
||||
char buf_nlmsg_type[16];
|
||||
|
||||
@@ -2409,7 +2409,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
|
||||
}
|
||||
|
||||
if (obj) {
|
||||
auto_nmp_obj NMPObject *obj_cache = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj_cache = NULL;
|
||||
|
||||
switch (msghdr->nlmsg_type) {
|
||||
|
||||
@@ -4806,7 +4806,7 @@ static void
|
||||
cache_update_link_udev (NMPlatform *platform, int ifindex, GUdevDevice *udev_device)
|
||||
{
|
||||
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
|
||||
auto_nmp_obj NMPObject *obj_cache = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj_cache = NULL;
|
||||
gboolean was_visible;
|
||||
NMPCacheOpsType cache_op;
|
||||
|
||||
|
@@ -1380,7 +1380,7 @@ nmp_cache_remove_netlink (NMPCache *cache, const NMPObject *obj_needle, NMPObjec
|
||||
{
|
||||
if (NMP_OBJECT_GET_TYPE (obj_needle) == NMP_OBJECT_TYPE_LINK) {
|
||||
NMPObject *old;
|
||||
auto_nmp_obj NMPObject *obj = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj = NULL;
|
||||
|
||||
/* For nmp_cache_remove_netlink() we have an incomplete @obj_needle instance to be
|
||||
* removed from netlink. Link objects are alive without being in netlink when they
|
||||
@@ -1575,7 +1575,7 @@ NMPCacheOpsType
|
||||
nmp_cache_update_link_udev (NMPCache *cache, int ifindex, GUdevDevice *udev_device, NMPObject **out_obj, gboolean *out_was_visible, NMPCachePreHook pre_hook, gpointer user_data)
|
||||
{
|
||||
NMPObject *old;
|
||||
auto_nmp_obj NMPObject *obj = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj = NULL;
|
||||
|
||||
old = (NMPObject *) nmp_cache_lookup_link (cache, ifindex);
|
||||
|
||||
@@ -1642,7 +1642,7 @@ NMPCacheOpsType
|
||||
nmp_cache_update_link_master_connected (NMPCache *cache, int ifindex, NMPObject **out_obj, gboolean *out_was_visible, NMPCachePreHook pre_hook, gpointer user_data)
|
||||
{
|
||||
NMPObject *old;
|
||||
auto_nmp_obj NMPObject *obj = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj = NULL;
|
||||
|
||||
old = (NMPObject *) nmp_cache_lookup_link (cache, ifindex);
|
||||
|
||||
|
@@ -286,9 +286,9 @@ gboolean nmp_object_is_visible (const NMPObject *obj);
|
||||
|
||||
void _nmp_object_fixup_link_udev_fields (NMPObject *obj, gboolean use_udev);
|
||||
|
||||
#define auto_nmp_obj __attribute__((cleanup(_nmp_auto_obj_cleanup)))
|
||||
#define nm_auto_nmpobj __attribute__((cleanup(_nm_auto_nmpobj_cleanup)))
|
||||
static inline void
|
||||
_nmp_auto_obj_cleanup (NMPObject **pobj)
|
||||
_nm_auto_nmpobj_cleanup (NMPObject **pobj)
|
||||
{
|
||||
nmp_object_unref (*pobj);
|
||||
}
|
||||
|
@@ -148,8 +148,8 @@ _nmp_cache_update_netlink (NMPCache *cache, NMPObject *obj, NMPObject **out_obj,
|
||||
NMPCacheOpsType ops_type;
|
||||
NMPObject *obj2;
|
||||
gboolean was_visible;
|
||||
auto_nmp_obj NMPObject *obj_clone = nmp_object_clone (obj, FALSE);
|
||||
auto_nmp_obj NMPObject *new_clone = NULL;
|
||||
nm_auto_nmpobj NMPObject *obj_clone = nmp_object_clone (obj, FALSE);
|
||||
nm_auto_nmpobj NMPObject *new_clone = NULL;
|
||||
const NMPObject *obj_old;
|
||||
_NMPCacheUpdateData data = {
|
||||
.cache = cache,
|
||||
|
Reference in New Issue
Block a user