Merge pull request #19 from brson/master

Fix bool casts
This commit is contained in:
Brian Anderson
2013-09-06 17:00:18 -07:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ impl<KeyRefType: Clone + AbstractCFTypeRef, ValueRefType: Clone + AbstractCFType
unsafe {
CFDictionaryContainsKey(self.contents.obj,
cast::transmute::<CFTypeRef, *c_void>(key.as_type_ref()))
as bool
!= 0
}
}
@@ -138,7 +138,7 @@ impl<KeyRefType: Clone + AbstractCFTypeRef, ValueRefType: Clone + AbstractCFType
let did_find_value = CFDictionaryGetValueIfPresent(
self.contents.obj,
cast::transmute::<CFTypeRef, *c_void>(key.as_type_ref()),
cast::transmute::<&*c_void, **c_void>(&value)) as bool;
cast::transmute::<&*c_void, **c_void>(&value)) != 0;
// FIXME: this will not handle non-CF dictionary entries
// or ptr::null() values correctly.
+1 -1
View File
@@ -150,7 +150,7 @@ impl CFNumber {
#[fixed_stack_segment]
fn has_float_type(&self) -> bool {
unsafe {
CFNumberIsFloatType(self.contents.obj) as bool
CFNumberIsFloatType(self.contents.obj) != 0
}
}