From: Matt Birkholz Date: Tue, 7 Jun 2016 18:31:46 +0000 (-0700) Subject: microcode/x11base.c (char_ptr_to_prop_data_32): Fix for 64bits. X-Git-Tag: mit-scheme-pucked-9.2.12~261^2~32 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fd4ff5984f0122ce2e457467b7c3e96509f32f31;p=mit-scheme.git 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). --- 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))