[PATCH 2/3] Add missing transfer annotation

Andrew Bird ajb at spheresystems.co.uk
Wed Nov 14 08:23:55 PST 2012


This patch adds the transfer notations needed for gobject
introspection to build without warnings. The modes have been
set according to the info in the comments, but I am not familiar
with the libqmi codebase so please ensure they are correct.

Signed-off-by: Andrew Bird <ajb at spheresystems.co.uk>
---
 libqmi-glib/qmi-client.c  | 4 ++--
 libqmi-glib/qmi-device.c  | 8 ++++----
 libqmi-glib/qmi-message.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libqmi-glib/qmi-client.c b/libqmi-glib/qmi-client.c
index aec7299..a199bd5 100644
--- a/libqmi-glib/qmi-client.c
+++ b/libqmi-glib/qmi-client.c
@@ -73,7 +73,7 @@ struct _QmiClientPrivate {
  *
  * Get the #QmiDevice associated with this #QmiClient.
  *
- * Returns: a #GObject that must be freed with g_object_unref().
+ * Returns: (transfer full): a #GObject that must be freed with g_object_unref().
  */
 GObject *
 qmi_client_get_device (QmiClient *self)
@@ -96,7 +96,7 @@ qmi_client_get_device (QmiClient *self)
  * Get the #QmiDevice associated with this #QmiClient, without increasing the reference count
  * on the returned object.
  *
- * Returns: a #GObject. Do not free the returned object, it is owned by @self.
+ * Returns: (transfer none): a #GObject. Do not free the returned object, it is owned by @self.
  */
 GObject *
 qmi_client_peek_device (QmiClient *self)
diff --git a/libqmi-glib/qmi-device.c b/libqmi-glib/qmi-device.c
index 04903c2..3fa438b 100644
--- a/libqmi-glib/qmi-device.c
+++ b/libqmi-glib/qmi-device.c
@@ -380,7 +380,7 @@ check_message_supported (QmiDevice *self,
  *
  * Get the #GFile associated with this #QmiDevice.
  *
- * Returns: a #GFile that must be freed with g_object_unref().
+ * Returns: (transfer full): a #GFile that must be freed with g_object_unref().
  */
 GFile *
 qmi_device_get_file (QmiDevice *self)
@@ -402,7 +402,7 @@ qmi_device_get_file (QmiDevice *self)
  * Get the #GFile associated with this #QmiDevice, without increasing the reference count
  * on the returned object.
  *
- * Returns: a #GFile. Do not free the returned object, it is owned by @self.
+ * Returns: (transfer none): a #GFile. Do not free the returned object, it is owned by @self.
  */
 GFile *
 qmi_device_peek_file (QmiDevice *self)
@@ -534,7 +534,7 @@ allocate_client_context_complete_and_free (AllocateClientContext *ctx)
  *
  * Finishes an operation started with qmi_device_allocate_client().
  *
- * Returns: a newly allocated #QmiClient, or #NULL if @error is set.
+ * Returns: (transfer full): a newly allocated #QmiClient, or #NULL if @error is set.
  */
 QmiClient *
 qmi_device_allocate_client_finish (QmiDevice *self,
@@ -1716,7 +1716,7 @@ qmi_device_close (QmiDevice *self,
  *
  * Finishes an operation started with qmi_device_command().
  *
- * Returns: a #QmiMessage response, or #NULL if @error is set. The returned value should be freed with qmi_message_unref().
+ * Returns: (transfer full): a #QmiMessage response, or #NULL if @error is set. The returned value should be freed with qmi_message_unref().
  */
 QmiMessage *
 qmi_device_command_finish (QmiDevice *self,
diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c
index 6e7bf42..a4d1775 100644
--- a/libqmi-glib/qmi-message.c
+++ b/libqmi-glib/qmi-message.c
@@ -503,7 +503,7 @@ qmi_message_new (QmiService service,
  *
  * Atomically increments the reference count of @self by one.
  *
- * Returns: (transfer full) the new reference to @self.
+ * Returns: (transfer full): the new reference to @self.
  */
 QmiMessage *
 qmi_message_ref (QmiMessage *self)
-- 
1.7.11.7



More information about the libqmi-devel mailing list