terminal: fix tile-offset calculation

Binary operators with two pointers as arguments always operate on
object-size, not bytes. That is, "int *a, *b", (a - b) calculates the
number of integers between b and a, not the number of bytes.

Fix our cache-offset calculation to not use sizeof() with full-ptr
arithmetic.
This commit is contained in:
David Herrmann 2014-09-23 13:38:09 +02:00
parent ce540a24d5
commit b4170aed36

View file

@ -345,7 +345,7 @@ const grdev_display_target *grdev_display_next_target(grdev_display *display, co
assert(cache->pipe->tile->display == display);
assert(display->pipes >= cache);
idx = (cache - display->pipes) / sizeof(*cache) + 1;
idx = cache - display->pipes + 1;
} else {
idx = 0;
}