[vlc-commits] config: remove unused config_GetFloat() parameter
Rémi Denis-Courmont
git at videolan.org
Wed Feb 28 19:12:04 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 28 19:13:04 2018 +0200| [2c384e37cb1f4333142439457ab04a3a1ace6270] | committer: Rémi Denis-Courmont
config: remove unused config_GetFloat() parameter
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c384e37cb1f4333142439457ab04a3a1ace6270
---
include/vlc_configuration.h | 3 +--
modules/gui/macosx/VLCOpenWindowController.m | 2 +-
modules/gui/macosx/VLCVoutWindowController.m | 2 +-
modules/gui/macosx/Windows.m | 2 +-
modules/gui/macosx/prefs_widgets.m | 6 +++---
modules/gui/qt/components/controller_widget.cpp | 2 +-
modules/gui/qt/components/extended_panels.cpp | 2 +-
modules/gui/qt/components/simple_preferences.cpp | 16 ++++++++--------
modules/gui/skins2/vars/volume.cpp | 3 +--
modules/lua/libs/configuration.c | 2 +-
src/config/core.c | 3 +--
src/misc/variables.c | 2 +-
12 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 102a353625..92d92cd668 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -164,7 +164,7 @@ VLC_API void config_PutInt(vlc_object_t *, const char *name, int64_t val);
* \bug A legitimate floating point value of -1 cannot be distinguished from an
* error.
*/
-VLC_API float config_GetFloat(vlc_object_t *, const char *name) VLC_USED;
+VLC_API float config_GetFloat(const char *name) VLC_USED;
/**
* Sets an integer configuration item.
@@ -325,7 +325,6 @@ VLC_API void config_RemoveIntf( vlc_object_t *, const char * );
VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
#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_PutFloat(a,b,c) config_PutFloat(VLC_OBJECT(a),b,c)
#define config_GetPsz(a,b) config_GetPsz(VLC_OBJECT(a),b)
#define config_PutPsz(a,b,c) config_PutPsz(VLC_OBJECT(a),b,c)
diff --git a/modules/gui/macosx/VLCOpenWindowController.m b/modules/gui/macosx/VLCOpenWindowController.m
index 075d16ff30..e21fc93115 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -1099,7 +1099,7 @@ static NSString *kCaptureTabViewId = @"capture";
[self setMRL: @"screen://"];
[_screenHeightTextField setIntValue: config_GetInt("screen-height")];
[_screenWidthTextField setIntValue: config_GetInt("screen-width")];
- [_screenFPSTextField setFloatValue: config_GetFloat(p_intf, "screen-fps")];
+ [_screenFPSTextField setFloatValue: config_GetFloat("screen-fps")];
[_screenLeftTextField setIntValue: config_GetInt("screen-left")];
[_screenTopTextField setIntValue: config_GetInt("screen-top")];
[_screenFollowMouseCheckbox setIntValue: config_GetInt("screen-follow-mouse")];
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index 5e2a756fd3..c72a5c19d3 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -368,7 +368,7 @@ void WindowClose(vout_window_t *p_wnd)
[newVideoWindow makeKeyAndOrderFront: self];
}
- [newVideoWindow setAlphaValue: config_GetFloat(getIntf(), "macosx-opaqueness")];
+ [newVideoWindow setAlphaValue: config_GetFloat("macosx-opaqueness")];
[voutView setVoutThread:(vout_thread_t *)p_wnd->obj.parent];
[newVideoWindow setHasActiveVideo: YES];
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index ca22a19212..18e9c25f2b 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -1036,7 +1036,7 @@
[[[VLCMain sharedInstance] voutController] updateWindowLevelForHelperWindows: i_originalLevel];
[self setLevel:i_originalLevel];
- [self setAlphaValue: config_GetFloat(getIntf(), "macosx-opaqueness")];
+ [self setAlphaValue: config_GetFloat("macosx-opaqueness")];
}
- (void)animationDidEnd:(NSAnimation*)animation
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index f7160d568e..4baa5fd84f 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1687,7 +1687,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
- [o_textfield setFloatValue: config_GetFloat(getIntf(), self.p_item->psz_name)];
+ [o_textfield setFloatValue: config_GetFloat(self.p_item->psz_name)];
[super resetValues];
}
@end
@@ -1797,8 +1797,8 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
- [o_textfield setFloatValue: config_GetFloat(getIntf(), self.p_item->psz_name)];
- [o_slider setFloatValue: config_GetFloat(getIntf(), self.p_item->psz_name)];
+ [o_textfield setFloatValue: config_GetFloat(self.p_item->psz_name)];
+ [o_slider setFloatValue: config_GetFloat(self.p_item->psz_name)];
[super resetValues];
}
@end
diff --git a/modules/gui/qt/components/controller_widget.cpp b/modules/gui/qt/components/controller_widget.cpp
index 45ce4219fc..7fcece07e8 100644
--- a/modules/gui/qt/components/controller_widget.cpp
+++ b/modules/gui/qt/components/controller_widget.cpp
@@ -91,7 +91,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
if( b_shiny )
{
volumeSlider = new SoundSlider( this,
- config_GetFloat( p_intf, "volume-step" ),
+ config_GetFloat( "volume-step" ),
var_InheritString( p_intf, "qt-slider-colours" ),
var_InheritInteger( p_intf, "qt-max-volume") );
}
diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 2433833a0b..afe9c31189 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -885,7 +885,7 @@ float FilterSliderData::initialValue()
if ( ! config_FindConfig( qtu(p_data->name) ) )
return f;
- f = config_GetFloat( p_intf, qtu(p_data->name) );
+ f = config_GetFloat( qtu(p_data->name) );
return f;
}
diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index cc05135325..45544708bd 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -133,7 +133,7 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
* saving. In case of automatic mode, we'll save the last volume for
* every modules. Therefore, all volumes variable we be the same and we
* can use the first one (mmdevice). */
- return config_GetFloat(obj, "mmdevice-volume") * 100.f + .5f;
+ return config_GetFloat("mmdevice-volume") * 100.f + .5f;
#else
return -1;
#endif
@@ -145,12 +145,12 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
else
#ifdef __linux__
if (!strcmp(aout, "alsa") && module_exists("alsa"))
- return cbrtf(config_GetFloat(obj, "alsa-gain")) * 100.f + .5f;
+ return cbrtf(config_GetFloat("alsa-gain")) * 100.f + .5f;
else
#endif
#ifdef _WIN32
if (!strcmp(aout, "mmdevice"))
- return config_GetFloat(obj, "mmdevice-volume") * 100.f + .5f;
+ return config_GetFloat("mmdevice-volume") * 100.f + .5f;
else
#endif
if (!strcmp(aout, "sndio"))
@@ -158,21 +158,21 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
else
#ifdef __APPLE__
if (!strcmp(aout, "auhal") && module_exists("auhal"))
- return (config_GetFloat(obj, "auhal-volume") * 100.f + .5f)
+ return (config_GetFloat("auhal-volume") * 100.f + .5f)
/ AOUT_VOLUME_DEFAULT;
else
#endif
#ifdef _WIN32
if (!strcmp(aout, "directsound") && module_exists("directsound"))
- return config_GetFloat(obj, "directx-volume") * 100.f + .5f;
+ return config_GetFloat("directx-volume") * 100.f + .5f;
else
#endif
if (!strcmp(aout, "jack"))
- return cbrtf(config_GetFloat(obj, "jack-gain")) * 100.f + 0.5f;
+ return cbrtf(config_GetFloat("jack-gain")) * 100.f + 0.5f;
else
#ifdef __OS2__
if (!strcmp(aout, "kai"))
- return cbrtf(config_GetFloat(obj, "kai-gain")) * 100.f + .5f;
+ return cbrtf(config_GetFloat("kai-gain")) * 100.f + .5f;
else
#endif
if (!strcmp(aout, "oss"))
@@ -180,7 +180,7 @@ static int getDefaultAudioVolume(vlc_object_t *obj, const char *aout)
else
#ifdef _WIN32
if (!strcmp(aout, "waveout"))
- return config_GetFloat(obj, "waveout-volume") * 100.f + .5f;
+ return config_GetFloat("waveout-volume") * 100.f + .5f;
else
#endif
return -1;
diff --git a/modules/gui/skins2/vars/volume.cpp b/modules/gui/skins2/vars/volume.cpp
index 4a0072c6ae..d1c7b9d22b 100644
--- a/modules/gui/skins2/vars/volume.cpp
+++ b/modules/gui/skins2/vars/volume.cpp
@@ -35,8 +35,7 @@
Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf )
{
// compute preferred step in [0.,1.] range
- m_step = config_GetFloat( pIntf, "volume-step" )
- / (float)AOUT_VOLUME_MAX;
+ m_step = config_GetFloat( "volume-step" ) / (float)AOUT_VOLUME_MAX;
// set current volume from the playlist
setVolume( var_GetFloat( getPL(), "volume" ), false );
diff --git a/modules/lua/libs/configuration.c b/modules/lua/libs/configuration.c
index 030f13897e..7ac675abdd 100644
--- a/modules/lua/libs/configuration.c
+++ b/modules/lua/libs/configuration.c
@@ -63,7 +63,7 @@ static int vlclua_config_get( lua_State *L )
break;
case VLC_VAR_FLOAT:
- lua_pushnumber( L, config_GetFloat( p_this, psz_name ) );
+ lua_pushnumber( L, config_GetFloat( psz_name ) );
break;
default:
diff --git a/src/config/core.c b/src/config/core.c
index b7020a0eb1..4314f93484 100644
--- a/src/config/core.c
+++ b/src/config/core.c
@@ -93,8 +93,7 @@ int64_t config_GetInt(const char *psz_name)
return val;
}
-#undef config_GetFloat
-float config_GetFloat( vlc_object_t *p_this, const char *psz_name )
+float config_GetFloat(const char *psz_name)
{
module_config_t *p_config;
diff --git a/src/misc/variables.c b/src/misc/variables.c
index 704091ff4e..ed69a02699 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -1188,7 +1188,7 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
if( !p_val->psz_string ) p_val->psz_string = strdup("");
break;
case VLC_VAR_FLOAT:
- p_val->f_float = config_GetFloat( p_this, psz_name );
+ p_val->f_float = config_GetFloat( psz_name );
break;
case VLC_VAR_INTEGER:
p_val->i_int = config_GetInt( psz_name );
More information about the vlc-commits
mailing list