From 7276bcd1a0130ff9fa0387c25fc884fcd0c953fe Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 28 Dec 2017 16:28:57 +0100 Subject: [PATCH] daemon: Add an internal typedef for GVariant modifiers Since we have a lot of variants, I'm thinking about using this typedef approach to clarify things a bit more. We could even potentially do codegen around this, but let's start with just a typedef. Closes: #1170 Approved by: jlebon --- src/daemon/rpmostreed-os.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/daemon/rpmostreed-os.c b/src/daemon/rpmostreed-os.c index e99dcb6d..09159ccb 100644 --- a/src/daemon/rpmostreed-os.c +++ b/src/daemon/rpmostreed-os.c @@ -58,6 +58,9 @@ static inline void *vardict_lookup_ptr (GVariantDict *dict, const char *key, con static gboolean vardict_lookup_bool (GVariantDict *dict, const char *key, gboolean dfault); +typedef GVariant RpmOstreeUpdateDeploymentModifiers; +G_DEFINE_AUTOPTR_CLEANUP_FUNC(RpmOstreeUpdateDeploymentModifiers, g_variant_unref) + G_DEFINE_TYPE_WITH_CODE (RpmostreedOS, rpmostreed_os, RPMOSTREE_TYPE_OS_SKELETON, @@ -869,8 +872,9 @@ os_handle_update_deployment (RPMOSTreeOS *interface, GVariant *arg_modifiers, GVariant *arg_options) { + RpmOstreeUpdateDeploymentModifiers *modifiers = arg_modifiers; g_auto(GVariantDict) dict; - g_variant_dict_init (&dict, arg_modifiers); + g_variant_dict_init (&dict, modifiers); const char *refspec = vardict_lookup_ptr (&dict, "set-refspec", "&s"); const char *revision =