summaryrefslogtreecommitdiff
path: root/mate-volume-control/gvc-level-bar.c
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2023-11-07 15:23:47 +0100
committerraveit65 <[email protected]>2023-11-08 18:25:08 +0100
commit86271b3717f1aa499457b75caf1d44e0e64bda6b (patch)
treeafdeb70b178171a2f37189f2f13bbddcfae56a69 /mate-volume-control/gvc-level-bar.c
parent0c06fb5f7caf8bcdbbf0dc54f856d9099081b0ba (diff)
downloadmate-media-86271b3717f1aa499457b75caf1d44e0e64bda6b.tar.bz2
mate-media-86271b3717f1aa499457b75caf1d44e0e64bda6b.tar.xz
Fix various instance checks
The g_return*_if_fail() calls should use PREFIX_IS_TYPE_NAME [1], which returns whether the given instance is of the right type, not PREFIX_TYPE_NAME [2], which checks whether the given instance if of the right type, warns if not, and returns the passed-in instance unchanged. Using the wrong one means the returned value is the passed-in pointer, and thus passes the g_return*_if_fail() whenever the pointer is non-NULL, no matter whether it's of the right type or not. A warning would still be emitted by g_type_check_instance_cast(), but the execution wouldn't get short-circuited. [1] calls g_type_check_instance_is_a() [2] calls g_type_check_instance_cast()
Diffstat (limited to 'mate-volume-control/gvc-level-bar.c')
-rw-r--r--mate-volume-control/gvc-level-bar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mate-volume-control/gvc-level-bar.c b/mate-volume-control/gvc-level-bar.c
index ccf141b..13e7aeb 100644
--- a/mate-volume-control/gvc-level-bar.c
+++ b/mate-volume-control/gvc-level-bar.c
@@ -295,7 +295,7 @@ void
gvc_level_bar_set_peak_adjustment (GvcLevelBar *bar,
GtkAdjustment *adjustment)
{
- g_return_if_fail (GVC_LEVEL_BAR (bar));
+ g_return_if_fail (GVC_IS_LEVEL_BAR (bar));
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
if (bar->priv->peak_adjustment != NULL) {
@@ -321,7 +321,7 @@ void
gvc_level_bar_set_rms_adjustment (GvcLevelBar *bar,
GtkAdjustment *adjustment)
{
- g_return_if_fail (GVC_LEVEL_BAR (bar));
+ g_return_if_fail (GVC_IS_LEVEL_BAR (bar));
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
if (bar->priv->rms_adjustment != NULL) {