diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-03-01 13:18:36 +0100 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-03-01 13:18:36 +0100 |
commit | 65d5589e3ccfa4d6425d16a7df186dde9d9ed861 (patch) | |
tree | badbb288768ebe225f413b839f8bb63f9d864ce5 /src | |
parent | 36619ee40ebc1a22ec8979b34a5aca27b0cf8975 (diff) | |
download | glutin-65d5589e3ccfa4d6425d16a7df186dde9d9ed861.tar.gz glutin-65d5589e3ccfa4d6425d16a7df186dde9d9ed861.zip |
Fix various warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/win32/init.rs | 5 | ||||
-rw-r--r-- | src/win32/mod.rs | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/win32/init.rs b/src/win32/init.rs index 13da111..23bb364 100644 --- a/src/win32/init.rs +++ b/src/win32/init.rs @@ -2,6 +2,7 @@ use std::sync::atomic::AtomicBool; use std::ptr; use std::mem; use std::os; +use std::thread; use super::callback; use super::Window; use super::MonitorID; @@ -39,7 +40,7 @@ pub fn new_window(builder: BuilderAttribs<'static>, builder_sharelists: Option<C // GetMessage must be called in the same thread as CreateWindow, // so we create a new thread dedicated to this window. // This is the only safe method. Using `nosend` wouldn't work for non-native runtime. - ::std::thread::Thread::spawn(move || { + thread::spawn(move || { unsafe { // sending match init(title, builder, builder_sharelists) { @@ -151,7 +152,7 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>, let extra_functions = gl::wgl_extra::Wgl::load_with(|addr| { use libc; - let addr = CString::from_slice(addr.as_bytes()); + let addr = CString::new(addr.as_bytes()).unwrap(); let addr = addr.as_ptr(); gl::wgl::GetProcAddress(addr) as *const libc::c_void diff --git a/src/win32/mod.rs b/src/win32/mod.rs index 4846d59..5af2691 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -191,7 +191,7 @@ impl Window { /// See the docs in the crate root file. pub fn get_proc_address(&self, addr: &str) -> *const () { - let addr = CString::from_slice(addr.as_bytes()); + let addr = CString::new(addr.as_bytes()).unwrap(); let addr = addr.as_ptr(); unsafe { @@ -224,7 +224,7 @@ impl Window { pub fn set_window_resize_callback(&mut self, _: Option<fn(u32, u32)>) { } - pub fn set_cursor(&self, cursor: MouseCursor) { + pub fn set_cursor(&self, _cursor: MouseCursor) { unimplemented!() } @@ -280,7 +280,6 @@ impl<'a> Iterator for WaitEventsIterator<'a> { #[unsafe_destructor] impl Drop for Window { fn drop(&mut self) { - use std::ptr; // we don't call MakeCurrent(0, 0) because we are not sure that the context // is still the current one unsafe { user32::PostMessageW(self.window, winapi::WM_DESTROY, 0, 0); } |