[PATCH 3/3] Add missing scope annotation
Dan Williams
dcbw at redhat.com
Fri Nov 16 09:15:37 PST 2012
On Thu, 2012-11-15 at 18:27 +0000, Andrew Bird wrote:
> On Thursday 15 November 2012 11:57:55 Dan Williams wrote:
> > On Wed, 2012-11-14 at 16:23 +0000, Andrew Bird wrote:
> > > This patch adds the scope notations needed for gobject
> > > introspection to build without warnings. The value has been
> > > set according to the gist of the comments, but I am not familiar
> > > with the libqmi codebase so please ensure it is correct.
> > >
> > > Signed-off-by: Andrew Bird <ajb at spheresystems.co.uk>
> > > ---
> > >
> > > libqmi-glib/qmi-message.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libqmi-glib/qmi-message.c b/libqmi-glib/qmi-message.c
> > > index a4d1775..e1e90c9 100644
> > > --- a/libqmi-glib/qmi-message.c
> > > +++ b/libqmi-glib/qmi-message.c
> > > @@ -583,7 +583,7 @@ qmi_message_get_raw_tlv (QmiMessage *self,
> > >
> > > /**
> > >
> > > * qmi_message_foreach_raw_tlv:
> > > * @self: a #QmiMessage.
> > >
> > > - * @func: the function to call for each TLV.
> > > + * @func: (scope notified): the function to call for each TLV.
> > >
> > > * @user_data: user data to pass to the function.
> > > *
> > > * Calls the given function for each TLV found within the #QmiMessage.
> >
> > I'm not entirely sure that 'notified' is the right scope, since that
> > apparently depends on a GDestroyNotify argument which this function
> > doesn't have:
> >
> > "notified - valid until the GDestroyNotify argument is called. Can be
> > called multiple times before the GDestroyNotify is called."
> >
> > An example of a 'notified' scope would be g_idle_add_full(), which
> > doesn't match the pattern of this function. I believe that the callback
> > is valid only for the duration of this call, in which case 'scope call'
> > is appropriate. What was the original warning?
> >
> > Dan
>
> Hi Dan,
> Yes this was my least confident patch :-) Here's the warning:
>
> GISCAN libqmi-glib.gir
> qmi-message.c:583: Warning: libqmi: qmi_message_foreach_raw_tlv: argument
> func: Missing (scope) annotation for callback without GDestroyNotify (valid:
> call, async)
I'd just go with (scope call).
Dan
More information about the libqmi-devel
mailing list