From 32ed86a976c585e238e9ccfcc642e4ac70a27710 Mon Sep 17 00:00:00 2001 From: Olaf Buddenhagen Date: Sun, 29 Nov 2015 21:53:35 +0100 Subject: Fix compilation for 32 bit targets Regression introduced in 47df0e9eaa7f1231a07f86fc44426936c7a2589a Casting fullscreen_atom (which is the result from XInternAtom, i.e. c_ulong) as i64 is obviously wrong -- the whole point of types such as c_ulong is that long in C does *not* always have the same bit size... Cast it as c_long instead. While this is the most straightforward fix, I'm not sure it's the best one: perhaps the x11 crate should offer a set_ulong() method along with set_long(), which could be used here instead of the cast? --- src/api/x11/window.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/api/x11/window.rs b/src/api/x11/window.rs index d82c5dd..507b202 100644 --- a/src/api/x11/window.rs +++ b/src/api/x11/window.rs @@ -8,6 +8,7 @@ use std::cell::Cell; use std::sync::atomic::AtomicBool; use std::collections::VecDeque; use std::sync::{Arc, Mutex}; +use std::os::raw::c_long; use Api; use ContextError; @@ -539,7 +540,7 @@ impl Window { // This first `long` is the action; `1` means add/set following property. data.set_long(0, 1); // This second `long` is the property to set (fullscreen) - data.set_long(1, fullscreen_atom as i64); + data.set_long(1, fullscreen_atom as c_long); data } }; -- cgit v1.2.3