diff options
author | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2018-07-19 02:28:25 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <ceffmpeg@gmail.com> | 2018-07-19 23:13:24 +0200 |
commit | 9cb3d8fcb7eb5b9b12a87ed27a2d7c4fc5416f85 (patch) | |
tree | 74990720ee42e53baa9ce63c1ab8f326ba0b6f47 | |
parent | b23c4a9dbd8ef7399ede9d2c02ccaf5a6b9c412c (diff) | |
download | ffmpeg-9cb3d8fcb7eb5b9b12a87ed27a2d7c4fc5416f85.tar.gz |
lavfi/af_afir,af_aiir: Remove a variable that is always -1.
Fixes two warnings:
libavfilter/af_afir.c:194:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1;
~~~~~~~~~~~~^~~~
libavfilter/af_aiir.c:689:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1;
~~~~~~~~~~~~^~~~
-rw-r--r-- | libavfilter/af_afir.c | 4 | ||||
-rw-r--r-- | libavfilter/af_aiir.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 75de14729d..a4a7160de1 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -191,7 +191,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint32_t color static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t color) { - int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; + int dx = FFABS(x1-x0); int dy = FFABS(y1-y0), sy = y0 < y1 ? 1 : -1; int err = (dx>dy ? dx : -dy) / 2, e2; @@ -205,7 +205,7 @@ static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t col if (e2 >-dx) { err -= dy; - x0 += sx; + x0--; } if (e2 < dy) { diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 65c8201137..9a4769c25f 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -686,7 +686,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint32_t color static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t color) { - int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; + int dx = FFABS(x1-x0); int dy = FFABS(y1-y0), sy = y0 < y1 ? 1 : -1; int err = (dx>dy ? dx : -dy) / 2, e2; @@ -700,7 +700,7 @@ static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t col if (e2 >-dx) { err -= dy; - x0 += sx; + x0--; } if (e2 < dy) { |