mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 20:50:32 +01:00
libnm/tests: replace NM_PRAGMA_WARNING_DISABLE() by _nm_unused
This commit is contained in:
parent
5e54cb5845
commit
c39859d240
2 changed files with 10 additions and 12 deletions
|
|
@ -948,7 +948,7 @@ _test_connection_invalid_find_connections(gpointer element, gpointer needle, gpo
|
|||
static void
|
||||
test_connection_invalid(void)
|
||||
{
|
||||
NMTSTC_SERVICE_INFO_SETUP(my_sinfo)
|
||||
NMTSTC_SERVICE_INFO_SETUP(my_sinfo);
|
||||
gs_unref_object NMConnection *connection = NULL;
|
||||
NMSettingConnection * s_con;
|
||||
gs_unref_object NMClient *client = NULL;
|
||||
|
|
|
|||
|
|
@ -28,17 +28,15 @@ _nmtstc_auto_service_cleanup(NMTstcServiceInfo **info)
|
|||
}
|
||||
#define nmtstc_auto_service_cleanup nm_auto(_nmtstc_auto_service_cleanup)
|
||||
|
||||
#define NMTSTC_SERVICE_INFO_SETUP(sinfo) \
|
||||
NM_PRAGMA_WARNING_DISABLE("-Wunused-variable") \
|
||||
nmtstc_auto_service_cleanup NMTstcServiceInfo *sinfo = ({ \
|
||||
NMTstcServiceInfo *_sinfo; \
|
||||
\
|
||||
_sinfo = nmtstc_service_init(); \
|
||||
if (!nmtstc_service_available(_sinfo)) \
|
||||
return; \
|
||||
_sinfo; \
|
||||
}); \
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
#define NMTSTC_SERVICE_INFO_SETUP(sinfo) \
|
||||
_nm_unused nmtstc_auto_service_cleanup NMTstcServiceInfo *sinfo = ({ \
|
||||
NMTstcServiceInfo *_sinfo; \
|
||||
\
|
||||
_sinfo = nmtstc_service_init(); \
|
||||
if (!nmtstc_service_available(_sinfo)) \
|
||||
return; \
|
||||
_sinfo; \
|
||||
})
|
||||
|
||||
NMDevice *nmtstc_service_add_device(NMTstcServiceInfo *info,
|
||||
NMClient * client,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue