Fix upstream build breaks by changing uses of reinterpret_cast to pass by reference.

This commit is contained in:
Brian J. Burg
2012-09-04 18:08:59 -07:00
parent dfec7c491f
commit 94c7437779
4 changed files with 14 additions and 14 deletions
+4 -4
View File
@@ -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
View File
@@ -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)
}
}
}
+3 -3
View File
@@ -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)
}
}
}
+2 -2
View File
@@ -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)
}
}
}