summaryrefslogtreecommitdiff
path: root/src/modules/julia/julia.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-09-15 19:52:49 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-09-15 19:52:49 -0700
commit337440d4a0f141c036e057ecc4fe4f4b808ff9c0 (patch)
tree10c4050ad018832eca5060ef479a1abe9fc16048 /src/modules/julia/julia.c
parent37edf85c87a8a71eb00c205d8c97eebd6c8dcd25 (diff)
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.
Diffstat (limited to 'src/modules/julia/julia.c')
-rw-r--r--src/modules/julia/julia.c4
1 files changed, 2 insertions, 2 deletions
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;
}
}
© All Rights Reserved