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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

karlpip
Copy link

@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

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.

None yet

1 participant