Re: [FFmpeg-devel] [PATCH]lavc/xface: Reorder conditions to silence a gcc warning

2017-03-24 Thread Ronald S. Bultje
Hi,

On Fri, Mar 24, 2017 at 3:53 PM, Carl Eugen Hoyos 
wrote:

> 2017-02-26 11:07 GMT+01:00 Carl Eugen Hoyos :
>
> > I believe attached patch does not change the logic of the conditions
> > but silences a (9 times shown, long-time) gcc warning.
>
> Patch applied.


> -if (l >= i && m == j)
> +if (l <= 0 || l >= i && m == j)
>  continue;

Doesn't the compiler complain about mixing || and && without brackets? Some
compilers do, at least, I'd recommend to use an extra set of brackets to
prevent that...

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/xface: Reorder conditions to silence a gcc warning

2017-03-24 Thread Carl Eugen Hoyos
2017-02-26 11:07 GMT+01:00 Carl Eugen Hoyos :

> I believe attached patch does not change the logic of the conditions
> but silences a (9 times shown, long-time) gcc warning.

Patch applied.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/xface: Reorder conditions to silence a gcc warning

2017-03-07 Thread Carl Eugen Hoyos
2017-02-26 11:07 GMT+01:00 Carl Eugen Hoyos :

> I believe attached patch does not change the logic of the conditions
> but silences a (9 times shown, long-time) gcc warning.

Ping.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH]lavc/xface: Reorder conditions to silence a gcc warning

2017-02-26 Thread Carl Eugen Hoyos
Hi!

I believe attached patch does not change the logic of the conditions 
but silences a (9 times shown, long-time) gcc warning.

Please review, Carl Eugen
From 2a634f0b1f265f96111895de8603f9deda91d3df Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Sun, 26 Feb 2017 11:03:50 +0100
Subject: [PATCH] lavc/xface: Reorder conditions to silence a gcc warning.

libavcodec/xface.c:318:27: warning: assuming signed overflow does not occur 
when assuming that (X - c) > X is always false [-Wstrict-overflow]
---
 libavcodec/xface.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/xface.c b/libavcodec/xface.c
index 8c0cbfd..184c174 100644
--- a/libavcodec/xface.c
+++ b/libavcodec/xface.c
@@ -315,9 +315,9 @@ void ff_xface_generate_face(uint8_t *dst, uint8_t * const 
src)
 
 for (l = i - 2; l <= i + 2; l++) {
 for (m = j - 2; m <= j; m++) {
-if (l >= i && m == j)
+if (l <= 0 || l >= i && m == j)
 continue;
-if (l > 0 && l <= XFACE_WIDTH && m > 0)
+if (l <= XFACE_WIDTH && m > 0)
 k = 2*k + src[l + m * XFACE_WIDTH];
 }
 }
-- 
1.7.10.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel