From bc1d1b455be1504c255eefdccc3b2ec2a557e0b8 Mon Sep 17 00:00:00 2001 From: Martin Lindhe Date: Tue, 5 Dec 2017 00:44:01 +0100 Subject: [PATCH] fix some typos --- src/sdl2/audio.rs | 4 ++-- src/sdl2/controller.rs | 4 ++-- src/sdl2/event.rs | 2 +- src/sdl2/gfx/rotozoom.rs | 2 +- src/sdl2/image/mod.rs | 2 +- src/sdl2/joystick.rs | 14 +++++++------- src/sdl2/mixer/mod.rs | 2 +- src/sdl2/video.rs | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/sdl2/audio.rs b/src/sdl2/audio.rs index cfffc8ed..19d81a15 100644 --- a/src/sdl2/audio.rs +++ b/src/sdl2/audio.rs @@ -106,7 +106,7 @@ impl AudioSubsystem { pub fn num_audio_playback_devices(&self) -> Option { let result = unsafe { sys::SDL_GetNumAudioDevices(0) }; if result < 0 { - // SDL cannot retreive a list of audio devices. This is not necessarily an error (see the SDL2 docs). + // SDL cannot retrieve a list of audio devices. This is not necessarily an error (see the SDL2 docs). None } else { Some(result as u32) @@ -330,7 +330,7 @@ where Self::Channel: AudioFormatNum + 'static fn callback(&mut self, &mut [Self::Channel]); } -/// A phantom type for retreiving the `SDL_AudioFormat` of a given generic type. +/// A phantom type for retrieving the `SDL_AudioFormat` of a given generic type. /// All format types are returned as native-endian. pub trait AudioFormatNum { fn audio_format() -> AudioFormat; diff --git a/src/sdl2/controller.rs b/src/sdl2/controller.rs index e0179aa1..f3825762 100644 --- a/src/sdl2/controller.rs +++ b/src/sdl2/controller.rs @@ -45,7 +45,7 @@ impl error::Error for AddMappingError { } impl GameControllerSubsystem { - /// Retreive the total number of attached joysticks *and* controllers identified by SDL. + /// Retrieve the total number of attached joysticks *and* controllers identified by SDL. pub fn num_joysticks(&self) -> Result { let result = unsafe { sys::SDL_NumJoysticks() }; @@ -67,7 +67,7 @@ impl GameControllerSubsystem { /// Attempt to open the controller ad index `joystick_index` and return it. /// Controller IDs are the same as joystick IDs and the maximum number can - /// be retreived using the `SDL_NumJoysticks` function. + /// be retrieved using the `SDL_NumJoysticks` function. pub fn open(&self, joystick_index: u32) -> Result { use common::IntegerOrSdlError::*; let joystick_index = try!(validate_int(joystick_index, "joystick_index")); diff --git a/src/sdl2/event.rs b/src/sdl2/event.rs index f7ae5ae9..d613ceb7 100644 --- a/src/sdl2/event.rs +++ b/src/sdl2/event.rs @@ -1160,7 +1160,7 @@ impl Event { timestamp: timestamp, which: which, // This conversion turns an i32 into a u8; signed-to-unsigned conversions - // are a bit of a code smellx, but that appears to be how SDL defines it. + // are a bit of a code smell, but that appears to be how SDL defines it. button: buttonval as u8, state: sys::SDL_PRESSED as u8, padding1: 0, diff --git a/src/sdl2/gfx/rotozoom.rs b/src/sdl2/gfx/rotozoom.rs index 45d7221d..8ffe8d05 100644 --- a/src/sdl2/gfx/rotozoom.rs +++ b/src/sdl2/gfx/rotozoom.rs @@ -40,7 +40,7 @@ mod ll { pub trait RotozoomSurface { /// Rotates and zooms a surface and optional anti-aliasing. fn rotozoom(&self, angle: f64, zoom: f64, smooth: bool) -> Result; - /// Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing. + /// Rotates and zooms a surface with different horizontal and vertical scaling factors and optional anti-aliasing. fn rotozoom_xy(&self, angle: f64, zoomx: f64, zoomy: f64, smooth: bool) -> Result; /// Zoom a surface by independent horizontal and vertical factors with optional smoothing. fn zoom(&self, zoomx: f64, zoomy: f64, smooth: bool) -> Result; diff --git a/src/sdl2/image/mod.rs b/src/sdl2/image/mod.rs index 578a91f9..aa778146 100755 --- a/src/sdl2/image/mod.rs +++ b/src/sdl2/image/mod.rs @@ -172,7 +172,7 @@ impl LoadTexture for TextureCreator { } } -/// Context manager for `sdl2_image` to manage quiting. Can't do much with it but +/// Context manager for `sdl2_image` to manage quitting. Can't do much with it but /// keep it alive while you are using it. pub struct Sdl2ImageContext; diff --git a/src/sdl2/joystick.rs b/src/sdl2/joystick.rs index 7744845b..8557f556 100644 --- a/src/sdl2/joystick.rs +++ b/src/sdl2/joystick.rs @@ -9,7 +9,7 @@ use libc::c_char; use common::{validate_int, IntegerOrSdlError}; impl JoystickSubsystem { - /// Retreive the total number of attached joysticks *and* controllers identified by SDL. + /// Retrieve the total number of attached joysticks *and* controllers identified by SDL. pub fn num_joysticks(&self) -> Result { let result = unsafe { sys::SDL_NumJoysticks() }; @@ -125,7 +125,7 @@ impl Joystick { } } - /// Retreive the joystick's GUID + /// Retrieve the joystick's GUID pub fn guid(&self) -> Guid { let raw = unsafe { sys::SDL_JoystickGetGUID(self.raw) }; @@ -139,7 +139,7 @@ impl Joystick { } } - /// Retreive the number of axes for this joystick + /// Retrieve the number of axes for this joystick pub fn num_axes(&self) -> u32 { let result = unsafe { sys::SDL_JoystickNumAxes(self.raw) }; @@ -178,7 +178,7 @@ impl Joystick { } } - /// Retreive the number of buttons for this joystick + /// Retrieve the number of buttons for this joystick pub fn num_buttons(&self) -> u32 { let result = unsafe { sys::SDL_JoystickNumButtons(self.raw) }; @@ -219,7 +219,7 @@ impl Joystick { } } - /// Retreive the number of balls for this joystick + /// Retrieve the number of balls for this joystick pub fn num_balls(&self) -> u32 { let result = unsafe { sys::SDL_JoystickNumBalls(self.raw) }; @@ -248,7 +248,7 @@ impl Joystick { } } - /// Retreive the number of balls for this joystick + /// Retrieve the number of balls for this joystick pub fn num_hats(&self) -> u32 { let result = unsafe { sys::SDL_JoystickNumHats(self.raw) }; @@ -346,7 +346,7 @@ impl Guid { } // The buffer should always be NUL terminated (the - // documentation doesn't explicitely say it but I checked the + // documentation doesn't explicitly say it but I checked the // code) if c_str.is_null() { String::new() diff --git a/src/sdl2/mixer/mod.rs b/src/sdl2/mixer/mod.rs index 96ef2bb0..e7364da7 100644 --- a/src/sdl2/mixer/mod.rs +++ b/src/sdl2/mixer/mod.rs @@ -964,7 +964,7 @@ impl<'a> Music<'a> { pub fn unhook_finished() { unsafe { ffi::Mix_HookMusicFinished(None); - // unset from c, then rust, to avoid race condiction + // unset from c, then rust, to avoid race condition MUSIC_FINISHED_HOOK = None; } } diff --git a/src/sdl2/video.rs b/src/sdl2/video.rs index 2f849e4e..007ae294 100644 --- a/src/sdl2/video.rs +++ b/src/sdl2/video.rs @@ -40,7 +40,7 @@ impl<'a> DerefMut for WindowSurfaceRef<'a> { impl<'a> WindowSurfaceRef<'a> { /// Updates the change made to the inner Surface to the Window it was created from. /// - /// This would effectively be the theorical equivalent of `present` from a Canvas. + /// This would effectively be the theoretical equivalent of `present` from a Canvas. pub fn update_window(&self) -> Result<(), String> { unsafe { if sys::SDL_UpdateWindowSurface(self.1.context.raw) == 0 {