diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-03-28 20:27:05 +0100 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-03-28 20:27:05 +0100 |
commit | 1557cd227fab9adb66bc3e3bf6849ee6174fafd4 (patch) | |
tree | 09f4ffd111d0aa8a86bad3e7e0e0adcf29fff367 | |
parent | d7c44b95b04fa3ea25a5e5943148583c862ab025 (diff) | |
parent | 0ef63cd9d384cc8ec993959a3a296a9cc3d5815f (diff) | |
download | glutin-1557cd227fab9adb66bc3e3bf6849ee6174fafd4.tar.gz glutin-1557cd227fab9adb66bc3e3bf6849ee6174fafd4.zip |
Merge pull request #330 from SSheldon/objc_ret
Audit msg_send return types
-rw-r--r-- | src/cocoa/mod.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cocoa/mod.rs b/src/cocoa/mod.rs index 5859591..a30465e 100644 --- a/src/cocoa/mod.rs +++ b/src/cocoa/mod.rs @@ -81,7 +81,7 @@ impl WindowDelegate { let state: *mut libc::c_void = *this.get_ivar("glutinState"); let state = &mut *(state as *mut DelegateState); - let _: id = msg_send![*state.context, update]; + let _: () = msg_send![*state.context, update]; if let Some(handler) = state.handler { let rect = NSView::frame(*state.view); @@ -120,7 +120,7 @@ impl WindowDelegate { fn new(window: id) -> WindowDelegate { unsafe { let delegate: id = msg_send![WindowDelegate::class(), new]; - let _: id = msg_send![window, setDelegate:delegate]; + let _: () = msg_send![window, setDelegate:delegate]; WindowDelegate { this: delegate } } } @@ -393,7 +393,7 @@ impl Window { let device_description = NSScreen::deviceDescription(screen); let value = msg_send![device_description, objectForKey:*key]; if value != nil { - let screen_number: NSUInteger = msg_send![value, unsignedIntValue]; + let screen_number: NSUInteger = msg_send![value, unsignedIntegerValue]; if screen_number as u32 == native_id { matching_screen = Some(screen); break; @@ -574,7 +574,7 @@ impl Window { } pub unsafe fn make_current(&self) { - let _: id = msg_send![*self.context, update]; + let _: () = msg_send![*self.context, update]; self.context.makeCurrentContext(); } @@ -582,8 +582,8 @@ impl Window { unsafe { let current = NSOpenGLContext::currentContext(nil); if current != nil { - let is_equal: bool = msg_send![current, isEqual:*self.context]; - is_equal + let is_equal: BOOL = msg_send![current, isEqual:*self.context]; + is_equal != NO } else { false } @@ -657,7 +657,7 @@ impl Window { unsafe { use objc::MessageArguments; let cursor: id = ().send(cls as *const _ as id, sel); - let _: id = msg_send![cursor, set]; + let _: () = msg_send![cursor, set]; } } @@ -685,7 +685,7 @@ impl IdRef { fn retain(i: id) -> IdRef { if i != nil { - unsafe { msg_send![i, retain] } + let _: id = unsafe { msg_send![i, retain] }; } IdRef(i) } @@ -698,7 +698,7 @@ impl IdRef { impl Drop for IdRef { fn drop(&mut self) { if self.0 != nil { - unsafe { msg_send![self.0, release] } + let _: () = unsafe { msg_send![self.0, release] }; } } } @@ -713,17 +713,17 @@ impl Deref for IdRef { impl Clone for IdRef { fn clone(&self) -> IdRef { if self.0 != nil { - unsafe { msg_send![self.0, retain] } + let _: id = unsafe { msg_send![self.0, retain] }; } IdRef(self.0) } fn clone_from(&mut self, source: &IdRef) { if source.0 != nil { - unsafe { msg_send![source.0, retain] } + let _: id = unsafe { msg_send![source.0, retain] }; } if self.0 != nil { - unsafe { msg_send![self.0, release] } + let _: () = unsafe { msg_send![self.0, release] }; } self.0 = source.0; } |