Re: [Cocci] getting rid of implicit boolean expressions

2021-04-21 Thread Julia Lawall
On Wed, 21 Apr 2021, Akos Pasztory wrote: > Hi, > > I'm trying do the following kind of transformations: > >  int x, y; >  char *p; >  bool b, c; > > -b = x || !y; > +b = (x != 0) || (y == 0); > > -c = !p; > +c = (p == NULL); > > -if (x & 3) > +if ((x & 3) != 0) >  f(); > // etc > > That is:

[Cocci] getting rid of implicit boolean expressions

2021-04-21 Thread Akos Pasztory
Hi, I'm trying do the following kind of transformations: int x, y; char *p; bool b, c; -b = x || !y; +b = (x != 0) || (y == 0); -c = !p; +c = (p == NULL); -if (x & 3) +if ((x & 3) != 0) f(); // etc That is: trying to eliminate implicit boolean-ness (and add parentheses as well). I was

Re: [Cocci] [PATCH] Fix parse error in presence of symbols named far

2021-04-21 Thread Julia Lawall
On Wed, 21 Apr 2021, Fuad Tabba wrote: > Hi, > > I just started using Coccinelle yesterday, and I can already see > it saving me a lot of time and agony. Thank you. > > I ran into a problem, and I think that this patch might fix it, > hopefully without causing other problems. I did some sanity

[Cocci] [PATCH] Fix parse error in presence of symbols named far

2021-04-21 Thread Fuad Tabba
Hi, I just started using Coccinelle yesterday, and I can already see it saving me a lot of time and agony. Thank you. I ran into a problem, and I think that this patch might fix it, hopefully without causing other problems. I did some sanity checking on my kernel tree, and it seems to be fine.