Skip to content

Commit

Permalink
plugin: match prototypes for callbacks as variable args
Browse files Browse the repository at this point in the history
Cast was missing, leading to mismatch.
  • Loading branch information
Rémi Denis-Courmont committed Oct 27, 2016
1 parent f4277df commit 65fb4c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 4 additions & 3 deletions include/vlc_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,9 @@ VLC_METADATA_EXPORTS
goto error;

#define set_callbacks( activate, deactivate ) \
if (vlc_module_set (VLC_MODULE_CB_OPEN, #activate, activate) \
|| vlc_module_set (VLC_MODULE_CB_CLOSE, #deactivate, deactivate)) \
if (vlc_module_set(VLC_MODULE_CB_OPEN, #activate, (void *)(activate)) \
|| vlc_module_set(VLC_MODULE_CB_CLOSE, #deactivate, \
(void *)(deactivate))) \
goto error;

#define cannot_unload_broken_library( ) \
Expand Down Expand Up @@ -470,7 +471,7 @@ VLC_METADATA_EXPORTS
(const char *const *)(list_text));

#define change_string_cb( cb ) \
vlc_config_set (VLC_CONFIG_LIST_CB, #cb, (cb));
vlc_config_set (VLC_CONFIG_LIST_CB, #cb, (void *)(cb));

#define change_integer_list( list, list_text ) \
vlc_config_set (VLC_CONFIG_LIST, \
Expand Down
10 changes: 8 additions & 2 deletions src/modules/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,21 @@ static int vlc_plugin_setter(void *ctx, void *tgt, int propid, ...)
}

case VLC_CONFIG_LIST_CB:
{
void *cb;

va_arg(ap, const char *);
cb = va_arg(ap, void *);

if (IsConfigIntegerType (item->i_type))
item->list.i_cb = va_arg (ap, vlc_integer_list_cb);
item->list.i_cb = cb;
else
if (IsConfigStringType (item->i_type))
item->list.psz_cb = va_arg (ap, vlc_string_list_cb);
item->list.psz_cb = cb;
else
break;
break;
}

default:
fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
Expand Down

0 comments on commit 65fb4c2

Please sign in to comment.