From 337440d4a0f141c036e057ecc4fe4f4b808ff9c0 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 15 Sep 2017 19:52:49 -0700 Subject: modules/*: cease dividing stride by 4 Just cast buf to (void *) for the pointer arithmetic, stride is in units of bytes and no assumptions should be made about its value such as divisability by 4. --- src/modules/julia/julia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/julia') diff --git a/src/modules/julia/julia.c b/src/modules/julia/julia.c index ea97a77..a83fe00 100644 --- a/src/modules/julia/julia.c +++ b/src/modules/julia/julia.c @@ -133,7 +133,7 @@ static void julia_render_fragment(void *context, fb_fragment_t *fragment) { julia_context_t *ctxt = context; unsigned x, y; - unsigned stride = fragment->stride / 4, width = fragment->width, height = fragment->height; + unsigned width = fragment->width, height = fragment->height; uint32_t *buf = fragment->buf; float real, imag; float realstep = 3.6f / (float)fragment->frame_width, imagstep = 3.6f / (float)fragment->frame_height; @@ -145,7 +145,7 @@ static void julia_render_fragment(void *context, fb_fragment_t *fragment) *buf = colors[julia_iter(real, imag, ctxt->creal, ctxt->cimag, sizeof(colors) / sizeof(*colors))]; } - buf += stride; + buf = ((void *)buf) + fragment->stride; } } -- cgit v1.2.1