[vlc-commits] config: remove useless config_GetIntChoices() parameter

Rémi Denis-Courmont git at videolan.org
Wed Feb 28 20:02:40 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 20:21:40 2018 +0200| [1f1a212b8587062038ec2d532184e5630fd8483c] | committer: Rémi Denis-Courmont

config: remove useless config_GetIntChoices() parameter

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f1a212b8587062038ec2d532184e5630fd8483c
---

 include/vlc_configuration.h                       |  2 +-
 modules/gui/macosx/VLCSimplePrefsController.m     |  2 +-
 modules/gui/macosx/prefs_widgets.m                |  2 +-
 modules/gui/qt/components/extended_panels.cpp     |  3 +--
 modules/gui/qt/components/preferences_widgets.cpp |  5 ++---
 src/config/core.c                                 | 11 +++--------
 src/config/help.c                                 |  2 +-
 7 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index af1b8f0b36..1aab5d7a06 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -232,7 +232,7 @@ VLC_API void config_PutPsz(const char *name, const char *val);
  * \note the caller is responsible for calling free() on all descriptions and
  * on both tables. In case of error, both pointers are set to NULL.
  */
-VLC_API ssize_t config_GetIntChoices(vlc_object_t *, const char *,
+VLC_API ssize_t config_GetIntChoices(const char *,
                                      int64_t **, char ***) VLC_USED;
 
 /**
diff --git a/modules/gui/macosx/VLCSimplePrefsController.m b/modules/gui/macosx/VLCSimplePrefsController.m
index bf9b9be839..d8bfeb0162 100644
--- a/modules/gui/macosx/VLCSimplePrefsController.m
+++ b/modules/gui/macosx/VLCSimplePrefsController.m
@@ -466,7 +466,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
 
     int64_t *values;
     char **texts;
-    ssize_t count = config_GetIntChoices(VLC_OBJECT(getIntf()), name, &values, &texts);
+    ssize_t count = config_GetIntChoices(name, &values, &texts);
     for (ssize_t i = 0; i < count; i++) {
         NSMenuItem *mi = [[NSMenuItem alloc] initWithTitle: toNSStr(texts[i]) action: NULL keyEquivalent: @""];
         [mi setRepresentedObject:[NSNumber numberWithInt:values[i]]];
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index e886f31e9f..f73ebcf14e 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1474,7 +1474,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
     int i_current_selection = config_GetInt(self.p_item->psz_name);
     int64_t *values;
     char **texts;
-    ssize_t count = config_GetIntChoices(VLC_OBJECT(getIntf()), self.p_item->psz_name, &values, &texts);
+    ssize_t count = config_GetIntChoices(self.p_item->psz_name, &values, &texts);
     for (ssize_t i = 0; i < count; i++) {
         NSMenuItem *mi = [[NSMenuItem alloc] initWithTitle: toNSStr(texts[i]) action: NULL keyEquivalent: @""];
         [mi setRepresentedObject:[NSNumber numberWithInt:values[i]]];
diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 6d0c02c9c1..b4d198d267 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -398,8 +398,7 @@ void ExtVideo::initComboBoxItems( QObject *widget )
     {
         int64_t *values;
         char **texts;
-        ssize_t count = config_GetIntChoices( VLC_OBJECT( p_intf ),
-                                              qtu( option ), &values, &texts );
+        ssize_t count = config_GetIntChoices( qtu( option ), &values, &texts );
         for( ssize_t i = 0; i < count; i++ )
         {
             combobox->addItem( qtr( texts[i] ), qlonglong(values[i]) );
diff --git a/modules/gui/qt/components/preferences_widgets.cpp b/modules/gui/qt/components/preferences_widgets.cpp
index 2e2062da78..232e27d54a 100644
--- a/modules/gui/qt/components/preferences_widgets.cpp
+++ b/modules/gui/qt/components/preferences_widgets.cpp
@@ -493,8 +493,7 @@ void setfillVLCConfigCombo( const char *configname, intf_thread_t *p_intf,
     {
         int64_t *values;
         char **texts;
-        ssize_t count = config_GetIntChoices(VLC_OBJECT(p_intf), configname,
-                                             &values, &texts);
+        ssize_t count = config_GetIntChoices(configname, &values, &texts);
         for( ssize_t i = 0; i < count; i++ )
         {
             combo->addItem( qtr(texts[i]), QVariant(qlonglong(values[i])) );
@@ -905,7 +904,7 @@ void IntegerListConfigControl::finish(module_config_t *p_module_config )
 
     int64_t *values;
     char **texts;
-    ssize_t count = config_GetIntChoices( p_this, p_module_config->psz_name,
+    ssize_t count = config_GetIntChoices( p_module_config->psz_name,
                                           &values, &texts );
     for( ssize_t i = 0; i < count; i++ )
     {
diff --git a/src/config/core.c b/src/config/core.c
index 63abca4647..bec7e0e9aa 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -194,24 +194,19 @@ void config_PutFloat(const char *psz_name, float f_value)
     vlc_rwlock_unlock (&config_lock);
 }
 
-ssize_t config_GetIntChoices (vlc_object_t *obj, const char *name,
+ssize_t config_GetIntChoices(const char *name,
                              int64_t **restrict values, char ***restrict texts)
 {
     *values = NULL;
     *texts = NULL;
 
     module_config_t *cfg = config_FindConfig(name);
-    if (cfg == NULL)
-    {
-        msg_Warn (obj, "option %s does not exist", name);
-        errno = ENOENT;
-        return -1;
-    }
+    assert(cfg != NULL);
 
     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 0f550cea79..e5d9bf7323 100644
--- a/src/config/help.c
+++ b/src/config/help.c
@@ -428,7 +428,7 @@ static void print_item(const vlc_object_t *p_this, const module_t *m, const modu
             int64_t *pi_values;
             char **ppsz_texts;
 
-            ssize_t i_count = config_GetIntChoices(VLC_OBJECT(p_this), item->psz_name, &pi_values, &ppsz_texts);
+            ssize_t i_count = config_GetIntChoices(item->psz_name, &pi_values, &ppsz_texts);
 
             if (i_count > 0)
             {



More information about the vlc-commits mailing list