Commit 880d0f65 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config_GetType(): remove unused parameter

parent 472819f6
...@@ -95,7 +95,7 @@ struct module_config_t ...@@ -95,7 +95,7 @@ struct module_config_t
* Prototypes - these methods are used to get, set or manipulate configuration * Prototypes - these methods are used to get, set or manipulate configuration
* data. * data.
*****************************************************************************/ *****************************************************************************/
VLC_API int config_GetType(vlc_object_t *, const char *) VLC_USED; VLC_API int config_GetType(const char *) VLC_USED;
VLC_API int64_t config_GetInt(vlc_object_t *, const char *) VLC_USED; VLC_API int64_t config_GetInt(vlc_object_t *, const char *) VLC_USED;
VLC_API void config_PutInt(vlc_object_t *, const char *, int64_t); VLC_API void config_PutInt(vlc_object_t *, const char *, int64_t);
VLC_API float config_GetFloat(vlc_object_t *, const char *) VLC_USED; VLC_API float config_GetFloat(vlc_object_t *, const char *) VLC_USED;
...@@ -140,7 +140,6 @@ VLC_API void config_AddIntf( vlc_object_t *, const char * ); ...@@ -140,7 +140,6 @@ VLC_API void config_AddIntf( vlc_object_t *, const char * );
VLC_API void config_RemoveIntf( vlc_object_t *, const char * ); VLC_API void config_RemoveIntf( vlc_object_t *, const char * );
VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED; VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
#define config_GetType(a,b) config_GetType(VLC_OBJECT(a),b)
#define config_GetInt(a,b) config_GetInt(VLC_OBJECT(a),b) #define config_GetInt(a,b) config_GetInt(VLC_OBJECT(a),b)
#define config_PutInt(a,b,c) config_PutInt(VLC_OBJECT(a),b,c) #define config_PutInt(a,b,c) config_PutInt(VLC_OBJECT(a),b,c)
#define config_GetFloat(a,b) config_GetFloat(VLC_OBJECT(a),b) #define config_GetFloat(a,b) config_GetFloat(VLC_OBJECT(a),b)
......
...@@ -816,7 +816,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var, ...@@ -816,7 +816,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
b_is_command = i_type & VLC_VAR_ISCOMMAND; b_is_command = i_type & VLC_VAR_ISCOMMAND;
} }
if (!i_type) if (!i_type)
i_type = config_GetType(p_intf, psz_property); i_type = config_GetType(psz_property);
i_type &= VLC_VAR_CLASS; i_type &= VLC_VAR_CLASS;
if (i_type == VLC_VAR_BOOL) if (i_type == VLC_VAR_BOOL)
......
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
playlist_t *p_playlist = pl_Get(p_intf); playlist_t *p_playlist = pl_Get(p_intf);
vlc_value_t val; vlc_value_t val;
int i_type = config_GetType(p_intf, psz_option) & VLC_VAR_CLASS; int i_type = config_GetType(psz_option) & VLC_VAR_CLASS;
switch (i_type) switch (i_type)
{ {
case VLC_VAR_BOOL: case VLC_VAR_BOOL:
......
...@@ -424,7 +424,7 @@ void ExtVideo::setWidgetValue( QObject *widget ) ...@@ -424,7 +424,7 @@ void ExtVideo::setWidgetValue( QObject *widget )
//std::cout << "Option name: " << option.toStdString() << std::endl; //std::cout << "Option name: " << option.toStdString() << std::endl;
vlc_value_t val; vlc_value_t val;
int i_type = config_GetType( p_intf, qtu( option ) ) & VLC_VAR_CLASS; int i_type = config_GetType( qtu( option ) ) & VLC_VAR_CLASS;
switch( i_type ) switch( i_type )
{ {
case VLC_VAR_INTEGER: case VLC_VAR_INTEGER:
...@@ -500,7 +500,7 @@ void ExtVideo::setFilterOption( const char *psz_module, const char *psz_option, ...@@ -500,7 +500,7 @@ void ExtVideo::setFilterOption( const char *psz_module, const char *psz_option,
b_is_command = ( i_type & VLC_VAR_ISCOMMAND ); b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
} }
if( i_type == 0 ) if( i_type == 0 )
i_type = config_GetType( p_intf, psz_option ); i_type = config_GetType( psz_option );
vlc_value_t val; vlc_value_t val;
i_type &= VLC_VAR_CLASS; i_type &= VLC_VAR_CLASS;
......
...@@ -44,7 +44,7 @@ static int vlclua_config_get( lua_State *L ) ...@@ -44,7 +44,7 @@ static int vlclua_config_get( lua_State *L )
{ {
vlc_object_t * p_this = vlclua_get_this( L ); vlc_object_t * p_this = vlclua_get_this( L );
const char *psz_name = luaL_checkstring( L, 1 ); const char *psz_name = luaL_checkstring( L, 1 );
switch( config_GetType( p_this, psz_name ) ) switch( config_GetType( psz_name ) )
{ {
case VLC_VAR_STRING: case VLC_VAR_STRING:
{ {
...@@ -77,7 +77,7 @@ static int vlclua_config_set( lua_State *L ) ...@@ -77,7 +77,7 @@ static int vlclua_config_set( lua_State *L )
{ {
vlc_object_t *p_this = vlclua_get_this( L ); vlc_object_t *p_this = vlclua_get_this( L );
const char *psz_name = luaL_checkstring( L, 1 ); const char *psz_name = luaL_checkstring( L, 1 );
switch( config_GetType( p_this, psz_name ) ) switch( config_GetType( psz_name ) )
{ {
case VLC_VAR_STRING: case VLC_VAR_STRING:
config_PutPsz( p_this, psz_name, luaL_checkstring( L, 2 ) ); config_PutPsz( p_this, psz_name, luaL_checkstring( L, 2 ) );
......
...@@ -154,7 +154,7 @@ static int vlclua_var_inherit( lua_State *L ) ...@@ -154,7 +154,7 @@ static int vlclua_var_inherit( lua_State *L )
} }
const char *psz_var = luaL_checkstring( L, 2 ); const char *psz_var = luaL_checkstring( L, 2 );
int i_type = config_GetType( p_obj, psz_var ); int i_type = config_GetType( psz_var );
if( var_Inherit( p_obj, psz_var, i_type, &val ) != VLC_SUCCESS ) if( var_Inherit( p_obj, psz_var, i_type, &val ) != VLC_SUCCESS )
return 0; return 0;
......
...@@ -284,7 +284,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix, ...@@ -284,7 +284,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
char name[plen + strlen( optname )]; char name[plen + strlen( optname )];
snprintf( name, sizeof (name), "%s%s", psz_prefix, optname ); snprintf( name, sizeof (name), "%s%s", psz_prefix, optname );
if( var_Create( p_this, name, if( var_Create( p_this, name,
config_GetType( p_this, name ) | VLC_VAR_DOINHERIT ) ) config_GetType( name ) | VLC_VAR_DOINHERIT ) )
return /* VLC_xxx */; return /* VLC_xxx */;
module_config_t* p_conf = config_FindConfig( name ); module_config_t* p_conf = config_FindConfig( name );
...@@ -375,7 +375,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix, ...@@ -375,7 +375,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
/* </Check if the option is deprecated> */ /* </Check if the option is deprecated> */
/* get the type of the variable */ /* get the type of the variable */
i_type = config_GetType( p_this, psz_name ); i_type = config_GetType( psz_name );
if( !i_type ) if( !i_type )
{ {
msg_Warn( p_this, "unknown option %s (value=%s)", msg_Warn( p_this, "unknown option %s (value=%s)",
......
...@@ -46,19 +46,14 @@ static inline char *strdupnull (const char *src) ...@@ -46,19 +46,14 @@ static inline char *strdupnull (const char *src)
return src ? strdup (src) : NULL; return src ? strdup (src) : NULL;
} }
#undef config_GetType
/***************************************************************************** /*****************************************************************************
* config_GetType: get the type of a variable (bool, int, float, string) * config_GetType: get the type of a variable (bool, int, float, string)
***************************************************************************** *****************************************************************************
* This function is used to get the type of a variable from its name. * This function is used to get the type of a variable from its name.
* Beware, this is quite slow.
*****************************************************************************/ *****************************************************************************/
int config_GetType( vlc_object_t *p_this, const char *psz_name ) int config_GetType(const char *psz_name)
{ {
module_config_t *p_config; module_config_t *p_config = config_FindConfig(psz_name);
int i_type;
p_config = config_FindConfig( psz_name );
/* sanity checks */ /* sanity checks */
if( !p_config ) if( !p_config )
...@@ -68,28 +63,17 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name ) ...@@ -68,28 +63,17 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
switch( CONFIG_CLASS(p_config->i_type) ) switch( CONFIG_CLASS(p_config->i_type) )
{ {
case CONFIG_ITEM_FLOAT: case CONFIG_ITEM_FLOAT:
i_type = VLC_VAR_FLOAT; return VLC_VAR_FLOAT;
break; case CONFIG_ITEM_INTEGER:
return VLC_VAR_INTEGER;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_BOOL:
i_type = VLC_VAR_INTEGER; return VLC_VAR_BOOL;
break; case CONFIG_ITEM_STRING:
return VLC_VAR_STRING;
case CONFIG_ITEM_BOOL: default:
i_type = VLC_VAR_BOOL; return 0;
break;
case CONFIG_ITEM_STRING:
i_type = VLC_VAR_STRING;
break;
default:
i_type = 0;
break;
} }
return i_type;
} }
bool config_IsSafe( const char *name ) bool config_IsSafe( const char *name )
......
...@@ -1054,7 +1054,7 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option, ...@@ -1054,7 +1054,7 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
if( psz_value != NULL ) if( psz_value != NULL )
*psz_value++ = '\0'; *psz_value++ = '\0';
i_type = config_GetType( p_obj, psz_name ); i_type = config_GetType( psz_name );
if( !i_type && !psz_value ) if( !i_type && !psz_value )
{ {
/* check for "no-foo" or "nofoo" */ /* check for "no-foo" or "nofoo" */
...@@ -1069,7 +1069,7 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option, ...@@ -1069,7 +1069,7 @@ void var_OptionParse( vlc_object_t *p_obj, const char *psz_option,
else goto cleanup; /* Option doesn't exist */ else goto cleanup; /* Option doesn't exist */
b_isno = true; b_isno = true;
i_type = config_GetType( p_obj, psz_name ); i_type = config_GetType( psz_name );
} }
if( !i_type ) goto cleanup; /* Option doesn't exist */ if( !i_type ) goto cleanup; /* Option doesn't exist */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment