summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2010-09-27 14:12:50 -0400
committerDana Jansens <danakj@orodu.net>2011-01-24 14:19:22 -0500
commit6e5de3b57eb1b39c2c3bd170c2dfca205d4a49ff (patch)
treee1b5ed26fe4679777e19f610366d73c59efb0bda
parenta8843b58c59f7042aa78289c3fc323793e16100f (diff)
Fix icons.c test for 64-bit platforms
-rw-r--r--tests/icons.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/icons.c b/tests/icons.c
index af13e0b5..e2477c25 100644
--- a/tests/icons.c
+++ b/tests/icons.c
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
Pixmap p;
Cursor cur;
XEvent ev;
+ unsigned int bs = sizeof(long);
printf("Click on a window with an icon...\n");
@@ -132,10 +133,10 @@ int main(int argc, char **argv)
i[image]->byte_order = LSBFirst;
i[image]->data = (char*)prop_return[image];
for (j = 0; j < w*h; j++) {
- unsigned char alpha = (unsigned char)i[image]->data[j*4+3];
- unsigned char r = (unsigned char) i[image]->data[j*4+0];
- unsigned char g = (unsigned char) i[image]->data[j*4+1];
- unsigned char b = (unsigned char) i[image]->data[j*4+2];
+ unsigned char alpha = (unsigned char)i[image]->data[j*bs+3];
+ unsigned char r = (unsigned char) i[image]->data[j*bs+0];
+ unsigned char g = (unsigned char) i[image]->data[j*bs+1];
+ unsigned char b = (unsigned char) i[image]->data[j*bs+2];
// background color
unsigned char bgr = 0;