Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Markus Elfring
>> @replacement3@ >> identifier x; >> @@ >> -int >> +int* >> x; >> <+... >> -f >> +g >> (x); >> ...+> > > His example shows that he wants to change a parameter type, He would like to call a function which gets a single pointer passed instead of an integer by possibly varying variables. > no

Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Julia Lawall
On Mon, 27 May 2019, Markus Elfring wrote: > > In other words, in my original code "int x" is passed to "void f(int)" as a > > paramter, > > and I would like to apply the following transformations: > > How do you think about to try a SmPL change specification out like the > following? > > @re

Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Markus Elfring
> In other words, in my original code "int x" is passed to "void f(int)" as a > paramter, > and I would like to apply the following transformations: How do you think about to try a SmPL change specification out like the following? @replacement3@ identifier x; @@ -int +int* x; <+... -f +g (x

Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Markus Elfring
>> @replacement@ >> identifier x; >> @@ >> -int >> +int* >>   x; > >> >> In which scopes would you like to add the asterisk for the usage of a pointer >> data type? … > 1) "x" has a type of "int *" The asterisk addition seems to work for (local) variables. > 2) the new "int *x" gets passed to a

Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Christoph Böhmwalder
On 27.05.19 16:16, Markus Elfring wrote: Am I missing something? It depends on details. Your initial transformation approach can be written also as follows. @replacement@ identifier x; @@ -int +int* x; > In which scopes would you like to add the asterisk for the usage of a pointer data typ

Re: [Cocci] Checking change scope for a data type replacement

2019-05-27 Thread Markus Elfring
> Am I missing something? It depends on details. Your initial transformation approach can be written also as follows. @replacement@ identifier x; @@ -int +int* x; In which scopes would you like to add the asterisk for the usage of a pointer data type? Do you expect that function parameters s