From 687e7aa9abf91f1bade59213a8b53f9bb4ec4186 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 May 2017 22:52:21 +0200 Subject: Fix errors from the latest commits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/blind-transpose.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/blind-transpose.c') diff --git a/src/blind-transpose.c b/src/blind-transpose.c index 750de02..3bbc6fb 100644 --- a/src/blind-transpose.c +++ b/src/blind-transpose.c @@ -4,11 +4,11 @@ USAGE("") -static size_t srcw, srch, srcwps, srchps, ps; +static size_t srcw, srch, srcwps, srchps, ps, n; #define PROCESS(TYPE)\ do {\ - size_t x, i, n = ps / sizeof(TYPE);\ + size_t x, i;\ char *src, *img;\ for (x = 0; x < srchps; x += ps) {\ img = row + x;\ @@ -43,9 +43,11 @@ main(int argc, char *argv[]) buf = emalloc(stream.frame_size); image = emalloc(srchps); + ps = stream.pixel_size; process = ps % sizeof(long) ? process_char : process_long; + n = ps / (ps % sizeof(long) ? sizeof(char) : sizeof(long)); while (eread_frame(&stream, buf)) { - for (y = 0; y < srcwps; y += ps) { + for (y = 0; y < srcwps; y += stream.pixel_size) { process(image, buf + y); ewriteall(STDOUT_FILENO, image, srchps, ""); } -- cgit v1.2.3-70-g09d2