Rémi Bernon (@rbernon) commented about dlls/dmusic/instrument.c:
UINT index, struct sf_generators *preset_generators) { struct sf_generators global_generators = SF_DEFAULT_GENERATORS; + struct sf_modulators global_modulators = + { + .count = ARRAYSIZE(SF_DEFAULT_MODULATORS), + .mods = (struct sf_mod *)SF_DEFAULT_MODULATORS, + };
IMO casting const away from a static const isn't great. As you need a dynamic array later it's probably better to just introduce it here already and make a copy right away. I'd suggest to use flexible array member for `mods`, and variable size struct for the `sf_modulators`, it would make cleaning up as simple as `free(modulators)` instead of having to check `capacity` as a hint to whether it has been dynamically allocated or not. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9607#note_123918