core: Make ot_transfer_out_value() take a & for the second argument
As Ray Strode argued, it's confusing to have something that looks like a function be magical. And OT_TRANSFER_OUT_VALUE is uglier.
This commit is contained in:
1 parent
35fa68a74c
commit
d6ceb91c35
7 files changed
+47
-47
No files matched your search
@@ -188,7 +188,7 @@ ot_gio_splice_and_checksum (GOutputStream *out,
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
ot_transfer_out_value(out_checksum, ret_checksum);
|
||||
ot_transfer_out_value(out_checksum, &ret_checksum);
|
||||
out:
|
||||
ot_clear_checksum (&ret_checksum);
|
||||
return ret;
|
||||
|
||||
@@ -67,7 +67,7 @@ ot_util_spawn_pager (GOutputStream **out_stream,
|
||||
ret_stream = (GOutputStream*)g_unix_output_stream_new (stdin_fd, TRUE);
|
||||
}
|
||||
|
||||
ot_transfer_out_value(out_stream, ret_stream);
|
||||
ot_transfer_out_value(out_stream, &ret_stream);
|
||||
ret = TRUE;
|
||||
out:
|
||||
g_clear_object (&ret_stream);
|
||||
@@ -149,7 +149,7 @@ ot_util_path_split_validate (const char *path,
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
ot_transfer_out_value(out_components, ret_components);
|
||||
ot_transfer_out_value(out_components, &ret_components);
|
||||
out:
|
||||
if (ret_components)
|
||||
g_ptr_array_unref (ret_components);
|
||||
|
||||
@@ -114,7 +114,7 @@ ot_util_variant_map (GFile *src,
|
||||
g_variant_ref_sink (ret_variant);
|
||||
|
||||
ret = TRUE;
|
||||
ot_transfer_out_value(out_variant, ret_variant);
|
||||
ot_transfer_out_value(out_variant, &ret_variant);
|
||||
out:
|
||||
ot_clear_gvariant (&ret_variant);
|
||||
if (mfile)
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#define ot_transfer_out_value(outp, srcp) G_STMT_START { \
|
||||
if (outp) \
|
||||
{ \
|
||||
*outp = srcp; \
|
||||
srcp = NULL; \
|
||||
*outp = *srcp; \
|
||||
*(srcp) = NULL; \
|
||||
} \
|
||||
} G_STMT_END;
|
||||
|
||||
|
||||
Reference in new issue
Block a user