> @@ 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
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to