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:
Thomas Haller
2015-10-20 14:43:31 +02:00
parent 638528d312
commit fd7d57be03
4 changed files with 12 additions and 12 deletions

View File

@@ -1533,7 +1533,7 @@ static void
delayed_action_handle_MASTER_CONNECTED (NMPlatform *platform, int master_ifindex) delayed_action_handle_MASTER_CONNECTED (NMPlatform *platform, int master_ifindex)
{ {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); 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; gboolean was_visible;
NMPCacheOpsType cache_op; NMPCacheOpsType cache_op;
@@ -1780,7 +1780,7 @@ cache_prune_candidates_prune (NMPlatform *platform)
g_hash_table_iter_init (&iter, prune_candidates); g_hash_table_iter_init (&iter, prune_candidates);
while (g_hash_table_iter_next (&iter, (gpointer *)&obj, NULL)) { 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)); _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); 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); NMPlatform *platform = NM_PLATFORM (user_data);
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (user_data); NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (user_data);
auto_nl_object struct nl_object *nlo = NULL; auto_nl_object struct nl_object *nlo = NULL;
auto_nmp_obj NMPObject *obj = NULL; nm_auto_nmpobj NMPObject *obj = NULL;
struct nlmsghdr *msghdr; struct nlmsghdr *msghdr;
char buf_nlmsg_type[16]; char buf_nlmsg_type[16];
@@ -2409,7 +2409,7 @@ event_notification (struct nl_msg *msg, gpointer user_data)
} }
if (obj) { if (obj) {
auto_nmp_obj NMPObject *obj_cache = NULL; nm_auto_nmpobj NMPObject *obj_cache = NULL;
switch (msghdr->nlmsg_type) { switch (msghdr->nlmsg_type) {
@@ -4806,7 +4806,7 @@ static void
cache_update_link_udev (NMPlatform *platform, int ifindex, GUdevDevice *udev_device) cache_update_link_udev (NMPlatform *platform, int ifindex, GUdevDevice *udev_device)
{ {
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform); 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; gboolean was_visible;
NMPCacheOpsType cache_op; NMPCacheOpsType cache_op;

View File

@@ -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) { if (NMP_OBJECT_GET_TYPE (obj_needle) == NMP_OBJECT_TYPE_LINK) {
NMPObject *old; 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 /* 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 * 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) 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; NMPObject *old;
auto_nmp_obj NMPObject *obj = NULL; nm_auto_nmpobj NMPObject *obj = NULL;
old = (NMPObject *) nmp_cache_lookup_link (cache, ifindex); 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) 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; NMPObject *old;
auto_nmp_obj NMPObject *obj = NULL; nm_auto_nmpobj NMPObject *obj = NULL;
old = (NMPObject *) nmp_cache_lookup_link (cache, ifindex); old = (NMPObject *) nmp_cache_lookup_link (cache, ifindex);

View File

@@ -286,9 +286,9 @@ gboolean nmp_object_is_visible (const NMPObject *obj);
void _nmp_object_fixup_link_udev_fields (NMPObject *obj, gboolean use_udev); 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 static inline void
_nmp_auto_obj_cleanup (NMPObject **pobj) _nm_auto_nmpobj_cleanup (NMPObject **pobj)
{ {
nmp_object_unref (*pobj); nmp_object_unref (*pobj);
} }

View File

@@ -148,8 +148,8 @@ _nmp_cache_update_netlink (NMPCache *cache, NMPObject *obj, NMPObject **out_obj,
NMPCacheOpsType ops_type; NMPCacheOpsType ops_type;
NMPObject *obj2; NMPObject *obj2;
gboolean was_visible; gboolean was_visible;
auto_nmp_obj NMPObject *obj_clone = nmp_object_clone (obj, FALSE); nm_auto_nmpobj NMPObject *obj_clone = nmp_object_clone (obj, FALSE);
auto_nmp_obj NMPObject *new_clone = NULL; nm_auto_nmpobj NMPObject *new_clone = NULL;
const NMPObject *obj_old; const NMPObject *obj_old;
_NMPCacheUpdateData data = { _NMPCacheUpdateData data = {
.cache = cache, .cache = cache,