Re: [PATCH] gstreamer-encoder: fix compiler warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 1, 2019 at 2:29 PM Frediano Ziglio <fziglio@xxxxxxxxxx> wrote:
>
> >
> > this warning is failing my build, I assume it comes from a new version
> > of the compiler catching the useless call to abs().
> >
>
> Yes, getting too with Fedora 30.
>
> Instead of "is failing my build" could you describe your environment?
> Like "Compiling with gcc 13.4 under Fedora 34 "...
>
> > ---
> >
> > > error: taking the absolute value of unsigned type 'uint64_t'
> > > {aka 'long unsigned int'} has no effect [-Werror=absolute-value]
>
> Why not putting this also in the commit message?

yes, this part was actually my commit message
I didn't know that the order matters, but it makes sense

I will add that it's Fedora 30 / gcc 9.1.1 20190503 (Red Hat 9.1.1-1)


> Looking the log for "Fedora" I found for instance
> https://gitlab.freedesktop.org/spice/spice/commit/f90f75e41c0cdb33b6b55cd4089db022540937e3
>
> > ---
> >  server/gstreamer-encoder.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
> > index 6416b688..dbd4b11d 100644
> > --- a/server/gstreamer-encoder.c
> > +++ b/server/gstreamer-encoder.c
> > @@ -515,7 +515,7 @@ static void set_video_bit_rate(SpiceGstEncoder *encoder,
> > uint64_t bit_rate)
> >          encoder->video_bit_rate = bit_rate;
> >          set_gstenc_bitrate(encoder);
> >
> > -    } else  if (abs(bit_rate - encoder->video_bit_rate) >
> > encoder->video_bit_rate * SPICE_GST_VIDEO_BITRATE_MARGIN) {
> > +    } else  if ((bit_rate - encoder->video_bit_rate) >
> > encoder->video_bit_rate * SPICE_GST_VIDEO_BITRATE_MARGIN) {
> >          encoder->video_bit_rate = bit_rate;
> >          set_pipeline_changes(encoder, SPICE_GST_VIDEO_PIPELINE_BITRATE);
> >      }
>
> Code is good
>
> Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]