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 build warning -Wbad-function-cast #182

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 &> mate-media.make.log
grep -A 2 "Wbad-function-cast]" mate-media.make.log 

Fix the build warnings below:

gvc-stream-status-icon.c:427:40: warning: cast from function call of type 'double' to non-matching type 'guint' (aka 'unsigned int') [-Wbad-function-cast]
        guint volume_percent = (guint) round (100.0 * volume / normal);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
gvc-channel-bar.c:450:49: warning: cast from function call of type 'gdouble' (aka 'double') to non-matching type 'guint' (aka 'unsigned int') [-Wbad-function-cast]
                        guint minimum = (guint) gtk_adjustment_get_lower (bar->priv->adjustment);
                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
gvc-stream-applet-icon.c:383:40: warning: cast from function call of type 'double' to non-matching type 'guint' (aka 'unsigned int') [-Wbad-function-cast]
        guint volume_percent = (guint) round (100.0 * volume / normal);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
raveit65 commented 2 years ago

Sorry, my live is changing. I am not sure that i can spend more of my spare time to review more PRs for MATE in future. Seeing more and more PRs in my mailbox decrease my motivation to work on this tsunami of PRs. It's time that that you get more responsibility and take the hat on. And please review PRs of 3'd party users. Good luck

rbuj commented 2 years ago

@raveit65 don't worry about it.

raveit65 commented 2 years ago

@raveit65 don't worry about it.

Don't worry for what? .... for the next tsunami of PRs which floats my mail box :) Better finish old PRs and check CI. I will give up to track down the long review queue.

rbuj commented 2 years ago

I have no plans to review code in the next few days, as I have been wanting to spend some of my free time playing video games, therefore there won't be a pr rain, at least mine ;-)

The ci fails on ubuntu due to libm: missing #include <math.h> in at least one source file, and there is a linkage issue related to libm, gcc and libtool.

At first glance, I saw that the math library is required for two calls to the round function. I think the quickest fix to address this issue is to get rid of the dependency in the math library and not use the round function.

raveit65 commented 2 years ago

have no plans to review code in the next few days, as I have been wanting to spend some of my free time playing video games, therefore there won't be a pr rain, at least mine ;-)

Omg, you're are are only a gamer :D Review your PR's for yourself , haha......

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. 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.

rbuj commented 2 years ago

other things need to be fixed first, therefore I close this merge request