Skip to content

Commit 48d510a

Browse files
committed
Fix invalid msg_send!
1 parent 614d43a commit 48d510a

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

cocoa-foundation/src/foundation.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ impl NSProcessInfo for id {
249249
}
250250

251251
unsafe fn isOperatingSystemAtLeastVersion(self, version: NSOperatingSystemVersion) -> bool {
252-
msg_send![self, isOperatingSystemAtLeastVersion: version]
252+
let res: BOOL = msg_send![self, isOperatingSystemAtLeastVersion: version];
253+
res != NO
253254
}
254255
}
255256

@@ -628,9 +629,9 @@ impl NSString for id {
628629

629630
unsafe fn init_str(self, string: &str) -> id {
630631
return msg_send![self,
631-
initWithBytes:string.as_ptr()
632+
initWithBytes:string.as_ptr() as *const c_void
632633
length:string.len()
633-
encoding:UTF8_ENCODING as id];
634+
encoding:UTF8_ENCODING];
634635
}
635636

636637
unsafe fn len(self) -> usize {

cocoa/src/appkit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ impl NSOpenGLPixelFormat for id {
21082108
// Creating an NSOpenGLPixelFormat Object
21092109

21102110
unsafe fn initWithAttributes_(self, attributes: &[u32]) -> id {
2111-
msg_send![self, initWithAttributes:attributes]
2111+
msg_send![self, initWithAttributes:attributes.as_ptr()]
21122112
}
21132113

21142114
// Managing the Pixel Format

cocoa/src/quartzcore.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,13 +1096,13 @@ impl CALayer {
10961096
#[inline]
10971097
pub fn actions(&self) -> CFDictionary<CFStringRef, CFTypeRef> {
10981098
unsafe {
1099-
msg_send![self.id(), actions]
1099+
CFDictionary::wrap_under_get_rule(msg_send![self.id(), actions])
11001100
}
11011101
}
11021102

11031103
#[inline]
11041104
pub unsafe fn set_actions(&self, actions: CFDictionary<CFStringRef, CFTypeRef>) {
1105-
msg_send![self.id(), setActions:actions]
1105+
msg_send![self.id(), setActions: actions.as_concrete_TypeRef()]
11061106
}
11071107

11081108
// TODO(pcwalton): Wrap `CAAnimation`.
@@ -1531,6 +1531,7 @@ impl CARenderer {
15311531
// really just a module.
15321532
pub mod transaction {
15331533
use block::{Block, ConcreteBlock, IntoConcreteBlock, RcBlock};
1534+
use core_foundation::base::TCFType;
15341535
use core_foundation::date::CFTimeInterval;
15351536
use core_foundation::string::CFString;
15361537

@@ -1638,15 +1639,15 @@ pub mod transaction {
16381639
pub fn value_for_key(key: &str) -> id {
16391640
unsafe {
16401641
let key: CFString = CFString::from(key);
1641-
msg_send![class!(CATransaction), valueForKey:key]
1642+
msg_send![class!(CATransaction), valueForKey: key.as_concrete_TypeRef()]
16421643
}
16431644
}
16441645

16451646
#[inline]
16461647
pub fn set_value_for_key(value: id, key: &str) {
16471648
unsafe {
16481649
let key: CFString = CFString::from(key);
1649-
msg_send![class!(CATransaction), setValue:value forKey:key]
1650+
msg_send![class!(CATransaction), setValue: value forKey: key.as_concrete_TypeRef()]
16501651
}
16511652
}
16521653
}

core-text/src/font.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn new_from_name(name: &str, pt_size: f64) -> Result<CTFont, ()> {
193193
}
194194

195195
pub fn new_ui_font_for_language(ui_type: CTFontUIFontType,
196-
size: f64,
196+
size: CGFloat,
197197
language: Option<CFString>)
198198
-> CTFont {
199199
unsafe {

0 commit comments

Comments
 (0)