Re: [Cocci] Replacing a struct member with a function call

2021-03-18 Thread Thomas Adam
Hi all, Thanks for your help. This is now resolved! Kindly, Thomas On Tue, 16 Mar 2021 at 07:20, Julia Lawall wrote: > > > > On Mon, 15 Mar 2021, Mansour Moufid wrote: > > > On Sun, Mar 14, 2021, 20:43 Thomas Adam wrote: > > Hello, > > > > I can see I was as clear as mud with my e

Re: [Cocci] Replacing a struct member with a function call

2021-03-16 Thread Julia Lawall
On Mon, 15 Mar 2021, Mansour Moufid wrote: > On Sun, Mar 14, 2021, 20:43 Thomas Adam wrote: > Hello, > > I can see I was as clear as mud with my explanation -- apologies > for > that, so let me try again. > > In my original example: > > struct monitor { >

Re: [Cocci] Replacing a struct member with a function call

2021-03-15 Thread Mansour Moufid
On Sun, Mar 14, 2021, 20:43 Thomas Adam wrote: > Hello, > > I can see I was as clear as mud with my explanation -- apologies for > that, so let me try again. > > In my original example: > > struct monitor { > struct { > int width; > int height > } virtual; > }; > > ... the

Re: [Cocci] Replacing a struct member with a function call

2021-03-14 Thread Julia Lawall
On Mon, 15 Mar 2021, Thomas Adam wrote: > Hello, > > I can see I was as clear as mud with my explanation -- apologies for > that, so let me try again. > > In my original example: > > struct monitor { > struct { > int width; > int height > } virtual; > }; > > ... the memb

Re: [Cocci] Replacing a struct member with a function call

2021-03-14 Thread Thomas Adam
Hello, I can see I was as clear as mud with my explanation -- apologies for that, so let me try again. In my original example: struct monitor { struct { int width; int height } virtual; }; ... the members width and height aren't required any more, as they're actually com

Re: [Cocci] Replacing a struct member with a function call

2021-03-14 Thread Julia Lawall
On Sun, 14 Mar 2021, Wolfram Sang wrote: > > > @@ > > type M; > > This? > > struct monitor* m; > > > @@ > > - m->virtual.width; > > + get_monitor_width(); I guess that m should be somewhere in teh call to get_monitor_width too? julia ___ Cocci maili

Re: [Cocci] Replacing a struct member with a function call

2021-03-13 Thread Wolfram Sang
> @@ > type M; This? struct monitor* m; > @@ > - m->virtual.width; > + get_monitor_width(); signature.asc Description: PGP signature ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

[Cocci] Replacing a struct member with a function call

2021-03-13 Thread Thomas Adam
Hello all, I'm wanting to replace a struct member with a function call across the code base I'm working on. For example, I currently have the following struct definition (simplified): struct monitor { struct { int width; int height } virtual; }; Across my code base, I ty