From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Change function invocations argument
Date: Sun, 21 Dec 2014 12:55:57 +0100 [thread overview]
Message-ID: <5496B54D.8050501@users.sourceforge.net> (raw)
In-Reply-To: <2BD158D5-96AC-4BEC-81B9-F07A54C7BEEB@gmail.com>
> @@ typedef long_u, uintmax_t; expression e1, e2, e3; @@
>
> put_bytes(
> e1,
> (
> - (long_u)(e2)
> |
> - (long_u)e2
> )
> + (uintmax_t)e2
> ,
> (
> - (int)(e3)
> + (unsigned int)e3
> |
> - (int)e3
> + (unsigned int)e3
> |
> e3
> )
> )
Can it be that you need to fiddle with SmPL disjunctions a bit less here
because the metavariable type (or an isomorphism) will take care for
additional parentheses around the affected expressions?
How do you think about the applicability of the following approach?
@parameter_cast_replacement@
expression e1, e2, e3;
typedef long_u, uintmax_t;
@@
put_bytes(e1,
- (long_u)
+ (uintmax_t)
e2,
(
- (int)
+ (unsigned int)
e3
|
e3
)
)
Regards,
Markus
next prev parent reply other threads:[~2014-12-21 11:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-20 20:21 [Cocci] Change function invocations argument Eliseo Martínez
2014-12-20 20:32 ` Julia Lawall
2014-12-20 20:45 ` Eliseo Martínez
2014-12-20 20:51 ` Julia Lawall
2014-12-21 10:43 ` Eliseo Martínez
2014-12-21 10:57 ` Julia Lawall
2014-12-21 11:14 ` Eliseo Martínez
2014-12-21 11:16 ` Julia Lawall
2014-12-21 11:19 ` Eliseo Martínez
2014-12-21 11:20 ` Julia Lawall
2014-12-21 11:55 ` SF Markus Elfring [this message]
2014-12-21 12:04 ` Julia Lawall
2014-12-21 12:24 ` Eliseo Martínez
2014-12-21 12:49 ` SF Markus Elfring
2014-12-21 12:50 ` Eliseo Martínez
2014-12-21 12:55 ` SF Markus Elfring
2014-12-21 13:12 ` Eliseo Martínez
2014-12-21 13:44 ` [Cocci] Source code clean-up for parentheses? SF Markus Elfring
2014-12-21 13:48 ` SF Markus Elfring
2014-12-21 14:13 ` [Cocci] Change function invocations argument Julia Lawall
2014-12-21 14:01 ` Julia Lawall
2014-12-22 13:33 ` Michael Stefaniuc
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=5496B54D.8050501@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.