Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: wagi@monom.org (Daniel Wagner)
To: cocci@systeme.lip6.fr
Subject: [Cocci] gboolean -> bool conversion
Date: Wed, 17 Jul 2013 17:40:31 +0200	[thread overview]
Message-ID: <51E6BAEF.6030400@monom.org> (raw)
In-Reply-To: <alpine.DEB.2.02.1307171709540.2113@hadrien>

On 07/17/2013 05:11 PM, Julia Lawall wrote:
> On Wed, 17 Jul 2013, Daniel Wagner wrote:
>
>> On 07/17/2013 11:01 AM, Julia Lawall wrote:
>>>> I am still struggling with creating a rule for a prototype.
>>>> Rereading examples
>>>> and documentation.
>>>>
>>>> So I am only allowed to write a prototype (funproto, right?) in the
>>>> declaration section (common_decl)? How do I write the rule?
>>>>
>>>> (I am really bad not getting this done by myself.)
>>>
>>> Could you send your attempt?  It should be possible to write a function
>>> prototype pattern just like any other pattern, but it is true that I
>>> haven't done that very much, so it might be deficient in some way.
>>
>> So my approach was to try this here:
>>
>>
>> @r@
>> identifier f;
>> parameter list[n] ps;
>> identifier i;
>> @@
>>
>> f(ps, gboolean i, ...);
>
> Just add the metavariable declaration
>
> type T;
>
> and T to the left of f in the prototype.  For function definitions, it
> is OK with the return type being absent, but apparently not for
> prototypes. Leaving it out probably causes conflicts for the parser,
> because a prototype looks like a function call.

Yes, that did the trick. Thanks again!

cheers,
daniel

      reply	other threads:[~2013-07-17 15:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11  8:17 [Cocci] gboolean -> bool conversion Daniel Wagner
2013-07-11  8:29 ` Julia Lawall
2013-07-11  9:07   ` Daniel Wagner
2013-07-11  9:57     ` Julia Lawall
2013-07-11  9:58     ` Daniel Wagner
2013-07-11 10:24       ` Julia Lawall
2013-07-11 11:17         ` Daniel Wagner
2013-07-11 12:17           ` Julia Lawall
2013-07-11 12:38             ` Daniel Wagner
2013-07-11 13:07               ` Julia Lawall
2013-07-12  6:55                 ` Daniel Wagner
2013-07-12  7:00                   ` Julia Lawall
2013-07-12  9:08                     ` Daniel Wagner
2013-07-16 14:21                     ` Daniel Wagner
2013-07-16 16:22                       ` Julia Lawall
2013-07-17  8:47                         ` Daniel Wagner
2013-07-17  9:01                           ` Julia Lawall
2013-07-17 14:58                             ` Daniel Wagner
2013-07-17 15:11                               ` Julia Lawall
2013-07-17 15:40                                 ` Daniel Wagner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E6BAEF.6030400@monom.org \
    --to=wagi@monom.org \
    --cc=cocci@systeme.lip6.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox