From 0babda75f1d5df89261dc5fa4e98f57f3ef9de77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 16 Dec 2007 15:12:51 +0000 Subject: [PATCH] Don't use enums. They are cool and all (the compiler even tells when one case is missing in switch), but I don't want the compiler to assume as yet unassigned codepoints will not be used. --- include/vlc_configuration.h | 16 +++++++++------- include/vlc_modules.h | 2 +- src/modules/entry.c | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h index dcb8a820e4..53160a6fbc 100644 --- a/include/vlc_configuration.h +++ b/include/vlc_configuration.h @@ -231,7 +231,7 @@ VLC_EXPORT( vlc_bool_t, __config_ExistIntf, ( vlc_object_t *, const char * ) ); #define config_RemoveIntf(a,b) __config_RemoveIntf(VLC_OBJECT(a),b) #define config_ExistIntf(a,b) __config_ExistIntf(VLC_OBJECT(a),b) -typedef enum vlc_config_properties +enum vlc_config_properties { /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI! * Append new items at the end ONLY. */ @@ -268,11 +268,11 @@ typedef enum vlc_config_properties VLC_CONFIG_CAPABILITY, /* capability for a module or list thereof (args=const char*) */ -} vlc_config_t; +}; VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) ); -VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) ); +VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) ); /***************************************************************************** * Macros used to build the configuration structure. @@ -361,18 +361,20 @@ VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) ); vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \ (const char *)(psz_caps)) -#define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ - add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, p_callback, value ); \ - p_config[i_config].min.i = i_subcategory /* gruik */ - #define add_module_list( name, psz_caps, value, p_callback, text, longtext, advc ) \ add_string_inner( CONFIG_ITEM_MODULE_LIST, name, text, longtext, advc, p_callback, value ); \ vlc_config_set (p_config + i_config, VLC_CONFIG_CAPABILITY, \ (const char *)(psz_caps)) +#ifndef __PLUGIN__ +#define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ + add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, p_callback, value ); \ + p_config[i_config].min.i = i_subcategory /* gruik */ + #define add_module_list_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \ add_string_inner( CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, advc, p_callback, value ); \ p_config[i_config].min.i = i_subcategory /* gruik */ +#endif #define add_integer( name, value, p_callback, text, longtext, advc ) \ add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, p_callback, value ) diff --git a/include/vlc_modules.h b/include/vlc_modules.h index fa8f7ec135..f3de9ea81b 100644 --- a/include/vlc_modules.h +++ b/include/vlc_modules.h @@ -71,7 +71,7 @@ enum vlc_module_properties VLC_MODULE_CB_OPEN, VLC_MODULE_CB_CLOSE, VLC_MODULE_UNLOADABLE, - VLC_MODULE_NAME + VLC_MODULE_NAME, }; VLC_EXPORT( vlc_bool_t, module_IsCapable, ( const module_t *m, const char *cap ) ); diff --git a/src/modules/entry.c b/src/modules/entry.c index ecfeff9db1..3891646c60 100644 --- a/src/modules/entry.c +++ b/src/modules/entry.c @@ -132,7 +132,7 @@ int vlc_module_set (module_t *module, int propid, void *value) case VLC_MODULE_PROGRAM: msg_Warn (module, "deprecated module property %d", propid); - return 0; + break; default: msg_Err (module, "unknown module property %d", propid); @@ -161,7 +161,7 @@ module_config_t *vlc_config_create (module_t *module, int type) return tab + confsize; } -int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...) +int vlc_config_set (module_config_t *restrict item, int id, ...) { int ret = -1; va_list ap; -- 2.39.5