Fix imports for C interop

* CString has moved to `std::ffi` and has a new interface.
* CVec has been removed entirely.
This commit is contained in:
Robert Straw
2015-01-07 07:57:33 -06:00
parent 1456d91ab9
commit a9302202cb
10 changed files with 11 additions and 14 deletions
+1 -3
View File
@@ -1,8 +1,7 @@
//! Audio Functions
use std::ptr;
use std::mem;
use std::c_str::{CString, ToCStr};
use std::c_vec::CVec;
use std::ffi::CString;
use std::borrow::ToOwned;
use std::num::FromPrimitive;
use libc;
@@ -237,7 +236,6 @@ impl<T: AudioFormatNum<T>, CB: AudioCallback<T>> AudioSpecDesired<T, CB> {
pub fn open_audio_device(self, device: Option<&str>, iscapture: bool) -> SdlResult<AudioDevice<CB>> {
use std::mem::uninitialized;
use std::ptr::null;
use std::c_str::CString;
use libc::c_char;
let mut userdata = AudioSpecDesired::callback_to_userdata(self.callback);
+2 -1
View File
@@ -1,6 +1,7 @@
use std::ffi::CString;
use SdlResult;
use get_error;
use std::c_str::ToCStr;
pub use sys::clipboard as ll;
+1 -2
View File
@@ -1,5 +1,4 @@
use std::c_str::ToCStr;
use std::ffi::CString;
use SdlResult;
use get_error;
+1 -1
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use std::ffi::CString;
use std::num::FromPrimitive;
use std::ptr;
use std::c_str::ToCStr;
use keycode::KeyCode;
use rect::Rect;
+1 -1
View File
@@ -1,5 +1,5 @@
use std::ffi::CString;
use std::ptr;
use std::c_str::ToCStr;
use video::Window;
use get_error;
-1
View File
@@ -12,7 +12,6 @@ use rect::Point;
use rect::Rect;
use std::num::FromPrimitive;
use std::vec::Vec;
use std::c_vec::CVec;
use std::borrow::ToOwned;
pub use sys::render as ll;
+2 -2
View File
@@ -1,6 +1,6 @@
use std::ffi::CString;
use std::io;
use std::io::IoResult;
use std::c_str::ToCStr;
use libc::{c_void, c_int, size_t};
use get_error;
use SdlResult;
@@ -20,7 +20,7 @@ impl_owned_accessors!(RWops, close_on_drop);
impl RWops {
pub fn from_file(path: &Path, mode: &str) -> SdlResult<RWops> {
let raw = unsafe {
ll::SDL_RWFromFile(path.to_c_str().into_inner(), mode.to_c_str().into_inner())
ll::SDL_RWFromFile(CString::from_slice(path), CString::from_slice(mode))
};
if raw.is_null() { Err(get_error()) }
else { Ok(RWops{raw: raw, close_on_drop: true}) }
+1 -1
View File
@@ -1,5 +1,5 @@
use std::c_str::{CString, ToCStr};
use std::borrow::ToOwned;
use std::ffi::CString;
use sys::sdl as ll;
+1 -1
View File
@@ -2,8 +2,8 @@
Querying SDL Version
*/
use std::ffi::CString;
use std::fmt;
use std::c_str::CString;
use std::borrow::ToOwned;
pub use sys::version as ll;
+1 -1
View File
@@ -1,7 +1,7 @@
use libc::{c_int, c_float, uint32_t};
use std::ffi::CString;
use std::ptr;
use std::vec::Vec;
use std::c_str::ToCStr;
use rect::Rect;
use surface::Surface;