Fixed incorrectly merged files

This commit is contained in:
Vladimir Matveev
2014-05-26 20:03:26 +04:00
parent 9325869492
commit 977845acfd
4 changed files with 8 additions and 6 deletions
+2 -2
View File
@@ -228,7 +228,7 @@ impl<'a> AudioSpec<'a> {
pub fn load_wav_rw(src: &RWops) -> SdlResult<(AudioSpec, CVec<u8>)> {
assert_eq!(mem::size_of::<AudioSpec>(), mem::size_of::<ll::SDL_AudioSpec>());
let mut spec = unsafe { mem::uninit::<AudioSpec>() };
let mut spec = unsafe { mem::uninitialized::<AudioSpec>() };
let audio_buf = ptr::null::<u8>();
let audio_len = 0u32;
unsafe {
@@ -264,7 +264,7 @@ impl AudioDevice {
pub fn open(device: Option<&str>, iscapture: int, spec: &AudioSpec) -> SdlResult<(AudioDevice, AudioSpec)> {
//! SDL_OpenAudioDevice
let obtained = unsafe { mem::uninit::<AudioSpec>() };
let obtained = unsafe { mem::uninitialized::<AudioSpec>() };
unsafe {
let device_c_str = match device {
None => ptr::null(),
+3 -3
View File
@@ -564,9 +564,9 @@ pub enum Event {
KeyDownEvent(uint, video::Window, KeyCode, ScanCode, Mod),
KeyUpEvent(uint, video::Window, KeyCode, ScanCode, Mod),
/// (timestamp, window, text, start, length)
TextEditingEvent(uint, video::Window, ~str, int, int),
TextEditingEvent(uint, video::Window, String, int, int),
/// (timestamp, window, text)
TextInputEvent(uint, video::Window, ~str),
TextInputEvent(uint, video::Window, String),
/// (timestamp, window, which, [MouseState], x, y, xrel, yrel)
MouseMotionEvent(uint, video::Window, uint, MouseState, int, int,
@@ -615,7 +615,7 @@ pub enum Event {
ClipboardUpdateEvent(uint),
/// (timestamp, filename)
DropFileEvent(uint, ~str),
DropFileEvent(uint, String),
/// (timestamp, Window, type, code)
UserEvent(uint, video::Window, uint, int),
+1 -1
View File
@@ -498,7 +498,7 @@ impl<S> Renderer<S> {
else { Err(get_error()) }
}
pub fn fill_rect(&self, rect: &Rect) -> Result<(), ~str> {
pub fn fill_rect(&self, rect: &Rect) -> Result<(), String> {
let ret = unsafe { ll::SDL_RenderFillRect(self.raw, rect) };
if ret == 0 { Ok(()) }
+2
View File
@@ -83,6 +83,8 @@ pub enum Error {
UnsupportedError = ll::SDL_UNSUPPORTED as int
}
pub type SdlResult<T> = Result<T, String>;
pub fn init(flags: InitFlag) -> bool {
unsafe {
ll::SDL_Init(flags.bits()) == 0