Skip to content

Commit

Permalink
Merge pull request #57 from NotKild/master
Browse files Browse the repository at this point in the history
Fix building issues with rust version >= 1.6
  • Loading branch information
xsleonard committed Jan 7, 2016
2 parents ef4be16 + 06784e6 commit fe4ce58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sdl2_image/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<'a> LoadSurface for Surface<'a> {
fn from_file(filename: &Path) -> SdlResult<Surface<'a>> {
//! Loads an SDL Surface from a file
unsafe {
let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8);
let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
if (raw as *mut ()).is_null() {
Err(get_error())
} else {
Expand All @@ -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() as *const i8);
let status = ffi::IMG_SavePNG(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
if status != 0 {
Err(get_error())
} else {
Expand Down Expand Up @@ -128,7 +128,7 @@ impl<'a> LoadTexture for Renderer<'a> {
fn load_texture(&self, filename: &Path) -> SdlResult<Texture> {
//! Loads an SDL Texture from a file
unsafe {
let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8);
let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
if (raw as *mut ()).is_null() {
Err(get_error())
} else {
Expand Down Expand Up @@ -215,7 +215,7 @@ impl<'a> ImageRWops for RWops<'a> {
}
fn load_typed(&self, _type: &str) -> SdlResult<Surface> {
let raw = unsafe {
ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr() as *const i8)
ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr() as *const _)
};
to_surface_result(raw)
}
Expand Down

0 comments on commit fe4ce58

Please sign in to comment.