Hello,

The following change specification gets accepted by the Coccinelle software.

@@
expression X;
@@
-((X-1)&X) == 0
+powerof2(X)


See also:
https://github.com/DragonFlyBSD/DragonFlyBSD/blob/722c3b8b6376deab9407ff00b5e63018ab3aef0b/test/cocci/useful_macros.cocci#L53


I got into the development mood to try another code variant out
for the semantic patch language.

@adjustment@
expression X;
@@
+powerof2(
-(X-1)&
 X)
- == 0


Unfortunately, the error message “unexpected close parenthesis in line 6”
is reported then.
Can an other change variation make sense finally?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to