From fb7481585da8b9422f2f0dd23297f0fb6f42edf1 Mon Sep 17 00:00:00 2001 From: notkild Date: Mon, 4 Jan 2016 19:10:23 +0100 Subject: [PATCH] Fix variable type issue with Rust 1.6 --- src/sdl2_image/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl2_image/lib.rs b/src/sdl2_image/lib.rs index 6fd05f0..b8292e7 100755 --- a/src/sdl2_image/lib.rs +++ b/src/sdl2_image/lib.rs @@ -70,7 +70,7 @@ impl<'a> LoadSurface for Surface<'a> { fn from_file(filename: &Path) -> SdlResult> { //! Loads an SDL Surface from a file unsafe { - let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr()); + let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8); if (raw as *mut ()).is_null() { Err(get_error()) } else { @@ -96,7 +96,7 @@ impl<'a> SaveSurface for Surface<'a> { fn save(&self, filename: &Path) -> SdlResult<()> { //! Saves an SDL Surface to a file unsafe { - let status = ffi::IMG_SavePNG(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr()); + let status = ffi::IMG_SavePNG(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8); if status != 0 { Err(get_error()) } else { @@ -128,7 +128,7 @@ impl<'a> LoadTexture for Renderer<'a> { fn load_texture(&self, filename: &Path) -> SdlResult { //! Loads an SDL Texture from a file unsafe { - let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr()); + let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8); if (raw as *mut ()).is_null() { Err(get_error()) } else { @@ -215,7 +215,7 @@ impl<'a> ImageRWops for RWops<'a> { } fn load_typed(&self, _type: &str) -> SdlResult { let raw = unsafe { - ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr()) + ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr() as *const i8) }; to_surface_result(raw) }