From eec599791035474567e6976af64f3ef98f736ca2 Mon Sep 17 00:00:00 2001 From: Russell Johnston Date: Tue, 23 Dec 2014 14:26:42 -0700 Subject: [PATCH 1/2] Fix alignment of some unions --- src/xlib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xlib.rs b/src/xlib.rs index f3d549a..0966cc3 100644 --- a/src/xlib.rs +++ b/src/xlib.rs @@ -9,6 +9,7 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] +#![allow(missing_copy_implementations)] use libc::*; @@ -1087,13 +1088,15 @@ pub type XIOErrorHandler = *mut u8; pub type XConnectionWatchProc = *mut u8; -pub type union_unnamed3 = c_void /* FIXME: union type */; +/* FIXME: these are changed from c_void to force alignment */ -pub type union_unnamed5 = c_void /* FIXME: union type */; +pub type union_unnamed3 = *const c_void /* FIXME: union type */; -pub type union_unnamed2 = c_void /* FIXME: union type */; +pub type union_unnamed5 = *const c_void /* FIXME: union type */; -pub type union_unnamed4 = c_void /* FIXME: union type */; +pub type union_unnamed2 = c_long /* FIXME: union type */; + +pub type union_unnamed4 = *const c_void /* FIXME: union type */; #[repr(C)] pub struct struct_unnamed1 { From b61e6c5eee963d7eae7d6cb26f136b41d3a06774 Mon Sep 17 00:00:00 2001 From: Russell Johnston Date: Sat, 4 Apr 2015 22:10:58 -0600 Subject: [PATCH 2/2] Switch from raw pointers to usize --- src/xlib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/xlib.rs b/src/xlib.rs index 0966cc3..59d2206 100644 --- a/src/xlib.rs +++ b/src/xlib.rs @@ -1088,15 +1088,13 @@ pub type XIOErrorHandler = *mut u8; pub type XConnectionWatchProc = *mut u8; -/* FIXME: these are changed from c_void to force alignment */ +pub type union_unnamed3 = usize /* FIXME: union type */; -pub type union_unnamed3 = *const c_void /* FIXME: union type */; +pub type union_unnamed5 = usize /* FIXME: union type */; -pub type union_unnamed5 = *const c_void /* FIXME: union type */; +pub type union_unnamed2 = usize /* FIXME: union type */; -pub type union_unnamed2 = c_long /* FIXME: union type */; - -pub type union_unnamed4 = *const c_void /* FIXME: union type */; +pub type union_unnamed4 = usize /* FIXME: union type */; #[repr(C)] pub struct struct_unnamed1 {