On Mon Jan 22 15:29:16 2024 +0000, Nikolay Sivov wrote:
@rbernon , what's your opinion on this? It would be nice to have a helper to hide these checks, but I don't see how.
Does clang also warn on enum implicit conversion on assign or just pointer types?
What about some helper like:
``` #define MEDIA_TYPE_GET(m, t, a, v) \ do { \ t __val; if (SUCCEEDED(IMFMediaType_Get ## t((m), (a), &__val))) \ *(v) = __val; \ } while (0) ```
Which could also trace a WARN or ERR at the same time, which could help catching missing attributes if that feels useful.
Could also add a default value argument, and / or some less generic helper with UINT32 hardcoded. That could be used for ULONG too.