blind

suckless command-line video editing utility
git clone git://git.suckless.org/blind
Log | Files | Refs | README | LICENSE

commit 221b3d2981d8ae15b73e925619ee7082bb23fc6f
parent 6990c64cf757d230800bacb489eb1db3fc790e3a
Author: Mattias Andrée <maandree@kth.se>
Date:   Fri, 20 Jan 2017 11:24:04 +0100

blind-extend: less brackets

Signed-off-by: Mattias Andrée <maandree@kth.se>

Diffstat:
MTODO | 1-
Msrc/blind-extend.c | 10+++++-----
2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/TODO b/TODO @@ -14,5 +14,4 @@ Add [-j jobs] to blind-from-video and blind-to-video. UNTESTED: blind-cut - blind-extend blind-rewrite-head diff --git a/src/blind-extend.c b/src/blind-extend.c @@ -77,8 +77,8 @@ main(int argc, char *argv[]) right *= stream.pixel_size; rown = stream.width * stream.pixel_size; - xoff = (rown - (left % rown)) % rown; - yoff = (stream.height - (top % stream.height)) % stream.height; + xoff = (rown - left % rown) % rown; + yoff = (stream.height - top % stream.height) % stream.height; memcpy(buf, stream.buf, ptr = stream.ptr); while (eread_frame(&stream, buf, n)) { @@ -88,11 +88,11 @@ main(int argc, char *argv[]) } else { for (y = 0; y < stream.height; y++) for (x = 0; x < imgw; x++) - image[x + (y + top) * imgw] = buf[((x + xoff) % rown) + y * rown]; + image[x + (y + top) * imgw] = buf[(x + xoff) % rown + y * rown]; for (y = 0; y < top; y++) - memcpy(image + y * imgw, image + (((y + yoff) % stream.height) + top) * imgw, imgw); + memcpy(image + y * imgw, image + ((y + yoff) % stream.height + top) * imgw, imgw); for (y = top + stream.height; y < h; y++) - memcpy(image + y * imgw, image + (((y + yoff) % stream.height) + top) * imgw, imgw); + memcpy(image + y * imgw, image + ((y + yoff) % stream.height + top) * imgw, imgw); } ewriteall(STDOUT_FILENO, image, m, "<stdout>"); }