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:
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
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
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.