libplacebo
libplacebo copied to clipboard
pl_lut_free
pl_lut_free expects non-const pl_custom_lut
but pl_render_params->lut is const. This causes building error.
I don't understand this issue. Building error where? In libplacebo? In your code?
As I understand, they do something like
struct pl_render_params rrp;
...
rrp->lut = ...;
...
pl_lut_free(&rrp->lut);
which fails for them.
As I understand, they do something like
struct pl_render_params rrp; ... rrp->lut = ...; ... pl_lut_free(&rrp->lut);
which fails for them.
Yes, that's the use case.
MSVC doesn't complain but clang-cl fails (requires explicitly const casting).
I can also complain about similar thing, it is annoying that pl_color_repr::dovi
is const pointer, especially that it is managed by user.
warning: passing 'typeof (new->params.repr.dovi)' (aka 'const struct pl_dovi_metadata *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
355 | new->params.repr.dovi = talloc_dup(new, new->params.repr.dovi);
warning: passing 'const struct pl_dovi_metadata *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
1135 | talloc_free(dst->params.repr.dovi);
Just need pointless casts :)