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

Adjust dispatch C function #114

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Adjust dispatch C function #114

merged 1 commit into from
Sep 13, 2024

Conversation

karlpip
Copy link
Contributor

@karlpip karlpip commented May 17, 2024

Since i updated libvlc today, i could not build libvlc-go without warnings anymore.

../libvlc-go/v3/event_manager.go: In function 'eventAttach':
../libvlc-go/v3/event_manager.go:10:40: error: passing argument 3 of 'libvlc_event_attach' from incompatible pointer type [-Wincompatible-pointer-types]
   10 |     return libvlc_event_attach(em, et, eventDispatch, (void*)userData);
      |                                        ^~~~~~~~~~~~~
      |                                        |
      |                                        void (*)(libvlc_event_t *, void *)
In file included from /usr/include/vlc/vlc.h:40,
                 from ../libvlc-go/v3/event_manager.go:5:
/usr/include/vlc/libvlc.h:339:59: note: expected 'libvlc_callback_t' {aka 'void (*)(const struct libvlc_event_t *, void *)'} but argument is of type 'void (*)(libvlc_event_t *, void *)'
  339 |                                         libvlc_callback_t f_callback,
      |                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
../libvlc-go/v3/event_manager.go: In function 'eventDetach':
../libvlc-go/v3/event_manager.go:13:33: error: passing argument 3 of 'libvlc_event_detach' from incompatible pointer type [-Wincompatible-pointer-types]
   13 |     libvlc_event_detach(em, et, eventDispatch, (void*)userData);
      |                                 ^~~~~~~~~~~~~
      |                                 |
      |                                 void (*)(libvlc_event_t *, void *)
/usr/include/vlc/libvlc.h:352:60: note: expected 'libvlc_callback_t' {aka 'void (*)(const struct libvlc_event_t *, void *)'} but argument is of type 'void (*)(libvlc_event_t *, void *)'
  352 |                                          libvlc_callback_t f_callback,
      |                                          ~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This PR adjusts the dispatch functions signature in order to fix the warnings.

See: https://github.com/videolan/vlc/blob/master/include/vlc/libvlc.h#L325

@adrg adrg merged commit 476ec89 into adrg:master Sep 13, 2024
@adrg
Copy link
Owner

adrg commented Sep 13, 2024

@karlpip Thank you for the PR. Merged. I also added you to the contributors list in README.md.

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

Successfully merging this pull request may close these issues.

2 participants