diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2015-05-04 18:22:39 -0400 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2015-05-06 21:51:19 -0400 |
commit | 4ee1acd98109e98fd0a659f43d3187597d034f05 (patch) | |
tree | 4847d102bb7353737d21bf4825a2e3c041ba221f /src/libostree/ostree-repo-static-delta-processing.c | |
parent | 7a62d64968160d27cbd90aeeed754eb185135f91 (diff) | |
download | ostree-4ee1acd98109e98fd0a659f43d3187597d034f05.tar.gz |
Use g_autoptr() for GIO object types
GLib 2.44 supplies all the necessary autocleanup macros for GIO types,
and libglnx backports the relevant macros for ostree.
Diffstat (limited to 'src/libostree/ostree-repo-static-delta-processing.c')
-rw-r--r-- | src/libostree/ostree-repo-static-delta-processing.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libostree/ostree-repo-static-delta-processing.c b/src/libostree/ostree-repo-static-delta-processing.c index b82593b9..32e6157e 100644 --- a/src/libostree/ostree-repo-static-delta-processing.c +++ b/src/libostree/ostree-repo-static-delta-processing.c @@ -157,7 +157,7 @@ _ostree_static_delta_part_validate (OstreeRepo *repo, GError **error) { gboolean ret = FALSE; - gs_unref_object GInputStream *tmp_in = NULL; + g_autoptr(GInputStream) tmp_in = NULL; g_autofree guchar *actual_checksum_bytes = NULL; g_autofree char *actual_checksum = NULL; @@ -290,9 +290,9 @@ decompress_all (GConverter *converter, GError **error) { gboolean ret = FALSE; - gs_unref_object GMemoryInputStream *memin = (GMemoryInputStream*)g_memory_input_stream_new_from_bytes (data); - gs_unref_object GMemoryOutputStream *memout = (GMemoryOutputStream*)g_memory_output_stream_new (NULL, 0, g_realloc, g_free); - gs_unref_object GInputStream *convin = g_converter_input_stream_new ((GInputStream*)memin, converter); + g_autoptr(GMemoryInputStream) memin = (GMemoryInputStream*)g_memory_input_stream_new_from_bytes (data); + g_autoptr(GMemoryOutputStream) memout = (GMemoryOutputStream*)g_memory_output_stream_new (NULL, 0, g_realloc, g_free); + g_autoptr(GInputStream) convin = g_converter_input_stream_new ((GInputStream*)memin, converter); { gssize n_bytes_written = g_output_stream_splice ((GOutputStream*)memout, convin, @@ -345,7 +345,7 @@ _ostree_static_delta_part_execute (OstreeRepo *repo, break; case 'x': { - gs_unref_object GConverter *decomp = + g_autoptr(GConverter) decomp = (GConverter*) _ostree_lzma_decompressor_new (); if (!decompress_all (decomp, part_payload_bytes, &payload_data, @@ -523,7 +523,7 @@ dispatch_bspatch (OstreeRepo *repo, { gboolean ret = FALSE; guint64 offset, length; - gs_unref_object GInputStream *in_stream = NULL; + g_autoptr(GInputStream) in_stream = NULL; g_autoptr(GMappedFile) input_mfile = NULL; g_autofree guchar *buf = NULL; struct bspatch_stream stream; @@ -606,8 +606,8 @@ dispatch_open_splice_and_close (OstreeRepo *repo, guint64 content_offset; guint64 objlen; gsize bytes_written; - gs_unref_object GInputStream *object_input = NULL; - gs_unref_object GInputStream *memin = NULL; + g_autoptr(GInputStream) object_input = NULL; + g_autoptr(GInputStream) memin = NULL; if (!do_content_open_generic (repo, state, cancellable, error)) goto out; @@ -645,7 +645,7 @@ dispatch_open_splice_and_close (OstreeRepo *repo, else { /* Slower path, for symlinks and unpacking deltas into archive-z2 */ - gs_unref_object GFileInfo *finfo = NULL; + g_autoptr(GFileInfo) finfo = NULL; finfo = _ostree_header_gfile_info_new (state->mode, state->uid, state->gid); |