kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* coccinelle
@ 2017-03-14  7:21 Tobin C. Harding
  2017-03-14  7:52 ` coccinelle Peter Senna Tschudin
  2017-03-14  8:26 ` coccinelle Nicholas Mc Guire
  0 siblings, 2 replies; 5+ messages in thread
From: Tobin C. Harding @ 2017-03-14  7:21 UTC (permalink / raw)
  To: kernelnewbies

Attempting to do transform using Coccinelle

if (foo != 0) {
   ...

->

if (foo) {
   ...

Coccinelle script attempt does not work

@@ expression x; @@
(
- x != 0
+ x
)

`spatch --parse-cocci script.cocci` appears to pass. A similar script
worked correctly

@@ expression x; @@
(
- x == 0
+ !x
)

I have read various papers and tutorials to no avail. I have tried
various other versions also with no success.

Any pointers most appreciated.

thanks,
Tobin.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-14 11:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-14  7:21 coccinelle Tobin C. Harding
2017-03-14  7:52 ` coccinelle Peter Senna Tschudin
2017-03-14 11:01   ` coccinelle Tobin C. Harding
2017-03-14  8:26 ` coccinelle Nicholas Mc Guire
2017-03-14 11:00   ` coccinelle Tobin C. Harding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).