From 6b998b5ed066aeece1146fe245b35965319b3cbd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 May 2017 16:59:26 +0200 Subject: Cleaner code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-skip-pattern.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/blind-skip-pattern.c') diff --git a/src/blind-skip-pattern.c b/src/blind-skip-pattern.c index 914bed4..e8eee0b 100644 --- a/src/blind-skip-pattern.c +++ b/src/blind-skip-pattern.c @@ -2,20 +2,18 @@ #include "stream.h" #include "util.h" -#include #include -#include USAGE("(skipped-frames | +included-frames) ...") static int -process_frame(struct stream *stream, int include, size_t rown) +process_frame(struct stream *stream, int include) { size_t h, n, m; int anything = 0; for (h = stream->height; h; h--) { - for (n = rown; n; n -= m, anything = 1) { + for (n = stream->row_size; n; n -= m, anything = 1) { if (!stream->ptr && !eread_stream(stream, n)) goto done; m = MIN(stream->ptr, n); @@ -37,7 +35,7 @@ main(int argc, char *argv[]) { struct stream stream; int i, include; - size_t f, n, rown, total = 0; + size_t f, n, total = 0; char *includes; size_t *ns; @@ -64,16 +62,15 @@ main(int argc, char *argv[]) total += (size_t)include; } - echeck_frame_size(stream.width, 1, stream.pixel_size, 0, stream.file); - rown = stream.width * stream.pixel_size; stream.frames = total; + echeck_dimensions(&stream, WIDTH, NULL); fprint_stream_head(stdout, &stream); efflush(stdout, ""); for (i = 0;; i = (i + 1) % argc) { include = (int)includes[i]; for (n = ns[i]; n--;) - if (!process_frame(&stream, include, rown)) + if (!process_frame(&stream, include)) goto done; } -- cgit v1.2.3-70-g09d2