Commit 1f1a212b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

config: remove useless config_GetIntChoices() parameter

parent b52de6c5
......@@ -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;
/**
......
......@@ -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]]];
......
......@@ -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]]];
......
......@@ -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]) );
......
......@@ -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++ )
{
......
......@@ -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;
......
......@@ -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)
{
......
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