From fd4ff5984f0122ce2e457467b7c3e96509f32f31 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 7 Jun 2016 11:31:46 -0700 Subject: [PATCH] microcode/x11base.c (char_ptr_to_prop_data_32): Fix for 64bits. Thanks to Patric Jonsson . 32bit property data, though CARD32, is returned in an array of longs (64bit elements on 64bit machinery). --- src/microcode/x11base.c | 2 +- src/x11/x11base.scm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microcode/x11base.c b/src/microcode/x11base.c index d3f43a54b..427c2e189 100644 --- a/src/microcode/x11base.c +++ b/src/microcode/x11base.c @@ -2493,7 +2493,7 @@ char_ptr_to_prop_data_32 (const unsigned char * data, unsigned long nitems) SCHEME_OBJECT result = (allocate_marked_vector (TC_VECTOR, nitems, 1)); unsigned long index; for (index = 0; (index < nitems); index += 1) - VECTOR_SET (result, index, (ulong_to_integer (((CARD32 *) data) [index]))); + VECTOR_SET (result, index, (ulong_to_integer ((CARD32) ((long *) data) [index]))); return (result); } diff --git a/src/x11/x11base.scm b/src/x11/x11base.scm index a98d29a53..55b975c36 100644 --- a/src/x11/x11base.scm +++ b/src/x11/x11base.scm @@ -797,7 +797,7 @@ USA. (if (< index length) (begin (vector-set! result index (c-> scan "CARD32")) - (alien-byte-increment! scan (c-sizeof "CARD32")) + (alien-byte-increment! scan (c-sizeof "long")) (loop (1+ index))))) result)) -- 2.25.1