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

config: remove unused config_GetInt() parameter

parent 0f69e188
......@@ -131,7 +131,7 @@ VLC_API int config_GetType(const char *name) VLC_USED;
* \return The configuration item value or -1 if not found.
* \bug A legitimate integer value of -1 cannot be distinguished from an error.
*/
VLC_API int64_t config_GetInt(vlc_object_t *, const char *) VLC_USED;
VLC_API int64_t config_GetInt(const char *) VLC_USED;
/**
* Sets an integer configuration item.
......@@ -324,7 +324,6 @@ VLC_API void config_AddIntf( vlc_object_t *, const char * );
VLC_API void config_RemoveIntf( vlc_object_t *, const char * );
VLC_API bool config_ExistIntf( vlc_object_t *, const char * ) VLC_USED;
#define config_GetInt(a,b) config_GetInt(VLC_OBJECT(a),b)
#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)
......
......@@ -158,7 +158,7 @@
[[self window] setMenu:nil];
[[self window] setBackgroundColor: [NSColor colorWithCalibratedWhite:.96 alpha:1.]];
if (config_GetInt(getIntf(), "macosx-icon-change")) {
if (config_GetInt("macosx-icon-change")) {
/* After day 354 of the year, the usual VLC cone is replaced by another cone
* wearing a Father Xmas hat.
* Note: this icon doesn't represent an endorsement of The Coca-Cola Company.
......
......@@ -132,7 +132,7 @@
self.fullscreenButtonWidthConstraint.constant = 0;
}
if (config_GetInt(getIntf(), "macosx-show-playback-buttons"))
if (config_GetInt("macosx-show-playback-buttons"))
[self toggleForwardBackwardMode: YES];
}
......
......@@ -656,7 +656,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
- (BOOL)aspectRatioIsLocked
{
return config_GetInt(getIntf(), "macosx-lock-aspect-ratio");
return config_GetInt("macosx-lock-aspect-ratio");
}
- (void)toggleFullscreen
......@@ -1052,27 +1052,27 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
[self playOrPause];
break;
case kRemoteButtonVolume_Plus:
if (config_GetInt(getIntf(), "macosx-appleremote-sysvol"))
if (config_GetInt("macosx-appleremote-sysvol"))
[NSSound increaseSystemVolume];
else
if (p_intf)
var_SetInteger(p_intf->obj.libvlc, "key-action", ACTIONID_VOL_UP);
break;
case kRemoteButtonVolume_Minus:
if (config_GetInt(getIntf(), "macosx-appleremote-sysvol"))
if (config_GetInt("macosx-appleremote-sysvol"))
[NSSound decreaseSystemVolume];
else
if (p_intf)
var_SetInteger(p_intf->obj.libvlc, "key-action", ACTIONID_VOL_DOWN);
break;
case kRemoteButtonRight:
if (config_GetInt(getIntf(), "macosx-appleremote-prevnext"))
if (config_GetInt("macosx-appleremote-prevnext"))
[self forward];
else
[self next];
break;
case kRemoteButtonLeft:
if (config_GetInt(getIntf(), "macosx-appleremote-prevnext"))
if (config_GetInt("macosx-appleremote-prevnext"))
[self backward];
else
[self previous];
......
......@@ -579,7 +579,7 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
if (!lastPosition || lastPosition.intValue <= 0)
return;
int settingValue = config_GetInt(getIntf(), "macosx-continue-playback");
int settingValue = config_GetInt("macosx-continue-playback");
if (settingValue == 2) // never resume
return;
......
......@@ -259,7 +259,7 @@
if (!strstr(psz_config, "postproc"))
[[_postprocessingMenu itemAtIndex:0] setState:NSOnState];
else
[[_postprocessingMenu itemWithTag:config_GetInt(p_intf, "postproc-q")] setState:NSOnState];
[[_postprocessingMenu itemWithTag:config_GetInt("postproc-q")] setState:NSOnState];
free(psz_config);
} else
[[_postprocessingMenu itemAtIndex:0] setState:NSOnState];
......@@ -276,7 +276,7 @@
var_Create(p_playlist, "freetype-outline-thickness", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
[self setupMenu: _subtitle_textcolorMenu withIntList:"freetype-color" andSelector:@selector(switchSubtitleOption:)];
[_subtitle_bgopacity_sld setIntValue: config_GetInt(VLC_OBJECT(p_intf), "freetype-background-opacity")];
[_subtitle_bgopacity_sld setIntValue: config_GetInt("freetype-background-opacity")];
[self setupMenu: _subtitle_bgcolorMenu withIntList:"freetype-background-color" andSelector:@selector(switchSubtitleOption:)];
[self setupMenu: _subtitle_outlinethicknessMenu withIntList:"freetype-outline-thickness" andSelector:@selector(switchSubtitleOption:)];
......
......@@ -531,7 +531,7 @@ static const float f_min_window_height = 307.;
- (void)someWindowWillMiniaturize:(NSNotification *)notification
{
if (config_GetInt(getIntf(), "macosx-pause-minimized")) {
if (config_GetInt("macosx-pause-minimized")) {
id obj = [notification object];
if ([obj class] == [VLCVideoWindowCommon class] || [obj class] == [VLCDetachedVideoWindow class] || ([obj class] == [VLCMainWindow class] && !self.nonembedded)) {
......@@ -1252,7 +1252,7 @@ static const float f_min_window_height = 307.;
[super awakeFromNib];
[self setAcceptsMouseMovedEvents: YES];
BOOL darkInterface = config_GetInt(getIntf(), "macosx-interfacestyle");
BOOL darkInterface = config_GetInt("macosx-interfacestyle");
if (darkInterface) {
[self setBackgroundColor: [NSColor clearColor]];
......
......@@ -199,8 +199,8 @@ static NSString *kCaptureTabViewId = @"capture";
[[_netModeMatrix cellAtRow:0 column:0] setTitle: _NS("Unicast")];
[[_netModeMatrix cellAtRow:1 column:0] setTitle: _NS("Multicast")];
[_netUDPPortTextField setIntValue: config_GetInt(getIntf(), "server-port")];
[_netUDPPortStepper setIntValue: config_GetInt(getIntf(), "server-port")];
[_netUDPPortTextField setIntValue: config_GetInt("server-port")];
[_netUDPPortStepper setIntValue: config_GetInt("server-port")];
[_captureModePopup removeAllItems];
[_captureModePopup addItemWithTitle: _NS("Input Devices")];
......@@ -1011,7 +1011,7 @@ static NSString *kCaptureTabViewId = @"capture";
else
mrlString = @"rtp://";
if (port != config_GetInt(getIntf(), "server-port")) {
if (port != config_GetInt("server-port")) {
mrlString =
[mrlString stringByAppendingFormat: @"@:%i", port];
}
......@@ -1025,7 +1025,7 @@ static NSString *kCaptureTabViewId = @"capture";
else
mrlString = [NSString stringWithFormat: @"rtp://@%@", oAddress];
if (iPort != config_GetInt(getIntf(), "server-port")) {
if (iPort != config_GetInt("server-port")) {
mrlString =
[mrlString stringByAppendingFormat: @":%i", iPort];
}
......@@ -1060,7 +1060,7 @@ static NSString *kCaptureTabViewId = @"capture";
else
mrlString = @"rtp://";
if (port != config_GetInt(getIntf(), "server-port")) {
if (port != config_GetInt("server-port")) {
mrlString =
[mrlString stringByAppendingFormat: @"@:%i", port];
}
......@@ -1074,7 +1074,7 @@ static NSString *kCaptureTabViewId = @"capture";
else
mrlString = [NSString stringWithFormat: @"rtp://@%@", oAddress];
if (iPort != config_GetInt(getIntf(), "server-port")) {
if (iPort != config_GetInt("server-port")) {
mrlString =
[mrlString stringByAppendingFormat: @":%i", iPort];
}
......@@ -1097,15 +1097,15 @@ static NSString *kCaptureTabViewId = @"capture";
[_captureTabView selectTabViewItemAtIndex:1];
[self setMRL: @"screen://"];
[_screenHeightTextField setIntValue: config_GetInt(p_intf, "screen-height")];
[_screenWidthTextField setIntValue: config_GetInt(p_intf, "screen-width")];
[_screenHeightTextField setIntValue: config_GetInt("screen-height")];
[_screenWidthTextField setIntValue: config_GetInt("screen-width")];
[_screenFPSTextField setFloatValue: config_GetFloat(p_intf, "screen-fps")];
[_screenLeftTextField setIntValue: config_GetInt(p_intf, "screen-left")];
[_screenTopTextField setIntValue: config_GetInt(p_intf, "screen-top")];
[_screenFollowMouseCheckbox setIntValue: config_GetInt(p_intf, "screen-follow-mouse")];
[_screenLeftTextField setIntValue: config_GetInt("screen-left")];
[_screenTopTextField setIntValue: config_GetInt("screen-top")];
[_screenFollowMouseCheckbox setIntValue: config_GetInt("screen-follow-mouse")];
int screenIindex = config_GetInt(p_intf, "screen-index");
int displayID = config_GetInt(p_intf, "screen-display-id");
int screenIindex = config_GetInt("screen-index");
int displayID = config_GetInt("screen-display-id");
unsigned int displayCount = 0;
CGError returnedError;
struct display_info_t *item;
......
......@@ -485,7 +485,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
- (void)setupButton: (NSButton *)object forBoolValue: (const char *)name
{
[object setState: config_GetInt(p_intf, name)];
[object setState: config_GetInt(name)];
[object setToolTip: _NS(config_GetLabel(p_intf, name))];
}
......@@ -579,7 +579,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
BOOL growlEnabled = [self hasModule:@"growl" inConfig:@"control"];
[_intf_enableNotificationsCheckbox setState: growlEnabled ? NSOnState : NSOffState];
if (config_GetInt(p_intf, "macosx-interfacestyle")) {
if (config_GetInt("macosx-interfacestyle")) {
[_intf_style_darkButtonCell setState: YES];
[_intf_style_brightButtonCell setState: NO];
} else {
......@@ -598,7 +598,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
******************/
[self setupButton:_audio_enableCheckbox forBoolValue: "audio"];
if (config_GetInt(p_intf, "volume-save")) {
if (config_GetInt("volume-save")) {
[_audio_autosavevol_yesButtonCell setState: NSOnState];
[_audio_autosavevol_noButtonCell setState: NSOffState];
[_audio_volTextField setEnabled: NO];
......@@ -664,7 +664,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
i++;
}
[_video_devicePopup selectItemAtIndex: 0];
[_video_devicePopup selectItemWithTag: config_GetInt(p_intf, "macosx-vdev")];
[_video_devicePopup selectItemWithTag: config_GetInt("macosx-vdev")];
[self setupField:_video_snap_folderTextField forOption:"snapshot-path"];
[self setupField:_video_snap_prefixTextField forOption:"snapshot-prefix"];
......@@ -680,7 +680,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
* input & codecs settings *
***************************/
[self setupField:_input_recordTextField forOption:"input-record-path"];
[_input_postprocTextField setIntValue: config_GetInt(p_intf, "postproc-q")];
[_input_postprocTextField setIntValue: config_GetInt("postproc-q")];
[_input_postprocTextField setToolTip: _NS(config_GetLabel(p_intf, "postproc-q"))];
[self setupButton:_input_skipFramesCheckbox forBoolValue: "skip-frames"];
[self setupButton:_input_aviPopup forIntList: "avi-index"];
......@@ -702,11 +702,11 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
#define TestCaC(name, factor) \
cache_equal = cache_equal && \
(i_cache * factor == config_GetInt(p_intf, name));
(i_cache * factor == config_GetInt(name));
/* Select the accurate value of the PopupButton */
bool cache_equal = true;
int i_cache = config_GetInt(p_intf, "file-caching");
int i_cache = config_GetInt("file-caching");
TestCaC("network-caching", 10/3);
TestCaC("disc-caching", 1);
......@@ -731,7 +731,7 @@ static inline const char * __config_GetLabel(vlc_object_t *p_this, const char *p
[self setupField:_osd_fontTextField forOption: "freetype-font"];
[self setupButton:_osd_font_colorPopup forIntList: "freetype-color"];
[self setupButton:_osd_font_sizePopup forIntList: "freetype-rel-fontsize"];
i = config_GetInt(p_intf, "freetype-opacity") * 100.0 / 255.0 + 0.5;
i = config_GetInt("freetype-opacity") * 100.0 / 255.0 + 0.5;
[_osd_opacityTextField setIntValue: i];
[_osd_opacitySlider setIntValue: i];
[_osd_opacitySlider setToolTip: _NS(config_GetLabel(p_intf, "freetype-opacity"))];
......
......@@ -231,7 +231,7 @@
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
_darkInterface = config_GetInt(getIntf(), "macosx-interfacestyle");
_darkInterface = config_GetInt("macosx-interfacestyle");
if (_darkInterface) {
styleMask = NSBorderlessWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask;
......
......@@ -1395,7 +1395,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
-(void)resetValues
{
[o_textfield setIntValue: config_GetInt(getIntf(), self.p_item->psz_name)];
[o_textfield setIntValue: config_GetInt(self.p_item->psz_name)];
[super resetValues];
}
......@@ -1471,7 +1471,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
{
[o_popup removeAllItems];
int i_current_selection = config_GetInt(getIntf(), self.p_item->psz_name);
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);
......@@ -1596,7 +1596,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
int value = config_GetInt(getIntf(), self.p_item->psz_name);
int value = config_GetInt(self.p_item->psz_name);
[o_textfield setIntValue:value];
[o_slider setIntValue:value];
[super resetValues];
......@@ -1846,7 +1846,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
[o_checkbox setState: config_GetInt(getIntf(), self.p_item->psz_name)];
[o_checkbox setState: config_GetInt(self.p_item->psz_name)];
[super resetValues];
}
@end
......@@ -1925,7 +1925,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
- (void)resetValues
{
[o_popup selectItem:[[o_popup menu] itemWithTag:config_GetInt(getIntf(), self.p_item->psz_name)]];
[o_popup selectItem:[[o_popup menu] itemWithTag:config_GetInt(self.p_item->psz_name)]];
[super resetValues];
}
@end
......
......@@ -518,7 +518,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#undef audioControl
#undef audioCommon
int i_max_volume = config_GetInt( p_intf, "qt-max-volume" );
int i_max_volume = config_GetInt( "qt-max-volume" );
/* Audio Options */
ui.volumeValue->setMaximum( i_max_volume );
......@@ -691,10 +691,10 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#define TestCaC( name, factor ) \
b_cache_equal = b_cache_equal && \
( i_cache * factor == config_GetInt( p_intf, name ) );
( i_cache * factor == config_GetInt( name ) );
/* Select the accurate value of the ComboBox */
bool b_cache_equal = true;
int i_cache = config_GetInt( p_intf, "file-caching" );
int i_cache = config_GetInt( "file-caching" );
TestCaC( "network-caching", 10/3 );
TestCaC( "disc-caching", 1);
......@@ -878,8 +878,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC_NO_BOOL( "sub-margin", Integer, ui.subsPosLabel, subsPosition );
ui.shadowCheck->setChecked( config_GetInt( p_intf, "freetype-shadow-opacity" ) > 0 );
ui.backgroundCheck->setChecked( config_GetInt( p_intf, "freetype-background-opacity" ) > 0 );
ui.shadowCheck->setChecked( config_GetInt( "freetype-shadow-opacity" ) > 0 );
ui.backgroundCheck->setChecked( config_GetInt( "freetype-background-opacity" ) > 0 );
optionWidgets["shadowCB"] = ui.shadowCheck;
optionWidgets["backgroundCB"] = ui.backgroundCheck;
......@@ -1006,7 +1006,7 @@ void SPrefsPanel::updateAudioOptions( int number)
bool save = true;
if (volume >= 0)
save = config_GetInt(VLC_OBJECT(p_intf), "volume-save");
save = config_GetInt("volume-save");
QCheckBox *resetVolumeCheckBox =
qobject_cast<QCheckBox *>(optionWidgets["resetVolumeCheckbox"]);
......@@ -1153,7 +1153,7 @@ void SPrefsPanel::apply()
case SPrefsSubtitles:
{
bool b_checked = qobject_cast<QCheckBox *>(optionWidgets["shadowCB"])->isChecked();
if( b_checked && config_GetInt( p_intf, "freetype-shadow-opacity" ) == 0 ) {
if( b_checked && config_GetInt( "freetype-shadow-opacity" ) == 0 ) {
config_PutInt( p_intf, "freetype-shadow-opacity", 128 );
}
else if (!b_checked ) {
......@@ -1161,7 +1161,7 @@ void SPrefsPanel::apply()
}
b_checked = qobject_cast<QCheckBox *>(optionWidgets["backgroundCB"])->isChecked();
if( b_checked && config_GetInt( p_intf, "freetype-background-opacity" ) == 0 ) {
if( b_checked && config_GetInt( "freetype-background-opacity" ) == 0 ) {
config_PutInt( p_intf, "freetype-background-opacity", 128 );
}
else if (!b_checked ) {
......
......@@ -55,11 +55,11 @@ static int vlclua_config_get( lua_State *L )
}
case VLC_VAR_INTEGER:
lua_pushinteger( L, config_GetInt( p_this, psz_name ) );
lua_pushinteger( L, config_GetInt( psz_name ) );
break;
case VLC_VAR_BOOL:
lua_pushboolean( L, config_GetInt( p_this, psz_name ) );
lua_pushboolean( L, config_GetInt( psz_name ) );
break;
case VLC_VAR_FLOAT:
......
......@@ -77,8 +77,7 @@ bool config_IsSafe( const char *name )
return p_config != NULL && p_config->b_safe;
}
#undef config_GetInt
int64_t config_GetInt( vlc_object_t *p_this, const char *psz_name )
int64_t config_GetInt(const char *psz_name)
{
module_config_t *p_config = config_FindConfig( psz_name );
......
......@@ -1191,10 +1191,10 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
p_val->f_float = config_GetFloat( p_this, psz_name );
break;
case VLC_VAR_INTEGER:
p_val->i_int = config_GetInt( p_this, psz_name );
p_val->i_int = config_GetInt( psz_name );
break;
case VLC_VAR_BOOL:
p_val->b_bool = config_GetInt( p_this, psz_name ) > 0;
p_val->b_bool = config_GetInt( psz_name ) > 0;
break;
default:
vlc_assert_unreachable();
......
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