From 6261cfef6960b94705c2fd57fc6e6867e86fdcca Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Tue, 4 Mar 2014 09:02:54 -0800 Subject: [PATCH 1/2] Rust upgrade --- Makefile.in | 2 +- context.rs | 2 +- lib.rs | 13 +++++++------ platform/linux.rs | 4 ++-- platform/macos.rs | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 51691c6..75d43fc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,7 +9,7 @@ RUST_SRC=$(shell find $(VPATH)/. -type f -name '*.rs') all: libsharegl.dummy libsharegl.dummy: lib.rs $(RUST_SRC) - $(RUSTC) $(RUSTFLAGS) $< --lib --out-dir . + $(RUSTC) $(RUSTFLAGS) $< --crate-type=lib --out-dir . touch $@ sharegl-test: lib.rs $(RUST_SRC) diff --git a/context.rs b/context.rs index d1f620c..ffb83cf 100644 --- a/context.rs +++ b/context.rs @@ -9,7 +9,7 @@ //! A platform-independent interface to 3D graphics contexts. -use extra::arc::Arc; +use sync::Arc; /// Platform-independent interface to 3D graphics contexts. pub trait GraphicsContextMethods { diff --git a/lib.rs b/lib.rs index 2f0f0a8..f5a4147 100644 --- a/lib.rs +++ b/lib.rs @@ -9,16 +9,17 @@ #[crate_id = "github.com/mozilla-servo/sharegl#0.1"]; -extern mod std; -extern mod extra; -extern mod geom; +extern crate std; +extern crate sync; +extern crate extra; +extern crate geom; #[cfg(target_os="macos")] -extern mod core_foundation; +extern crate core_foundation; #[cfg(target_os="macos")] -extern mod io_surface; +extern crate io_surface; #[cfg(target_os="macos")] -extern mod opengles; +extern crate opengles; pub mod base; pub mod context; diff --git a/platform/linux.rs b/platform/linux.rs index 9733e48..5c1d2d0 100644 --- a/platform/linux.rs +++ b/platform/linux.rs @@ -12,7 +12,7 @@ use context::GraphicsContextMethods; use std::libc::{c_char, c_int, c_long, c_uint, c_ulong, c_void}; use std::ptr::null; use std::ptr; -use extra::arc::Arc; +use sync::Arc; // Constants. @@ -164,7 +164,7 @@ fn RootWindow(dpy: *Display, scr: c_int) -> Window { } fn ScreenOfDisplay(dpy: *Display, scr: c_int) -> *Screen { unsafe { - *ptr::offset(&(*dpy).screens, scr as int) + (&(*dpy).screens).offset(scr as int) } } diff --git a/platform/macos.rs b/platform/macos.rs index b059c28..c0be46e 100644 --- a/platform/macos.rs +++ b/platform/macos.rs @@ -10,7 +10,7 @@ use base::ShareContext; use context::GraphicsContextMethods; -use extra::arc::Arc; +use sync::Arc; use geom::size::Size2D; use io_surface::{IOSurface, kIOSurfaceBytesPerElement, kIOSurfaceBytesPerRow}; use io_surface::{kIOSurfaceHeight, kIOSurfaceIsGlobal, kIOSurfaceWidth}; From b19f248d8ef71f2c762ec41d8ed6b67cd330926c Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 14 Mar 2014 15:13:41 -0400 Subject: [PATCH 2/2] Warning police. --- platform/linux.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/linux.rs b/platform/linux.rs index 5c1d2d0..35a6724 100644 --- a/platform/linux.rs +++ b/platform/linux.rs @@ -11,15 +11,14 @@ use context::GraphicsContextMethods; use std::libc::{c_char, c_int, c_long, c_uint, c_ulong, c_void}; use std::ptr::null; -use std::ptr; use sync::Arc; // Constants. static GLX_RGBA: c_int = 4; -static GLX_RED_SIZE: c_int = 8; +/*static GLX_RED_SIZE: c_int = 8; static GLX_GREEN_SIZE: c_int = 9; -static GLX_BLUE_SIZE: c_int = 10; +static GLX_BLUE_SIZE: c_int = 10;*/ static GLX_DEPTH_SIZE: c_int = 12; static ATTRIBUTES: [c_int, ..4] = [