Commit 472819f6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

config_FindConfig(): remove unused parameter

parent b84243bf
......@@ -113,7 +113,7 @@ VLC_API int config_SaveConfigFile( vlc_object_t * );
VLC_API void config_ResetAll( vlc_object_t * );
#define config_ResetAll(a) config_ResetAll(VLC_OBJECT(a))
VLC_API module_config_t * config_FindConfig( vlc_object_t *, const char * ) VLC_USED;
VLC_API module_config_t * config_FindConfig(const char *) VLC_USED;
VLC_API char * config_GetDataDir(void) VLC_USED VLC_MALLOC;
VLC_API char *config_GetLibDir(void) VLC_USED;
......
......@@ -296,7 +296,7 @@
module_config_t *p_item;
[menu removeAllItems];
p_item = config_FindConfig(VLC_OBJECT(getIntf()), psz_name);
p_item = config_FindConfig(psz_name);
if (!p_item) {
msg_Err(getIntf(), "couldn't create menu int list for item '%s' as it does not exist", psz_name);
......
......@@ -341,7 +341,6 @@ static NSString *kCaptureTabViewId = @"capture";
{
int i_index;
module_config_t * p_item;
intf_thread_t * p_intf = getIntf();
[_fileSubCheckbox setTitle: _NS("Add Subtitle File:")];
[_fileSubPathLabel setStringValue: _NS("Choose a file")];
......@@ -367,7 +366,7 @@ static NSString *kCaptureTabViewId = @"capture";
[_fileSubFontBox setTitle: _NS("Font Properties")];
[_fileSubFileBox setTitle: _NS("Subtitle File")];
p_item = config_FindConfig(VLC_OBJECT(p_intf), "subsdec-encoding");
p_item = config_FindConfig("subsdec-encoding");
if (p_item) {
for (int i = 0; i < p_item->list_count; i++) {
......@@ -381,7 +380,7 @@ static NSString *kCaptureTabViewId = @"capture";
[_fileSubEncodingPopup selectItemAtIndex:0];
}
p_item = config_FindConfig(VLC_OBJECT(p_intf), "subsdec-align");
p_item = config_FindConfig("subsdec-align");
if (p_item) {
for (i_index = 0; i_index < p_item->list_count; i_index++)
......@@ -390,7 +389,7 @@ static NSString *kCaptureTabViewId = @"capture";
[_fileSubAlignPopup selectItemAtIndex: p_item->value.i];
}
p_item = config_FindConfig(VLC_OBJECT(p_intf), "freetype-rel-fontsize");
p_item = config_FindConfig("freetype-rel-fontsize");
if (p_item) {
for (i_index = 0; i_index < p_item->list_count; i_index++) {
......@@ -439,8 +438,7 @@ static NSString *kCaptureTabViewId = @"capture";
[options addObject: [NSString stringWithFormat:
@"subsdec-align=%li", [_fileSubAlignPopup indexOfSelectedItem]]];
p_item = config_FindConfig(VLC_OBJECT(getIntf()),
"freetype-rel-fontsize");
p_item = config_FindConfig("freetype-rel-fontsize");
if (p_item) {
[options addObject: [NSString stringWithFormat:
......
......@@ -438,9 +438,7 @@ create_toolbar_item(NSString *itemIdent, NSString *name, NSString *desc, NSStrin
#define config_GetLabel(a,b) __config_GetLabel(VLC_OBJECT(a),b)
static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *psz_name)
{
module_config_t *p_config;
p_config = config_FindConfig(p_this, psz_name);
module_config_t *p_config = config_FindConfig(psz_name);
/* sanity checks */
if (!p_config) {
......@@ -466,7 +464,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
module_config_t *p_item;
[object removeAllItems];
p_item = config_FindConfig(VLC_OBJECT(p_intf), name);
p_item = config_FindConfig(name);
/* serious problem, if no item found */
assert(p_item);
......@@ -514,7 +512,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
module_config_t *p_item;
[object removeAllItems];
p_item = config_FindConfig(VLC_OBJECT(p_intf), name);
p_item = config_FindConfig(name);
/* serious problem, if no item found */
assert(p_item);
......
......@@ -377,8 +377,7 @@ void ExtVideo::initComboBoxItems( QObject *widget )
if( !combobox ) return;
QString option = OptionFromWidgetName( widget );
module_config_t *p_item = config_FindConfig( VLC_OBJECT( p_intf ),
qtu( option ) );
module_config_t *p_item = config_FindConfig( qtu( option ) );
if( p_item == NULL )
{
msg_Err( p_intf, "Couldn't find option \"%s\".", qtu( option ) );
......@@ -874,7 +873,7 @@ float FilterSliderData::initialValue()
}
}
if ( ! config_FindConfig( VLC_OBJECT(p_intf), qtu(p_data->name) ) )
if ( ! config_FindConfig( qtu(p_data->name) ) )
return f;
f = config_GetFloat( p_intf, qtu(p_data->name) );
......@@ -1014,7 +1013,7 @@ QStringList EqualizerSliderData::getBandsFromAout() const
if ( bands.count() ) return bands;
/* Or try config then */
if ( ! config_FindConfig( VLC_OBJECT(p_intf), qtu(p_data->name) ) )
if ( ! config_FindConfig( qtu(p_data->name) ) )
return bands;
char *psz_bands = config_GetPsz( p_intf, qtu(p_data->name) );
......
......@@ -776,14 +776,13 @@ void CaptureOpenPanel::initialize()
/* dshow Main */
int line = 0;
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), "dshow-vdev" );
module_config_t *p_config = config_FindConfig( "dshow-vdev" );
vdevDshowW = new StringListConfigControl(
VLC_OBJECT(p_intf), p_config, this );
vdevDshowW->insertIntoExistingGrid( dshowDevLayout, line );
line++;
p_config = config_FindConfig( VLC_OBJECT(p_intf), "dshow-adev" );
p_config = config_FindConfig( "dshow-adev" );
adevDshowW = new StringListConfigControl(
VLC_OBJECT(p_intf), p_config, this );
adevDshowW->insertIntoExistingGrid( dshowDevLayout, line );
......
......@@ -393,7 +393,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
combo->setMinimumWidth( MINWIDTH_BOX );
combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
module_config_t *p_module_config = config_FindConfig( p_item->psz_name );
finish( p_module_config );
}
......@@ -421,7 +421,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *_p_this,
combo = _combo;
label = _label;
module_config_t *p_module_config = config_FindConfig( p_this, getName() );
module_config_t *p_module_config = config_FindConfig( getName() );
finish( p_module_config );
}
......@@ -469,8 +469,7 @@ QString StringListConfigControl::getValue() const
void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
QComboBox *combo )
{
module_config_t *p_config =
config_FindConfig( VLC_OBJECT(p_intf), configname );
module_config_t *p_config = config_FindConfig( configname );
if( p_config == NULL )
return;
......@@ -871,7 +870,7 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
combo = new QComboBox( p );
combo->setMinimumWidth( MINWIDTH_BOX );
module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
module_config_t *p_module_config = config_FindConfig( p_item->psz_name );
finish( p_module_config );
}
......@@ -893,7 +892,7 @@ IntegerListConfigControl::IntegerListConfigControl( vlc_object_t *_p_this,
combo = _combo;
label = _label;
module_config_t *p_module_config = config_FindConfig( p_this, getName() );
module_config_t *p_module_config = config_FindConfig( getName() );
finish( p_module_config );
}
......
......@@ -249,7 +249,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
radioGroup = NULL;
#define CONFIG_GENERIC( option, type, label, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
p_config = config_FindConfig( option ); \
if( p_config ) \
{ \
control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
......@@ -262,7 +262,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
}
#define CONFIG_BOOL( option, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
p_config = config_FindConfig( option ); \
if( p_config ) \
{ \
control = new BoolConfigControl( VLC_OBJECT(p_intf), \
......@@ -273,7 +273,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#define CONFIG_GENERIC_NO_UI( option, type, label, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
p_config = config_FindConfig( option ); \
if( p_config ) \
{ \
control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
......@@ -288,7 +288,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#define CONFIG_GENERIC_NO_BOOL( option, type, label, qcontrol ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
p_config = config_FindConfig( option ); \
if( p_config ) \
{ \
control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
......@@ -297,7 +297,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
}
#define CONFIG_GENERIC_FILE( option, type, label, qcontrol, qbutton ) \
p_config = config_FindConfig( VLC_OBJECT(p_intf), option ); \
p_config = config_FindConfig( option ); \
if( p_config ) \
{ \
control = new type ## ConfigControl( VLC_OBJECT(p_intf), \
......@@ -834,7 +834,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
case SPrefsHotkeys:
{
p_config = config_FindConfig( VLC_OBJECT(p_intf), "key-play" );
p_config = config_FindConfig( "key-play" );
QGridLayout *gLayout = new QGridLayout;
panel->setLayout( gLayout );
......@@ -853,7 +853,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
line++;
p_config = config_FindConfig( VLC_OBJECT(p_intf), "hotkeys-y-wheel-mode" );
p_config = config_FindConfig( "hotkeys-y-wheel-mode" );
control = new IntegerListConfigControl( VLC_OBJECT(p_intf),
p_config, this, false );
control->insertIntoExistingGrid( gLayout, line );
......@@ -861,7 +861,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
line++;
p_config = config_FindConfig( VLC_OBJECT(p_intf), "hotkeys-x-wheel-mode" );
p_config = config_FindConfig( "hotkeys-x-wheel-mode" );
control = new IntegerListConfigControl( VLC_OBJECT(p_intf),
p_config, this, false );
control->insertIntoExistingGrid( gLayout, line );
......@@ -870,7 +870,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#ifdef _WIN32
line++;
p_config = config_FindConfig( VLC_OBJECT(p_intf), "qt-disable-volume-keys" );
p_config = config_FindConfig( "qt-disable-volume-keys" );
control = new BoolConfigControl( VLC_OBJECT(p_intf), p_config, this );
control->insertIntoExistingGrid( gLayout, line );
controls.append( control );
......
......@@ -180,7 +180,7 @@ static void InitLevel(filter_t *filter, struct filter_level *range, const char *
{
int level = 0;
module_config_t *cfg = config_FindConfig( VLC_OBJECT(filter), p_name);
module_config_t *cfg = config_FindConfig(p_name);
if (unlikely(cfg == NULL))
{
range->min = 0.;
......
......@@ -178,7 +178,7 @@ static void InitLevel(filter_t *filter, struct filter_level *range, const char *
{
int level;
module_config_t *cfg = config_FindConfig( VLC_OBJECT(filter), p_name);
module_config_t *cfg = config_FindConfig(p_name);
range->min = cfg->min.f;
range->max = cfg->max.f;
range->default_val = def;
......
......@@ -324,7 +324,7 @@ audio_output_t *aout_New (vlc_object_t *parent)
VLC_VAR_STRING | VLC_VAR_DOINHERIT );
text.psz_string = _("Replay gain");
var_Change (aout, "audio-replay-gain-mode", VLC_VAR_SETTEXT, &text, NULL);
cfg = config_FindConfig (VLC_OBJECT(aout), "audio-replay-gain-mode");
cfg = config_FindConfig("audio-replay-gain-mode");
if (likely(cfg != NULL))
for (unsigned i = 0; i < cfg->list_count; i++)
{
......
......@@ -287,7 +287,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
config_GetType( p_this, name ) | VLC_VAR_DOINHERIT ) )
return /* VLC_xxx */;
module_config_t* p_conf = config_FindConfig( p_this, name );
module_config_t* p_conf = config_FindConfig( name );
if( p_conf )
{
switch( CONFIG_CLASS( p_conf->i_type ) )
......@@ -356,7 +356,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
b_once ? (ppsz_options[i] + 1) : ppsz_options[i] );
/* Check if the option is deprecated */
p_conf = config_FindConfig( p_this, name );
p_conf = config_FindConfig( name );
/* This is basically cut and paste from src/misc/configuration.c
* with slight changes */
......
......@@ -198,7 +198,7 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
if( flag ) psz_name += psz_name[2] == '-' ? 3 : 2;
/* Store the configuration option */
p_conf = config_FindConfig( p_this, psz_name );
p_conf = config_FindConfig( psz_name );
if( p_conf )
{
/* Check if the option is deprecated */
......
......@@ -58,7 +58,7 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
module_config_t *p_config;
int i_type;
p_config = config_FindConfig( p_this, psz_name );
p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -94,7 +94,7 @@ int config_GetType( vlc_object_t *p_this, const char *psz_name )
bool config_IsSafe( const char *name )
{
module_config_t *p_config = config_FindConfig( NULL, name );
module_config_t *p_config = config_FindConfig( name );
return p_config != NULL && p_config->b_safe;
}
......@@ -108,9 +108,7 @@ bool config_IsSafe( const char *name )
*****************************************************************************/
int64_t config_GetInt( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
module_config_t *p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -144,7 +142,7 @@ float config_GetFloat( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -183,7 +181,7 @@ char * config_GetPsz( vlc_object_t *p_this, const char *psz_name )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -217,9 +215,7 @@ char * config_GetPsz( vlc_object_t *p_this, const char *psz_name )
void config_PutPsz( vlc_object_t *p_this,
const char *psz_name, const char *psz_value )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
module_config_t *p_config = config_FindConfig( psz_name );
/* sanity checks */
......@@ -261,9 +257,7 @@ void config_PutPsz( vlc_object_t *p_this,
void config_PutInt( vlc_object_t *p_this, const char *psz_name,
int64_t i_value )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
module_config_t *p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -299,9 +293,7 @@ void config_PutInt( vlc_object_t *p_this, const char *psz_name,
void config_PutFloat( vlc_object_t *p_this,
const char *psz_name, float f_value )
{
module_config_t *p_config;
p_config = config_FindConfig( p_this, psz_name );
module_config_t *p_config = config_FindConfig( psz_name );
/* sanity checks */
if( !p_config )
......@@ -344,7 +336,7 @@ ssize_t config_GetIntChoices (vlc_object_t *obj, const char *name,
*values = NULL;
*texts = NULL;
module_config_t *cfg = config_FindConfig (obj, name);
module_config_t *cfg = config_FindConfig(name);
if (cfg == NULL)
{
msg_Warn (obj, "option %s does not exist", name);
......@@ -448,7 +440,7 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
{
*values = *texts = NULL;
module_config_t *cfg = config_FindConfig (obj, name);
module_config_t *cfg = config_FindConfig(name);
if (cfg == NULL)
{
errno = ENOENT;
......@@ -568,13 +560,9 @@ void config_UnsortConfig (void)
/*****************************************************************************
* config_FindConfig: find the config structure associated with an option.
*****************************************************************************
* FIXME: remove p_this pointer parameter (or use it)
*****************************************************************************/
module_config_t *config_FindConfig (vlc_object_t *p_this, const char *name)
module_config_t *config_FindConfig(const char *name)
{
VLC_UNUSED(p_this);
if (unlikely(name == NULL))
return NULL;
......
......@@ -204,7 +204,7 @@ int config_LoadConfigFile( vlc_object_t *p_this )
continue; /* syntax error */
*ptr = '\0';
module_config_t *item = config_FindConfig (p_this, psz_option_name);
module_config_t *item = config_FindConfig(psz_option_name);
if (item == NULL)
continue;
......
......@@ -109,7 +109,7 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
text.psz_string = _("Deinterlace");
var_Change(vout, "deinterlace", VLC_VAR_SETTEXT, &text, NULL);
const module_config_t *optd = config_FindConfig(VLC_OBJECT(vout), "deinterlace");
const module_config_t *optd = config_FindConfig("deinterlace");
var_Change(vout, "deinterlace", VLC_VAR_CLEARCHOICES, NULL, NULL);
if (likely(optd != NULL))
for (unsigned i = 0; i < optd->list_count; i++) {
......@@ -125,7 +125,7 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
text.psz_string = _("Deinterlace mode");
var_Change(vout, "deinterlace-mode", VLC_VAR_SETTEXT, &text, NULL);
const module_config_t *optm = config_FindConfig(VLC_OBJECT(vout), "deinterlace-mode");
const module_config_t *optm = config_FindConfig("deinterlace-mode");
var_Change(vout, "deinterlace-mode", VLC_VAR_CLEARCHOICES, NULL, NULL);
if (likely(optm != NULL))
for (unsigned i = 0; i < optm->list_count; i++) {
......
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