diff options
author | rbuj <[email protected]> | 2022-03-16 11:41:57 +0100 |
---|---|---|
committer | mbkma <[email protected]> | 2022-03-18 20:58:33 +0100 |
commit | d10b694e96758b221b03f3ac9e0f42ec75b02fb1 (patch) | |
tree | 93dac08ff1d7762da67f89affc8c845b0cbc0af4 | |
parent | cc7a4cfe09b8df0c8db4944e95130e6c42b68b7f (diff) | |
download | mate-media-d10b694e96758b221b03f3ac9e0f42ec75b02fb1.tar.bz2 mate-media-d10b694e96758b221b03f3ac9e0f42ec75b02fb1.tar.xz |
Fix warnings -Wfloat-conversion, -Wimplicit-float-conversion
-rw-r--r-- | mate-volume-control/gvc-balance-bar.c | 10 | ||||
-rw-r--r-- | mate-volume-control/gvc-level-bar.c | 18 |
2 files changed, 15 insertions, 13 deletions
diff --git a/mate-volume-control/gvc-balance-bar.c b/mate-volume-control/gvc-balance-bar.c index e4fccb8..55918b7 100644 --- a/mate-volume-control/gvc-balance-bar.c +++ b/mate-volume-control/gvc-balance-bar.c @@ -482,15 +482,17 @@ on_adjustment_value_changed (GtkAdjustment *adjustment, GvcBalanceBar *bar) switch (bar->priv->btype) { case BALANCE_TYPE_RL: - mate_mixer_stream_control_set_balance (bar->priv->control, value); + mate_mixer_stream_control_set_balance (bar->priv->control, + (gfloat) value); break; case BALANCE_TYPE_FR: - mate_mixer_stream_control_set_fade (bar->priv->control, value); + mate_mixer_stream_control_set_fade (bar->priv->control, + (gfloat) value); break; case BALANCE_TYPE_LFE: mate_mixer_stream_control_set_channel_volume (bar->priv->control, - bar->priv->lfe_channel, - value); + bar->priv->lfe_channel, + (guint) value); break; } } diff --git a/mate-volume-control/gvc-level-bar.c b/mate-volume-control/gvc-level-bar.c index 0d815fc..ccf141b 100644 --- a/mate-volume-control/gvc-level-bar.c +++ b/mate-volume-control/gvc-level-bar.c @@ -150,8 +150,8 @@ reset_max_peak (GvcLevelBar *bar) static void bar_calc_layout (GvcLevelBar *bar) { - int peak_level; - int max_peak_level; + gdouble peak_level; + gdouble max_peak_level; GtkAllocation allocation; GtkStyleContext *context; @@ -179,8 +179,8 @@ bar_calc_layout (GvcLevelBar *bar) bar->priv->layout.area.height = allocation.height - 2; if (bar->priv->orientation == GTK_ORIENTATION_VERTICAL) { - peak_level = bar->priv->peak_fraction * bar->priv->layout.area.height; - max_peak_level = bar->priv->max_peak * bar->priv->layout.area.height; + peak_level = bar->priv->peak_fraction * (gdouble) bar->priv->layout.area.height; + max_peak_level = bar->priv->max_peak * (gdouble) bar->priv->layout.area.height; bar->priv->layout.delta = bar->priv->layout.area.height / NUM_BOXES; bar->priv->layout.area.x = 0; @@ -189,8 +189,8 @@ bar_calc_layout (GvcLevelBar *bar) bar->priv->layout.box_width = bar->priv->layout.area.width; bar->priv->layout.box_radius = bar->priv->layout.box_width / 2; } else { - peak_level = bar->priv->peak_fraction * bar->priv->layout.area.width; - max_peak_level = bar->priv->max_peak * bar->priv->layout.area.width; + peak_level = bar->priv->peak_fraction * (gdouble) bar->priv->layout.area.width; + max_peak_level = bar->priv->max_peak * (gdouble) bar->priv->layout.area.width; bar->priv->layout.delta = bar->priv->layout.area.width / NUM_BOXES; bar->priv->layout.area.x = 0; @@ -200,8 +200,8 @@ bar_calc_layout (GvcLevelBar *bar) bar->priv->layout.box_radius = bar->priv->layout.box_height / 2; } - bar->priv->layout.peak_num = peak_level / bar->priv->layout.delta; - bar->priv->layout.max_peak_num = max_peak_level / bar->priv->layout.delta; + bar->priv->layout.peak_num = (int) (peak_level / (gdouble) bar->priv->layout.delta); + bar->priv->layout.max_peak_num = (int) (max_peak_level / (gdouble) bar->priv->layout.delta); } static void @@ -524,7 +524,7 @@ curved_rectangle (cairo_t *cr, x1 = x0 + width; y1 = y0 + height; - if (!width || !height) + if (width == 0.0 || height == 0.0) return; if (width / 2 < radius) { |