Skip to content

Commit fe4ce58

Browse files
committed
Merge pull request #57 from NotKild/master
Fix building issues with rust version >= 1.6
2 parents ef4be16 + 06784e6 commit fe4ce58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sdl2_image/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'a> LoadSurface for Surface<'a> {
7070
fn from_file(filename: &Path) -> SdlResult<Surface<'a>> {
7171
//! Loads an SDL Surface from a file
7272
unsafe {
73-
let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8);
73+
let raw = ffi::IMG_Load(CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
7474
if (raw as *mut ()).is_null() {
7575
Err(get_error())
7676
} else {
@@ -96,7 +96,7 @@ impl<'a> SaveSurface for Surface<'a> {
9696
fn save(&self, filename: &Path) -> SdlResult<()> {
9797
//! Saves an SDL Surface to a file
9898
unsafe {
99-
let status = ffi::IMG_SavePNG(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8);
99+
let status = ffi::IMG_SavePNG(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
100100
if status != 0 {
101101
Err(get_error())
102102
} else {
@@ -128,7 +128,7 @@ impl<'a> LoadTexture for Renderer<'a> {
128128
fn load_texture(&self, filename: &Path) -> SdlResult<Texture> {
129129
//! Loads an SDL Texture from a file
130130
unsafe {
131-
let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const i8);
131+
let raw = ffi::IMG_LoadTexture(self.raw(), CString::new(filename.to_str().unwrap()).unwrap().as_ptr() as *const _);
132132
if (raw as *mut ()).is_null() {
133133
Err(get_error())
134134
} else {
@@ -215,7 +215,7 @@ impl<'a> ImageRWops for RWops<'a> {
215215
}
216216
fn load_typed(&self, _type: &str) -> SdlResult<Surface> {
217217
let raw = unsafe {
218-
ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr() as *const i8)
218+
ffi::IMG_LoadTyped_RW(self.raw(), 0, CString::new(_type.as_bytes()).unwrap().as_ptr() as *const _)
219219
};
220220
to_surface_result(raw)
221221
}

0 commit comments

Comments
 (0)