From 7d71796ef24101422e17a4704b4a8389dd718ea3 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 6 Sep 2013 17:39:05 -0700 Subject: [PATCH] Fix bool casts --- dictionary.rs | 4 ++-- number.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dictionary.rs b/dictionary.rs index a0b98af..bbe8fa8 100644 --- a/dictionary.rs +++ b/dictionary.rs @@ -127,7 +127,7 @@ impl(key.as_type_ref())) - as bool + != 0 } } @@ -138,7 +138,7 @@ impl(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. diff --git a/number.rs b/number.rs index 1d2ad67..f07dba3 100644 --- a/number.rs +++ b/number.rs @@ -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 } }