On Fri Apr 17 17:22:25 2026 +0000, Rémi Bernon wrote:
Well portability considerations aside, it's also a matter of whether adding new style patterns to the code really helps making things more readable or convenient, given that style discrepancies have a fixed toll on the reader. In this particular case, I'm not fully convinced that it does. For instance: ``` static POINT pixel_to_himetric( POINT px ) { UINT dpi = HIMETRIC / get_system_dpi(); return (POINT) { .x = px.x * dpi, .y = px.y * dpi, }; } ``` vs: ``` static POINT pixel_to_himetric( POINT px ) { UINT dpi = HIMETRIC / get_system_dpi(); px.x *= dpi; px.y *= dpi; return px; } ``` The latter is even shorter. In addition (and it is not the case here, but we've discussed the case before), the `(<type>) { <init> }` syntax has a very unfortunate "cast-like" looking that can be confusing to any unaware reader. Also, when used to pass parameters, the lifetime of the literal is well defined but potentially full of pitfalls, like this: ``` int *foo( int *a ); /* { return a; } */ /* this is fine: */ int bar(void) { return *foo( (int []) { 1 } ); } /* this is bad, there's a warning only if compiler can figure what foo does: */ int *baz(void) { return foo( (int []) { 1 } ); } int bad(void) { return *baz(); } ``` using map_dpi_{point,rect} indirectly removed both uses of compound literals
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10649#note_136801