diff options
Diffstat (limited to 'libappstream-builder/plugins')
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-absorb.c | 2 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-appdata.c | 10 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-dbus.c | 8 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-desktop.c | 34 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-firmware.c | 20 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-font.c | 38 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-gettext.c | 14 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-gir.c | 4 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-gresource.c | 6 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-gstreamer.c | 8 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-ibus-sql.c | 16 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-ibus-xml.c | 14 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-kde-services.c | 8 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-metainfo.c | 6 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-nm.c | 6 | ||||
-rw-r--r-- | libappstream-builder/plugins/asb-plugin-ostree.c | 10 |
16 files changed, 102 insertions, 102 deletions
diff --git a/libappstream-builder/plugins/asb-plugin-absorb.c b/libappstream-builder/plugins/asb-plugin-absorb.c index 644cdd0..094a70e 100644 --- a/libappstream-builder/plugins/asb-plugin-absorb.c +++ b/libappstream-builder/plugins/asb-plugin-absorb.c @@ -93,7 +93,7 @@ asb_plugin_merge (AsbPlugin *plugin, GList *list) AsApp *found; GList *l; const gchar *tmp; - _cleanup_hashtable_unref_ GHashTable *hash = NULL; + g_autoptr(GHashTable) hash = NULL; /* add X-Merge-With-Parent on any metainfo files that are in a package * required by a desktop package */ diff --git a/libappstream-builder/plugins/asb-plugin-appdata.c b/libappstream-builder/plugins/asb-plugin-appdata.c index 15a6974..c9c44f9 100644 --- a/libappstream-builder/plugins/asb-plugin-appdata.c +++ b/libappstream-builder/plugins/asb-plugin-appdata.c @@ -86,8 +86,8 @@ asb_plugin_process_filename (AsbPlugin *plugin, GList *l; GList *list; guint i; - _cleanup_object_unref_ AsApp *appdata = NULL; - _cleanup_ptrarray_unref_ GPtrArray *problems = NULL; + g_autoptr(AsApp) appdata = NULL; + g_autoptr(GPtrArray) problems = NULL; /* validate */ appdata = as_app_new (); @@ -141,7 +141,7 @@ asb_plugin_process_filename (AsbPlugin *plugin, /* add provide if missing */ if (as_app_get_id_kind (appdata) == AS_ID_KIND_FIRMWARE && as_utils_guid_is_valid (tmp)) { - _cleanup_object_unref_ AsProvide *provide = NULL; + g_autoptr(AsProvide) provide = NULL; provide = as_provide_new (); as_provide_set_kind (provide, AS_PROVIDE_KIND_FIRMWARE_FLASHED); as_provide_set_value (provide, tmp); @@ -333,7 +333,7 @@ asb_plugin_process_app (AsbPlugin *plugin, GError **error) { GError *error_local = NULL; - _cleanup_free_ gchar *appdata_filename = NULL; + g_autofree gchar *appdata_filename = NULL; /* get possible sources */ if (asb_package_get_kind (pkg) == ASB_PACKAGE_KIND_FIRMWARE) { @@ -341,7 +341,7 @@ asb_plugin_process_app (AsbPlugin *plugin, as_app_get_metadata_item (AS_APP (app), "MetainfoBasename"), NULL); } else { - _cleanup_free_ gchar *appdata_basename = NULL; + g_autofree gchar *appdata_basename = NULL; appdata_basename = asb_plugin_appdata_get_fn_for_app (AS_APP (app)); appdata_filename = g_strdup_printf ("%s/files/share/appdata/%s.appdata.xml", tmpdir, appdata_basename); diff --git a/libappstream-builder/plugins/asb-plugin-dbus.c b/libappstream-builder/plugins/asb-plugin-dbus.c index c7f09d4..c0a861f 100644 --- a/libappstream-builder/plugins/asb-plugin-dbus.c +++ b/libappstream-builder/plugins/asb-plugin-dbus.c @@ -75,10 +75,10 @@ asb_plugin_process_dbus (AsbApp *app, gboolean is_system, GError **error) { - _cleanup_free_ gchar *filename_full = NULL; - _cleanup_free_ gchar *name = NULL; - _cleanup_keyfile_unref_ GKeyFile *kf = NULL; - _cleanup_object_unref_ AsProvide *provide = NULL; + g_autofree gchar *filename_full = NULL; + g_autofree gchar *name = NULL; + g_autoptr(GKeyFile) kf = NULL; + g_autoptr(AsProvide) provide = NULL; /* load file */ filename_full = g_build_filename (tmpdir, filename, NULL); diff --git a/libappstream-builder/plugins/asb-plugin-desktop.c b/libappstream-builder/plugins/asb-plugin-desktop.c index 2be20de..ec412c1 100644 --- a/libappstream-builder/plugins/asb-plugin-desktop.c +++ b/libappstream-builder/plugins/asb-plugin-desktop.c @@ -90,8 +90,8 @@ asb_app_load_icon (AsbApp *app, guint pixbuf_width; guint tmp_height; guint tmp_width; - _cleanup_object_unref_ GdkPixbuf *pixbuf_src = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf_tmp = NULL; + g_autoptr(GdkPixbuf) pixbuf_src = NULL; + g_autoptr(GdkPixbuf) pixbuf_tmp = NULL; /* open file in native size */ if (g_str_has_suffix (filename, ".svg")) { @@ -134,7 +134,7 @@ asb_app_load_icon (AsbApp *app, /* never scale up, just pad */ if (pixbuf_width < icon_size && pixbuf_height < icon_size) { - _cleanup_free_ gchar *size_str = NULL; + g_autofree gchar *size_str = NULL; size_str = g_strdup_printf ("%ix%i", pixbuf_width, pixbuf_height); @@ -197,14 +197,14 @@ asb_plugin_desktop_add_icons (AsbPlugin *plugin, GError **error) { guint min_icon_size; - _cleanup_free_ gchar *fn_hidpi = NULL; - _cleanup_free_ gchar *fn = NULL; - _cleanup_free_ gchar *name_hidpi = NULL; - _cleanup_free_ gchar *name = NULL; - _cleanup_object_unref_ AsIcon *icon_hidpi = NULL; - _cleanup_object_unref_ AsIcon *icon = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf_hidpi = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf = NULL; + g_autofree gchar *fn_hidpi = NULL; + g_autofree gchar *fn = NULL; + g_autofree gchar *name_hidpi = NULL; + g_autofree gchar *name = NULL; + g_autoptr(AsIcon) icon_hidpi = NULL; + g_autoptr(AsIcon) icon = NULL; + g_autoptr(GdkPixbuf) pixbuf_hidpi = NULL; + g_autoptr(GdkPixbuf) pixbuf = NULL; /* find 64x64 icon */ fn = as_utils_find_icon_filename_full (tmpdir, key, @@ -314,10 +314,10 @@ asb_plugin_process_filename (AsbPlugin *plugin, AsIcon *icon; AsAppParseFlags parse_flags = AS_APP_PARSE_FLAG_USE_HEURISTICS; gboolean ret; - _cleanup_free_ gchar *app_id = NULL; - _cleanup_free_ gchar *full_filename = NULL; - _cleanup_object_unref_ AsbApp *app = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf = NULL; + g_autofree gchar *app_id = NULL; + g_autofree gchar *full_filename = NULL; + g_autoptr(AsbApp) app = NULL; + g_autoptr(GdkPixbuf) pixbuf = NULL; /* use GenericName fallback */ if (asb_context_get_flag (plugin->ctx, ASB_CONTEXT_FLAG_USE_FALLBACKS)) @@ -346,14 +346,14 @@ asb_plugin_process_filename (AsbPlugin *plugin, /* is the icon a stock-icon-name? */ icon = as_app_get_icon_default (AS_APP (app)); if (icon != NULL) { - _cleanup_free_ gchar *key = NULL; + g_autofree gchar *key = NULL; key = g_strdup (as_icon_get_name (icon)); if (as_icon_get_kind (icon) == AS_ICON_KIND_STOCK) { asb_package_log (pkg, ASB_PACKAGE_LOG_LEVEL_DEBUG, "using stock icon %s", key); } else { - _cleanup_error_free_ GError *error_local = NULL; + g_autoptr(GError) error_local = NULL; g_ptr_array_set_size (as_app_get_icons (AS_APP (app)), 0); ret = asb_plugin_desktop_add_icons (plugin, app, diff --git a/libappstream-builder/plugins/asb-plugin-firmware.c b/libappstream-builder/plugins/asb-plugin-firmware.c index 64de525..bd98f07 100644 --- a/libappstream-builder/plugins/asb-plugin-firmware.c +++ b/libappstream-builder/plugins/asb-plugin-firmware.c @@ -90,7 +90,7 @@ asb_plugin_firmware_get_checksum (const gchar *filename, GError **error) { gsize len; - _cleanup_free_ gchar *data = NULL; + g_autofree gchar *data = NULL; if (!g_file_get_contents (filename, &data, &len, error)) return NULL; @@ -111,12 +111,12 @@ asb_plugin_process_filename (AsbPlugin *plugin, AsRelease *release; GError *error_local = NULL; const gchar *fw_basename = NULL; - _cleanup_free_ gchar *checksum = NULL; - _cleanup_free_ gchar *filename_full = NULL; - _cleanup_free_ gchar *location_checksum = NULL; - _cleanup_free_ gchar *metainfo_fn = NULL; - _cleanup_object_unref_ AsbApp *app = NULL; - _cleanup_object_unref_ AsChecksum *csum = NULL; + g_autofree gchar *checksum = NULL; + g_autofree gchar *filename_full = NULL; + g_autofree gchar *location_checksum = NULL; + g_autofree gchar *metainfo_fn = NULL; + g_autoptr(AsbApp) app = NULL; + g_autoptr(AsChecksum) csum = NULL; /* parse */ filename_full = g_build_filename (tmpdir, filename, NULL); @@ -160,9 +160,9 @@ asb_plugin_process_filename (AsbPlugin *plugin, /* set the internal checksum */ fw_basename = as_app_get_metadata_item (AS_APP (app), "FirmwareBasename"); if (fw_basename != NULL) { - _cleanup_free_ gchar *checksum_bin = NULL; - _cleanup_free_ gchar *fn_bin = NULL; - _cleanup_object_unref_ AsChecksum *csum_bin = NULL; + g_autofree gchar *checksum_bin = NULL; + g_autofree gchar *fn_bin = NULL; + g_autoptr(AsChecksum) csum_bin = NULL; /* add the checksum for the .bin file */ fn_bin = g_build_filename (tmpdir, fw_basename, NULL); diff --git a/libappstream-builder/plugins/asb-plugin-font.c b/libappstream-builder/plugins/asb-plugin-font.c index a8d55c3..b79669c 100644 --- a/libappstream-builder/plugins/asb-plugin-font.c +++ b/libappstream-builder/plugins/asb-plugin-font.c @@ -82,7 +82,7 @@ asb_font_fix_metadata (AsbApp *app) const gchar *value; gint percentage; guint j; - _cleanup_list_free_ GList *langs = NULL; + g_autoptr(GList) langs = NULL; _cleanup_string_free_ GString *str = NULL; struct { const gchar *lang; @@ -203,7 +203,7 @@ asb_font_fix_metadata (AsbApp *app) "FontIconText", "Aa"); } else { - _cleanup_free_ gchar *icon_tmp = NULL; + g_autofree gchar *icon_tmp = NULL; icon_tmp = g_utf8_substring (value, 0, 2); as_app_add_metadata (AS_APP (app), "FontIconText", @@ -273,7 +273,7 @@ asb_font_add_metadata (AsbApp *app, FT_Face ft_face) for (i = 0; i < len; i++) { FT_Get_Sfnt_Name (ft_face, i, &sfname); for (j = 0; tt_idx_to_md_name[j].key != NULL; j++) { - _cleanup_free_ gchar *val = NULL; + g_autofree gchar *val = NULL; if (sfname.name_id != tt_idx_to_md_name[j].idx) continue; val = g_locale_to_utf8 ((gchar *) sfname.string, @@ -415,14 +415,14 @@ asb_font_add_screenshot (AsbPlugin *plugin, AsbApp *app, FT_Face ft_face, const gchar *temp_dir; const gchar *tmp; guint i; - _cleanup_free_ gchar *basename = NULL; - _cleanup_free_ gchar *cache_fn = NULL; - _cleanup_free_ gchar *output_fn = NULL; - _cleanup_free_ gchar *caption = NULL; - _cleanup_free_ gchar *url_tmp = NULL; - _cleanup_object_unref_ AsImage *im = NULL; - _cleanup_object_unref_ AsScreenshot *ss = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf = NULL; + g_autofree gchar *basename = NULL; + g_autofree gchar *cache_fn = NULL; + g_autofree gchar *output_fn = NULL; + g_autofree gchar *caption = NULL; + g_autofree gchar *url_tmp = NULL; + g_autoptr(AsImage) im = NULL; + g_autoptr(AsScreenshot) ss = NULL; + g_autoptr(GdkPixbuf) pixbuf = NULL; tmp = as_app_get_metadata_item (AS_APP (app), "FontSampleText"); if (tmp == NULL) @@ -588,7 +588,7 @@ asb_plugin_font_set_name (AsbApp *app, const gchar *name) " GPL&GNU", " SC", NULL }; - _cleanup_free_ gchar *tmp = NULL; + g_autofree gchar *tmp = NULL; /* remove font foundary suffix */ tmp = g_strdup (name); @@ -624,10 +624,10 @@ asb_plugin_font_app (AsbPlugin *plugin, AsbApp *app, gboolean ret = TRUE; guint i; const FcPattern *pattern; - _cleanup_free_ gchar *cache_id = NULL; - _cleanup_free_ gchar *comment = NULL; - _cleanup_free_ gchar *icon_filename = NULL; - _cleanup_object_unref_ GdkPixbuf *pixbuf = NULL; + g_autofree gchar *cache_id = NULL; + g_autofree gchar *comment = NULL; + g_autofree gchar *icon_filename = NULL; + g_autoptr(GdkPixbuf) pixbuf = NULL; /* create a new fontconfig configuration */ config = FcConfigCreate (); @@ -695,7 +695,7 @@ asb_plugin_font_app (AsbPlugin *plugin, AsbApp *app, /* generate icon */ tmp = as_app_get_metadata_item (AS_APP (app), "FontIconText"); if (tmp != NULL) { - _cleanup_object_unref_ AsIcon *icon = NULL; + g_autoptr(AsIcon) icon = NULL; pixbuf = asb_font_get_pixbuf (ft_face, 64, 64, tmp, error); if (pixbuf == NULL) { ret = FALSE; @@ -753,7 +753,7 @@ asb_plugin_process_app (AsbPlugin *plugin, filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { GError *error_local = NULL; - _cleanup_free_ gchar *filename = NULL; + g_autofree gchar *filename = NULL; if (!_asb_plugin_check_filename (filelist[i])) continue; @@ -781,7 +781,7 @@ asb_plugin_merge (AsbPlugin *plugin, GList *list) GList *l; GPtrArray *extends_tmp; const gchar *tmp; - _cleanup_hashtable_unref_ GHashTable *hash = NULL; + g_autoptr(GHashTable) hash = NULL; /* add all the fonts to a hash */ hash = g_hash_table_new_full (g_str_hash, g_str_equal, diff --git a/libappstream-builder/plugins/asb-plugin-gettext.c b/libappstream-builder/plugins/asb-plugin-gettext.c index 97cde4c..e7662ce 100644 --- a/libappstream-builder/plugins/asb-plugin-gettext.c +++ b/libappstream-builder/plugins/asb-plugin-gettext.c @@ -123,7 +123,7 @@ asb_gettext_parse_file (AsbGettextContext *ctx, { AsbGettextEntry *entry; AsbGettextHeader *h; - _cleanup_free_ gchar *data = NULL; + g_autofree gchar *data = NULL; gboolean swapped; /* read data, although we only strictly need the header */ @@ -160,8 +160,8 @@ asb_gettext_ctx_search_locale (AsbGettextContext *ctx, { const gchar *filename; guint i; - _cleanup_dir_close_ GDir *dir = NULL; - _cleanup_ptrarray_unref_ GPtrArray *mo_paths = NULL; + g_autoptr(GDir) dir = NULL; + g_autoptr(GPtrArray) mo_paths = NULL; dir = g_dir_open (messages_path, 0, error); if (dir == NULL) @@ -170,7 +170,7 @@ asb_gettext_ctx_search_locale (AsbGettextContext *ctx, /* do a first pass at this, trying to find the prefered .mo */ mo_paths = g_ptr_array_new_with_free_func (g_free); while ((filename = g_dir_read_name (dir)) != NULL) { - _cleanup_free_ gchar *path = NULL; + g_autofree gchar *path = NULL; path = g_build_filename (messages_path, filename, NULL); if (!g_file_test (path, G_FILE_TEST_EXISTS)) continue; @@ -210,8 +210,8 @@ asb_gettext_ctx_search_path (AsbGettextContext *ctx, const gchar *filename; AsbGettextEntry *e; GList *l; - _cleanup_dir_close_ GDir *dir = NULL; - _cleanup_free_ gchar *root = NULL; + g_autoptr(GDir) dir = NULL; + g_autofree gchar *root = NULL; /* search for .mo files in the prefix */ root = g_build_filename (prefix, "/usr/share/locale", NULL); @@ -225,7 +225,7 @@ asb_gettext_ctx_search_path (AsbGettextContext *ctx, if (dir == NULL) return FALSE; while ((filename = g_dir_read_name (dir)) != NULL) { - _cleanup_free_ gchar *path = NULL; + g_autofree gchar *path = NULL; path = g_build_filename (root, filename, "LC_MESSAGES", NULL); if (g_file_test (path, G_FILE_TEST_EXISTS)) { if (!asb_gettext_ctx_search_locale (ctx, filename, path, error)) diff --git a/libappstream-builder/plugins/asb-plugin-gir.c b/libappstream-builder/plugins/asb-plugin-gir.c index 8244bdb..854cb85 100644 --- a/libappstream-builder/plugins/asb-plugin-gir.c +++ b/libappstream-builder/plugins/asb-plugin-gir.c @@ -67,8 +67,8 @@ asb_plugin_process_gir (AsbApp *app, const gchar *name; const gchar *version; gboolean ret = TRUE; - _cleanup_free_ gchar *filename_full = NULL; - _cleanup_object_unref_ GFile *file = NULL; + g_autofree gchar *filename_full = NULL; + g_autoptr(GFile) file = NULL; /* load file */ filename_full = g_build_filename (tmpdir, filename, NULL); diff --git a/libappstream-builder/plugins/asb-plugin-gresource.c b/libappstream-builder/plugins/asb-plugin-gresource.c index 7703b16..d6eebb8 100644 --- a/libappstream-builder/plugins/asb-plugin-gresource.c +++ b/libappstream-builder/plugins/asb-plugin-gresource.c @@ -45,8 +45,8 @@ static gboolean asb_plugin_gresource_app (AsbApp *app, const gchar *filename, GError **error) { gboolean ret; - _cleanup_free_ gchar *data_err = NULL; - _cleanup_free_ gchar *data_out = NULL; + g_autofree gchar *data_err = NULL; + g_autofree gchar *data_out = NULL; const gchar *argv[] = { "/usr/bin/gresource", "list", filename, @@ -85,7 +85,7 @@ asb_plugin_process_app (AsbPlugin *plugin, filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { GError *error_local = NULL; - _cleanup_free_ gchar *filename = NULL; + g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/bin/*", filelist[i])) continue; diff --git a/libappstream-builder/plugins/asb-plugin-gstreamer.c b/libappstream-builder/plugins/asb-plugin-gstreamer.c index 6cf1eed..e44aac8 100644 --- a/libappstream-builder/plugins/asb-plugin-gstreamer.c +++ b/libappstream-builder/plugins/asb-plugin-gstreamer.c @@ -111,7 +111,7 @@ static const AsbGstreamerDescData data[] = { static gboolean asb_utils_is_file_in_tmpdir (const gchar *tmpdir, const gchar *filename) { - _cleanup_free_ gchar *tmp = NULL; + g_autofree gchar *tmp = NULL; tmp = g_build_filename (tmpdir, filename, NULL); return g_file_test (tmp, G_FILE_TEST_EXISTS); } @@ -140,9 +140,9 @@ asb_plugin_process (AsbPlugin *plugin, GPtrArray *keywords; guint i; guint j; - _cleanup_free_ gchar *app_id = NULL; - _cleanup_object_unref_ AsbApp *app = NULL; - _cleanup_object_unref_ AsIcon *icon = NULL; + g_autofree gchar *app_id = NULL; + g_autoptr(AsbApp) app = NULL; + g_autoptr(AsIcon) icon = NULL; _cleanup_string_free_ GString *str = NULL; /* use the pkgname suffix as the app-id */ diff --git a/libappstream-builder/plugins/asb-plugin-ibus-sql.c b/libappstream-builder/plugins/asb-plugin-ibus-sql.c index 66f5fb5..6a6919c 100644 --- a/libappstream-builder/plugins/asb-plugin-ibus-sql.c +++ b/libappstream-builder/plugins/asb-plugin-ibus-sql.c @@ -91,14 +91,14 @@ asb_plugin_process_filename (AsbPlugin *plugin, gint rc; guint i; sqlite3 *db = NULL; - _cleanup_free_ gchar *basename = NULL; - _cleanup_free_ gchar *description = NULL; - _cleanup_free_ gchar *language_string = NULL; - _cleanup_free_ gchar *name = NULL; - _cleanup_free_ gchar *symbol = NULL; - _cleanup_object_unref_ AsbApp *app = NULL; - _cleanup_object_unref_ AsIcon *icon = NULL; - _cleanup_strv_free_ gchar **languages = NULL; + g_autofree gchar *basename = NULL; + g_autofree gchar *description = NULL; + g_autofree gchar *language_string = NULL; + g_autofree gchar *name = NULL; + g_autofree gchar *symbol = NULL; + g_autoptr(AsbApp) app = NULL; + g_autoptr(AsIcon) icon = NULL; + g_auto(GStrv) languages = NULL; /* open IME database */ filename_tmp = g_build_filename (tmpdir, filename, NULL); diff --git a/libappstream-builder/plugins/asb-plugin-ibus-xml.c b/libappstream-builder/plugins/asb-plugin-ibus-xml.c index 0638725..f5180fb 100644 --- a/libappstream-builder/plugins/asb-plugin-ibus-xml.c +++ b/libappstream-builder/plugins/asb-plugin-ibus-xml.c @@ -82,13 +82,13 @@ asb_plugin_process_filename (AsbPlugin *plugin, gboolean found_header = FALSE; gboolean ret; guint i; - _cleanup_free_ gchar *basename = NULL; - _cleanup_free_ gchar *data = NULL; - _cleanup_free_ gchar *filename_tmp = NULL; - _cleanup_object_unref_ AsbApp *app = NULL; - _cleanup_object_unref_ AsIcon *icon = NULL; - _cleanup_strv_free_ gchar **languages = NULL; - _cleanup_strv_free_ gchar **lines = NULL; + g_autofree gchar *basename = NULL; + g_autofree gchar *data = NULL; + g_autofree gchar *filename_tmp = NULL; + g_autoptr(AsbApp) app = NULL; + g_autoptr(AsIcon) icon = NULL; + g_auto(GStrv) languages = NULL; + g_auto(GStrv) lines = NULL; /* open file */ filename_tmp = g_build_filename (tmpdir, filename, NULL); diff --git a/libappstream-builder/plugins/asb-plugin-kde-services.c b/libappstream-builder/plugins/asb-plugin-kde-services.c index 1db073a..cf0e830 100644 --- a/libappstream-builder/plugins/asb-plugin-kde-services.c +++ b/libappstream-builder/plugins/asb-plugin-kde-services.c @@ -51,8 +51,8 @@ asb_plugin_process_filename (const gchar *filename, const gchar *tmpdir, GError **error) { - _cleanup_free_ gchar *types = NULL; - _cleanup_keyfile_unref_ GKeyFile *kf = NULL; + g_autofree gchar *types = NULL; + g_autoptr(GKeyFile) kf = NULL; kf = g_key_file_new (); if (!g_key_file_load_from_file (kf, filename, G_KEY_FILE_NONE, error)) return FALSE; @@ -82,8 +82,8 @@ asb_plugin_process_app (AsbPlugin *plugin, /* look for a krunner provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { - _cleanup_error_free_ GError *error_local = NULL; - _cleanup_free_ gchar *filename = NULL; + g_autoptr(GError) error_local = NULL; + g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/share/kde4/services/*.desktop", filelist[i])) continue; filename = g_build_filename (tmpdir, filelist[i], NULL); diff --git a/libappstream-builder/plugins/asb-plugin-metainfo.c b/libappstream-builder/plugins/asb-plugin-metainfo.c index 9a3f2e1..5f54d65 100644 --- a/libappstream-builder/plugins/asb-plugin-metainfo.c +++ b/libappstream-builder/plugins/asb-plugin-metainfo.c @@ -72,7 +72,7 @@ asb_plugin_process_filename (AsbPlugin *plugin, GList **apps, GError **error) { - _cleanup_object_unref_ AsbApp *app = NULL; + g_autoptr(AsbApp) app = NULL; app = asb_app_new (pkg, NULL); if (!as_app_parse_file (AS_APP (app), filename, @@ -110,7 +110,7 @@ asb_plugin_process (AsbPlugin *plugin, filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { - _cleanup_free_ gchar *filename_tmp = NULL; + g_autofree gchar *filename_tmp = NULL; if (!_asb_plugin_check_filename (filelist[i])) continue; filename_tmp = g_build_filename (tmpdir, filelist[i], NULL); @@ -146,7 +146,7 @@ asb_plugin_merge (AsbPlugin *plugin, GList *list) AsApp *app; AsApp *found; GList *l; - _cleanup_hashtable_unref_ GHashTable *hash = NULL; + g_autoptr(GHashTable) hash = NULL; /* make a hash table of ID->AsApp */ hash = g_hash_table_new_full (g_str_hash, g_str_equal, diff --git a/libappstream-builder/plugins/asb-plugin-nm.c b/libappstream-builder/plugins/asb-plugin-nm.c index 569e9df..e583581 100644 --- a/libappstream-builder/plugins/asb-plugin-nm.c +++ b/libappstream-builder/plugins/asb-plugin-nm.c @@ -45,8 +45,8 @@ static gboolean asb_plugin_nm_app (AsbApp *app, const gchar *filename, GError **error) { gboolean ret; - _cleanup_free_ gchar *data_err = NULL; - _cleanup_free_ gchar *data_out = NULL; + g_autofree gchar *data_err = NULL; + g_autofree gchar *data_out = NULL; const gchar *argv[] = { "/usr/bin/nm", "--dynamic", "--no-sort", @@ -91,7 +91,7 @@ asb_plugin_process_app (AsbPlugin *plugin, filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { GError *error_local = NULL; - _cleanup_free_ gchar *filename = NULL; + g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/usr/bin/*", filelist[i])) continue; diff --git a/libappstream-builder/plugins/asb-plugin-ostree.c b/libappstream-builder/plugins/asb-plugin-ostree.c index a07fc7f..c9729a8 100644 --- a/libappstream-builder/plugins/asb-plugin-ostree.c +++ b/libappstream-builder/plugins/asb-plugin-ostree.c @@ -48,9 +48,9 @@ asb_plugin_add_globs (AsbPlugin *plugin, GPtrArray *globs) static gboolean asb_plugin_process_filename (const gchar *filename, AsbApp *app, GError **error) { - _cleanup_free_ gchar *app_runtime = NULL; - _cleanup_free_ gchar *app_sdk = NULL; - _cleanup_keyfile_unref_ GKeyFile *kf = NULL; + g_autofree gchar *app_runtime = NULL; + g_autofree gchar *app_sdk = NULL; + g_autoptr(GKeyFile) kf = NULL; kf = g_key_file_new (); if (!g_key_file_load_from_file (kf, filename, G_KEY_FILE_NONE, error)) return FALSE; @@ -81,8 +81,8 @@ asb_plugin_process_app (AsbPlugin *plugin, /* look for a krunner provider */ filelist = asb_package_get_filelist (pkg); for (i = 0; filelist[i] != NULL; i++) { - _cleanup_error_free_ GError *error_local = NULL; - _cleanup_free_ gchar *filename = NULL; + g_autoptr(GError) error_local = NULL; + g_autofree gchar *filename = NULL; if (!asb_plugin_match_glob ("/metadata", filelist[i])) continue; filename = g_build_filename (tmpdir, filelist[i], NULL); |