Fix upstream build breaks by changing uses of reinterpret_cast to pass by reference.
This commit is contained in:
+4
-4
@@ -9,7 +9,7 @@ struct CFBoolean {
|
||||
|
||||
drop {
|
||||
unsafe {
|
||||
CFRelease(reinterpret_cast(self.obj));
|
||||
CFRelease(reinterpret_cast(&self.obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ mod CFBoolean {
|
||||
fn true_value() -> CFBoolean {
|
||||
unsafe {
|
||||
let obj = kCFBooleanTrue;
|
||||
CFRetain(reinterpret_cast(obj));
|
||||
CFRetain(reinterpret_cast(&obj));
|
||||
return wrap(obj);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ mod CFBoolean {
|
||||
fn false_value() -> CFBoolean {
|
||||
unsafe {
|
||||
let obj = kCFBooleanFalse;
|
||||
CFRetain(reinterpret_cast(obj));
|
||||
CFRetain(reinterpret_cast(&obj));
|
||||
return wrap(obj);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ mod CFBoolean {
|
||||
impl CFBoolean : AbstractCFType {
|
||||
pure fn as_type_ref(&self) -> CFTypeRef {
|
||||
unsafe {
|
||||
reinterpret_cast(self.obj)
|
||||
reinterpret_cast(&self.obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@ use dvec::DVec;
|
||||
use libc::c_void;
|
||||
use ptr::to_unsafe_ptr;
|
||||
use unsafe::reinterpret_cast;
|
||||
use vec::unsafe::to_ptr_slice;
|
||||
use vec::unsafe::to_ptr;
|
||||
|
||||
pub type CFDictionaryRetainCallBack = *u8;
|
||||
pub type CFDictionaryReleaseCallBack = *u8;
|
||||
@@ -36,7 +36,7 @@ struct CFDictionary<K:AbstractCFType,V:AbstractCFType> {
|
||||
|
||||
drop {
|
||||
unsafe {
|
||||
CFRelease(reinterpret_cast(self.obj));
|
||||
CFRelease(reinterpret_cast(&self.obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,8 +65,8 @@ mod CFDictionary {
|
||||
let dictionary_ref;
|
||||
unsafe {
|
||||
dictionary_ref = CFDictionaryCreate(kCFAllocatorDefault,
|
||||
reinterpret_cast(to_ptr_slice(keys)),
|
||||
reinterpret_cast(to_ptr_slice(values)),
|
||||
reinterpret_cast(&to_ptr(keys)),
|
||||
reinterpret_cast(&to_ptr(values)),
|
||||
keys.len() as CFIndex,
|
||||
to_unsafe_ptr(&kCFTypeDictionaryKeyCallBacks),
|
||||
to_unsafe_ptr(&kCFTypeDictionaryValueCallBacks));
|
||||
@@ -79,7 +79,7 @@ mod CFDictionary {
|
||||
impl<K:AbstractCFType,V:AbstractCFType> CFDictionary<K,V> : AbstractCFType {
|
||||
pure fn as_type_ref(&self) -> CFTypeRef {
|
||||
unsafe {
|
||||
reinterpret_cast(self.obj)
|
||||
reinterpret_cast(&self.obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ struct CFNumber {
|
||||
|
||||
drop {
|
||||
unsafe {
|
||||
CFRelease(reinterpret_cast(self.obj));
|
||||
CFRelease(reinterpret_cast(&self.obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ mod CFNumber {
|
||||
fn new_number<T:copy ConvertibleToCFNumber>(n: T) -> CFNumber {
|
||||
unsafe {
|
||||
CFNumber {
|
||||
obj: CFNumberCreate(kCFAllocatorDefault, n.cf_number_type(), reinterpret_cast(&n))
|
||||
obj: CFNumberCreate(kCFAllocatorDefault, n.cf_number_type(), reinterpret_cast(&&n))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ mod CFNumber {
|
||||
impl CFNumber : AbstractCFType {
|
||||
pure fn as_type_ref(&self) -> CFTypeRef {
|
||||
unsafe {
|
||||
reinterpret_cast(self.obj)
|
||||
reinterpret_cast(&self.obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ struct CFString {
|
||||
|
||||
drop {
|
||||
unsafe {
|
||||
CFRelease(reinterpret_cast(self.obj));
|
||||
CFRelease(reinterpret_cast(&self.obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ mod CFString {
|
||||
impl CFString : AbstractCFType {
|
||||
pure fn as_type_ref(&self) -> CFTypeRef {
|
||||
unsafe {
|
||||
reinterpret_cast(self.obj)
|
||||
reinterpret_cast(&self.obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user