mate-desktop / mate-media

Media tools for MATE
https://mate-desktop.org
GNU General Public License v2.0
19 stars 25 forks source link

Fix warnings -Wfloat-conversion, -Wimplicit-float-conversion #185

Closed rbuj closed 2 years ago

rbuj commented 2 years ago
CFLAGS="-g -O0 -Wconversion -Wunused-macros -Wunused-parameter" CC=clang ./autogen.sh --prefix=/usr --enable-debug --enable-compile-warnings=maximum && make &> make.log

Fix the build warnings below:

gvc-balance-bar.c:485:76: warning: implicit conversion loses floating-point precision: 'gdouble' (aka 'double') to 'gfloat' (aka 'float') [-Wimplicit-float-conversion]
                mate_mixer_stream_control_set_balance (bar->priv->control, value);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                      ^~~~~
gvc-balance-bar.c:488:73: warning: implicit conversion loses floating-point precision: 'gdouble' (aka 'double') to 'gfloat' (aka 'float') [-Wimplicit-float-conversion]
                mate_mixer_stream_control_set_fade (bar->priv->control, value);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                      ^~~~~
gvc-balance-bar.c:493:55: warning: implicit conversion turns floating-point number into integer: 'gdouble' (aka 'double') to 'guint' (aka 'unsigned int') [-Wfloat-conversion]
                                                      value);
                                                      ^~~~~
--
gvc-level-bar.c:182:55: warning: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Wfloat-conversion]
                peak_level = bar->priv->peak_fraction * bar->priv->layout.area.height;
                           ~ ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gvc-level-bar.c:183:54: warning: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Wfloat-conversion]
                max_peak_level = bar->priv->max_peak * bar->priv->layout.area.height;
                               ~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gvc-level-bar.c:192:55: warning: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Wfloat-conversion]
                peak_level = bar->priv->peak_fraction * bar->priv->layout.area.width;
                           ~ ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gvc-level-bar.c:193:54: warning: implicit conversion turns floating-point number into integer: 'double' to 'int' [-Wfloat-conversion]
                max_peak_level = bar->priv->max_peak * bar->priv->layout.area.width;
                               ~ ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
gvc-level-bar.c:527:24: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
        if (!width || !height)
                      ~^~~~~~
gvc-level-bar.c:527:14: warning: implicit conversion turns floating-point number into integer: 'double' to '_Bool' [-Wfloat-conversion]
        if (!width || !height)
            ~^~~~~
lukefromdc commented 2 years ago

Note that our new developers who are writing many PR's to fix so many of these warnings need to be reviewing each other's PR's. This would break the logjam and clear the backlog. They are the future of MATE as many of the older devs cannot make a lifetime commitment, and cannot review a dozen PR's a day on a production line basis. The bigger DE's get financial help from distros, we don't get that.