Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pl_lut_free #200

Open
Asd-g opened this issue Sep 12, 2023 · 4 comments
Open

pl_lut_free #200

Asd-g opened this issue Sep 12, 2023 · 4 comments

Comments

@Asd-g
Copy link
Contributor

Asd-g commented Sep 12, 2023

pl_lut_free expects non-const pl_custom_lut but pl_render_params->lut is const. This causes building error.

@haasn
Copy link
Owner

haasn commented Oct 3, 2023

I don't understand this issue. Building error where? In libplacebo? In your code?

@kasper93
Copy link
Contributor

kasper93 commented Oct 5, 2023

As I understand, they do something like

struct pl_render_params rrp;
...
rrp->lut = ...;
...
pl_lut_free(&rrp->lut);

which fails for them.

@Asd-g
Copy link
Contributor Author

Asd-g commented Oct 5, 2023

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).

@kasper93
Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants