On Fri, Jun 9, 2017 at 7:28 PM Marc-André Lureau <marcandre.lur...@gmail.com> wrote:
> Hi > > On Fri, Jun 9, 2017 at 7:20 PM Eric Blake <ebl...@redhat.com> wrote: > >> A recent patch submission was about to use qobject_decref(QOBJECT(E)), >> even though we already have QDECREF(E) for that purpose. While our >> tree is currently free from the longhand form, we might as well update >> > > Oh? > > $ git grep 'object_unref(OBJECT(' | wc -l > 152 > > ah not the same object kind :) our coccinelle script to catch any future relapses. >> > > sadly, coccinelle is unabarebly slow on my machine, not easy to grasp, and > thereby fails to catch a lot of cases.. I am looking at alternative from > clang tools/lib, by curiosity. > > >> >> Signed-off-by: Eric Blake <ebl...@redhat.com> >> --- >> scripts/coccinelle/qobject.cocci | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/scripts/coccinelle/qobject.cocci >> b/scripts/coccinelle/qobject.cocci >> index 97703a4..656dc3e 100644 >> --- a/scripts/coccinelle/qobject.cocci >> +++ b/scripts/coccinelle/qobject.cocci >> @@ -3,6 +3,12 @@ >> expression Obj, Key, E; >> @@ >> ( >> +- qobject_incref(QOBJECT(E)); >> ++ QINCREF(E); >> +| >> +- qobject_decref(QOBJECT(E)); >> ++ QDECREF(E); >> +| >> - qdict_put_obj(Obj, Key, QOBJECT(E)); >> + qdict_put(Obj, Key, E); >> | >> -- >> 2.9.4 >> >> >> -- > Marc-André Lureau > -- Marc-André Lureau