|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From b4170aed36e667e52ce4a353bda1964e3872ab34 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Tue, 23 Sep 2014 13:38:09 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal: fix tile-offset calculation
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Binary operators with two pointers as arguments always operate on
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
object-size, not bytes. That is, "int *a, *b", (a - b) calculates the
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
number of integers between b and a, not the number of bytes.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Fix our cache-offset calculation to not use sizeof() with full-ptr
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
arithmetic.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/grdev.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index c5ea524c69..80a71beeb9 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/grdev.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -345,7 +345,7 @@ const grdev_display_target *grdev_display_next_target(grdev_display *display, co
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert(cache->pipe->tile->display == display);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert(display->pipes >= cache);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- idx = (cache - display->pipes) / sizeof(*cache) + 1;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ idx = cache - display->pipes + 1;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
} else {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
idx = 0;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|