From mboxrd@z Thu Jan 1 00:00:00 1970 From: elfring@users.sourceforge.net (SF Markus Elfring) Date: Sun, 21 Dec 2014 12:55:57 +0100 Subject: [Cocci] Change function invocations argument In-Reply-To: <2BD158D5-96AC-4BEC-81B9-F07A54C7BEEB@gmail.com> References: <254A1CAA-2FA6-4546-91BD-5E0C449C7F94@gmail.com> <2BD158D5-96AC-4BEC-81B9-F07A54C7BEEB@gmail.com> Message-ID: <5496B54D.8050501@users.sourceforge.net> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr > @@ 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