shared: rename "gs_local_option_context" to "nm_auto_free_option_context"
The "gs_*" macros originate from the (no longer existing) libgsystem library. We still have them, because so far we didn't go through the effort of renaming the API. Aside that oddity, our cleanup API is called "nm_auto*". There is no need to add new API with the old name.
This commit is contained in:
@@ -141,14 +141,6 @@ NM_AUTO_DEFINE_FCN0 (GError *, gs_local_free_error, g_error_free);
|
|||||||
#define gs_unref_keyfile nm_auto(gs_local_keyfile_unref)
|
#define gs_unref_keyfile nm_auto(gs_local_keyfile_unref)
|
||||||
NM_AUTO_DEFINE_FCN0 (GKeyFile *, gs_local_keyfile_unref, g_key_file_unref);
|
NM_AUTO_DEFINE_FCN0 (GKeyFile *, gs_local_keyfile_unref, g_key_file_unref);
|
||||||
|
|
||||||
/**
|
|
||||||
* gs_free_option_context:
|
|
||||||
*
|
|
||||||
* Call g_option_context_free() on a variable location when it goes out of scope.
|
|
||||||
*/
|
|
||||||
#define gs_free_option_context nm_auto(gs_local_option_context)
|
|
||||||
NM_AUTO_DEFINE_FCN0 (GOptionContext *, gs_local_option_context, g_option_context_free);
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "nm-glib.h"
|
#include "nm-glib.h"
|
||||||
@@ -208,6 +200,9 @@ NM_AUTO_DEFINE_FCN0 (GIOChannel *, _nm_auto_unref_io_channel, g_io_channel_unref
|
|||||||
NM_AUTO_DEFINE_FCN0 (GMainLoop *, _nm_auto_unref_gmainloop, g_main_loop_unref);
|
NM_AUTO_DEFINE_FCN0 (GMainLoop *, _nm_auto_unref_gmainloop, g_main_loop_unref);
|
||||||
#define nm_auto_unref_gmainloop nm_auto(_nm_auto_unref_gmainloop)
|
#define nm_auto_unref_gmainloop nm_auto(_nm_auto_unref_gmainloop)
|
||||||
|
|
||||||
|
NM_AUTO_DEFINE_FCN0 (GOptionContext *, _nm_auto_free_option_context, g_option_context_free);
|
||||||
|
#define nm_auto_free_option_context nm_auto(_nm_auto_free_option_context)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_nm_auto_freev (gpointer ptr)
|
_nm_auto_freev (gpointer ptr)
|
||||||
{
|
{
|
||||||
|
@@ -83,7 +83,7 @@ main (int argc, char *argv[])
|
|||||||
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL },
|
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
gs_free_option_context GOptionContext *option_context = NULL;
|
nm_auto_free_option_context GOptionContext *option_context = NULL;
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
gs_free char *hostname = NULL;
|
gs_free char *hostname = NULL;
|
||||||
int errsv;
|
int errsv;
|
||||||
|
Reference in New Issue
Block a user