[vlc-commits] config: remove useless config_GetPszChoices() parameter
Rémi Denis-Courmont
git at videolan.org
Wed Feb 28 20:02:44 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 20:21:40 2018 +0200| [05f7d6b62cd0772e3ca60cd53ad3dc488dac2bb6] | committer: Rémi Denis-Courmont
config: remove useless config_GetPszChoices() parameter
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=05f7d6b62cd0772e3ca60cd53ad3dc488dac2bb6
---
include/vlc_configuration.h | 2 +-
lib/audio.c | 3 +--
modules/gui/macosx/VLCSimplePrefsController.m | 3 +--
modules/gui/macosx/prefs_widgets.m | 2 +-
modules/gui/qt/components/extended_panels.cpp | 3 +--
modules/gui/qt/components/preferences_widgets.cpp | 6 ++----
src/config/core.c | 6 +++---
src/config/help.c | 6 +++---
8 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 26de9a8aca..c39fbc1575 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -243,7 +243,7 @@ VLC_API ssize_t config_GetIntChoices(const char *, int64_t **values,
* descriptions and on both tables.
* In case of error, both pointers are set to NULL.
*/
-VLC_API ssize_t config_GetPszChoices(vlc_object_t *, const char *,
+VLC_API ssize_t config_GetPszChoices(const char *,
char ***, char ***) VLC_USED;
VLC_API int config_SaveConfigFile( vlc_object_t * );
diff --git a/lib/audio.c b/lib/audio.c
index 877666473a..5fe2ce202c 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -194,8 +194,7 @@ libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
libvlc_audio_output_device_t *list = NULL, **pp = &list;
char **values, **texts;
- ssize_t count = config_GetPszChoices( VLC_OBJECT(p_instance->p_libvlc_int),
- varname, &values, &texts );
+ ssize_t count = config_GetPszChoices( varname, &values, &texts );
for( ssize_t i = 0; i < count; i++ )
{
libvlc_audio_output_device_t *item = malloc( sizeof(*item) );
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m b/modules/gui/macosx/VLCSimplePrefsController.m
index d8bfeb0162..238746ffbb 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -416,8 +416,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
assert(p_item);
char **values, **texts;
- ssize_t count = config_GetPszChoices(VLC_OBJECT(getIntf()), name,
- &values, &texts);
+ ssize_t count = config_GetPszChoices(name, &values, &texts);
if (count < 0) {
msg_Err(p_intf, "Cannot get choices for %s", name);
return;
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index f73ebcf14e..76b0bac45b 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1058,7 +1058,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
char *psz_value = config_GetPsz(self.p_item->psz_name);
char **values, **texts;
- ssize_t count = config_GetPszChoices(VLC_OBJECT(getIntf()), self.p_item->psz_name,
+ ssize_t count = config_GetPszChoices(self.p_item->psz_name,
&values, &texts);
for (ssize_t i = 0; i < count && texts; i++) {
if (texts[i] == NULL || values[i] == NULL)
diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index b4d198d267..d852580c71 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -411,8 +411,7 @@ void ExtVideo::initComboBoxItems( QObject *widget )
{
char **values;
char **texts;
- ssize_t count = config_GetPszChoices( VLC_OBJECT( p_intf ),
- qtu( option ), &values, &texts );
+ ssize_t count = config_GetPszChoices( qtu( option ), &values, &texts );
for( ssize_t i = 0; i < count; i++ )
{
combobox->addItem( qtr( texts[i] ), qfu(values[i]) );
diff --git a/modules/gui/qt/components/preferences_widgets.cpp b/modules/gui/qt/components/preferences_widgets.cpp
index 232e27d54a..de989d2103 100644
--- a/modules/gui/qt/components/preferences_widgets.cpp
+++ b/modules/gui/qt/components/preferences_widgets.cpp
@@ -434,8 +434,7 @@ void StringListConfigControl::finish(module_config_t *p_module_config )
if(!p_module_config) return;
char **values, **texts;
- ssize_t count = config_GetPszChoices( p_this, p_item->psz_name,
- &values, &texts );
+ ssize_t count = config_GetPszChoices( p_item->psz_name, &values, &texts );
for( ssize_t i = 0; i < count && texts; i++ )
{
if( texts[i] == NULL || values[i] == NULL )
@@ -476,8 +475,7 @@ void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
if( (p_config->i_type & 0xF0) == CONFIG_ITEM_STRING )
{
char **values, **texts;
- ssize_t count = config_GetPszChoices(VLC_OBJECT(p_intf),
- configname, &values, &texts);
+ ssize_t count = config_GetPszChoices(configname, &values, &texts);
for( ssize_t i = 0; i < count; i++ )
{
combo->addItem( qtr(texts[i]), QVariant(qfu(values[i])) );
diff --git a/src/config/core.c b/src/config/core.c
index 5d994b3a38..9999fd72d5 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -284,8 +284,8 @@ static ssize_t config_ListModules (const char *cap, char ***restrict values,
return n + 2;
}
-ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
- char ***restrict values, char ***restrict texts)
+ssize_t config_GetPszChoices(const char *name,
+ char ***restrict values, char ***restrict texts)
{
*values = *texts = NULL;
@@ -312,7 +312,7 @@ ssize_t config_GetPszChoices (vlc_object_t *obj, const char *name,
size_t count = cfg->list_count;
if (count == 0)
{
- if (module_Map(obj, cfg->owner))
+ if (module_Map(NULL, cfg->owner))
{
errno = EIO;
return -1;
diff --git a/src/config/help.c b/src/config/help.c
index e5d9bf7323..95a1648c24 100644
--- a/src/config/help.c
+++ b/src/config/help.c
@@ -345,7 +345,7 @@ static int vlc_swidth(const char *str)
}
}
-static void print_item(const vlc_object_t *p_this, const module_t *m, const module_config_t *item,
+static void print_item(const module_t *m, const module_config_t *item,
const module_config_t **section, bool color, bool desc)
{
#ifndef _WIN32
@@ -384,7 +384,7 @@ static void print_item(const vlc_object_t *p_this, const module_t *m, const modu
char **ppsz_values, **ppsz_texts;
- ssize_t i_count = config_GetPszChoices(VLC_OBJECT(p_this), item->psz_name, &ppsz_values, &ppsz_texts);
+ ssize_t i_count = config_GetPszChoices(item->psz_name, &ppsz_values, &ppsz_texts);
if (i_count > 0)
{
@@ -642,7 +642,7 @@ static void Usage (vlc_object_t *p_this, char const *psz_search)
b_has_advanced = true;
continue;
}
- print_item(p_this, m, item, §ion, color, desc);
+ print_item(m, item, §ion, color, desc);
}
}
More information about the vlc-commits
mailing list