summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-06-15 21:26:44 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2019-06-15 21:26:44 -0300
commit2a7a100a132eeb77a53fc0a20d86282e96d6c668 (patch)
tree9e4b8a912fffe347c32d979211c15c61b0f762ef
parent468022b708fc1a56154f3b0cc5af3b938fb3e9fb (diff)
downloadlibgnome-volume-control-gbsneto/unnecessary-warnings.tar.gz
mixer-control: Remove unnecessary instance checksgbsneto/unnecessary-warnings
gvc_mixer_control_get_vol_max_norm() and gvc_mixer_control_get_vol_max_amplified() do not access any of the instance variables. In GNOME Settings, we even pass NULL to these functions. So checking the instance is not necessary. In fact, this is causing instance check failures in GNOME Settings, and the entire Sound panel is broken since those functions are returning zero. The reason that only the checks are being dropped, and not the parameter entirely, is to preserve API compatibility.
-rw-r--r--gvc-mixer-control.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gvc-mixer-control.c b/gvc-mixer-control.c
index c611a41..051f6ad 100644
--- a/gvc-mixer-control.c
+++ b/gvc-mixer-control.c
@@ -3744,13 +3744,11 @@ gvc_mixer_control_new (const char *name)
gdouble
gvc_mixer_control_get_vol_max_norm (GvcMixerControl *control)
{
- g_return_val_if_fail (GVC_IS_MIXER_CONTROL (control), 0);
return (gdouble) PA_VOLUME_NORM;
}
gdouble
gvc_mixer_control_get_vol_max_amplified (GvcMixerControl *control)
{
- g_return_val_if_fail (GVC_IS_MIXER_CONTROL (control), 0);
return (gdouble) PA_VOLUME_UI_MAX;
}