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:
parent
ce540a24d5
commit
b4170aed36
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue