On 11/3/22 12:24, Bernhard Kölbl (@besentv) wrote:
On Thu Nov 3 18:21:40 2022 +0000, **** wrote:
Paul Gofman replied on the mailing list:
On 11/3/22 12:10, Paul Gofman wrote: > On 11/3/22 12:01, Bernhard Kölbl (@besentv) wrote: >> Bernhard Kölbl (@besentv) commented about >> dlls/windows.gaming.ui.gamebar/main.c: >>> return S_OK; >>> } >>> + if (IsEqualGUID( iid, &IID_IGameBarStatics )) >>> + { >>> + *out = &impl->IGameBarStatics_iface; >>> + IInspectable_AddRef( *out ); >> You could probably make this a one-liner as well, like in line 52. >> > TBH I intentionally removed it (and missed in line 52) as in general I > think assignment in a function call argument used to be considered a > bad practice in Wine. Unless anyone feels striong about it I'd rather > change it in line 52. > > Actually, IInspectable_AddRef is a macro, which gives more reasons to avoid assignment in the argument as a general practice.
Idk, we already did it a bunch of times so far, let's leave it up to Rémi.
Thing is, the macro may (and does so in this specific case) substitue the argument more than once. That means that the statement given as macro argument will be executed multiple times. That is a problem in case when a function call involved in the statement, probably less so if it is an assignment like here. But IMO it is easier and more readable to just avoid such inlining rather than reasoning about what such an inlined statement can legitimately do or what it should not.