summaryrefslogtreecommitdiff
path: root/src/modules/roto/roto.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/roto/roto.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/roto/roto.c')
-rw-r--r--src/modules/roto/roto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/roto/roto.c b/src/modules/roto/roto.c
index e859d94..e21b971 100644
--- a/src/modules/roto/roto.c
+++ b/src/modules/roto/roto.c
@@ -203,7 +203,7 @@ static void roto32_render_fragment(void *context, fb_fragment_t *fragment)
{
roto_context_t *ctxt = context;
int y_cos_r, y_sin_r, x_cos_r, x_sin_r, x_cos_r_init, x_sin_r_init, cos_r, sin_r;
- int x, y, stride = fragment->stride / 4, frame_width = fragment->frame_width, frame_height = fragment->frame_height;
+ int x, y, frame_width = fragment->frame_width, frame_height = fragment->frame_height;
uint32_t *buf = fragment->buf;
/* This is all done using fixed-point in the hopes of being faster, and yes assumptions
@@ -240,7 +240,7 @@ static void roto32_render_fragment(void *context, fb_fragment_t *fragment)
x_sin_r += sin_r;
}
- buf += stride;
+ buf = ((void *)buf) + fragment->stride;
y_cos_r += cos_r;
y_sin_r += sin_r;
}
@@ -253,7 +253,7 @@ static void roto64_render_fragment(void *context, fb_fragment_t *fragment)
{
roto_context_t *ctxt = context;
int y_cos_r, y_sin_r, x_cos_r, x_sin_r, x_cos_r_init, x_sin_r_init, cos_r, sin_r;
- int x, y, stride = fragment->stride / 8, frame_width = fragment->frame_width, frame_height = fragment->frame_height, width = fragment->width;
+ int x, y, frame_width = fragment->frame_width, frame_height = fragment->frame_height, width = fragment->width;
uint64_t *buf = (uint64_t *)fragment->buf;
/* This is all done using fixed-point in the hopes of being faster, and yes assumptions
@@ -301,7 +301,7 @@ static void roto64_render_fragment(void *context, fb_fragment_t *fragment)
x_sin_r += sin_r;
}
- buf += stride;
+ buf = ((void *)buf) + fragment->stride;
y_cos_r += cos_r;
y_sin_r += sin_r;
}
© All Rights Reserved