Bug 999717 - Fix gcc -Wlogical-op warning in js. r=mrbkap
authorChris Peterson <cpeterson@mozilla.com>
Tue, 22 Apr 2014 14:42:27 -0700
changeset 198177 797a9917b70637e1ca252b4cc12ae25edc1b9d00
parent 198176 6f96b1e4ed40cb81d8a935bb9e38ab3af218c986
child 198178 5544ddbd65815ecd27037a710869bc6027010984
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs999717
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 999717 - Fix gcc -Wlogical-op warning in js. r=mrbkap
js/xpconnect/src/XPCConvert.cpp
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -131,24 +131,18 @@ XPCConvert::NativeData2JS(MutableHandleV
         return true;
     case nsXPTType::T_FLOAT :
         d.setNumber(*static_cast<const float*>(s));
         return true;
     case nsXPTType::T_DOUBLE:
         d.setNumber(*static_cast<const double*>(s));
         return true;
     case nsXPTType::T_BOOL  :
-    {
-        bool b = *static_cast<const bool*>(s);
-
-        NS_WARN_IF_FALSE(b == 1 || b == 0,
-                         "Passing a malformed bool through XPConnect");
-        d.setBoolean(b);
+        d.setBoolean(*static_cast<const bool*>(s));
         return true;
-    }
     case nsXPTType::T_CHAR  :
     {
         char p = *static_cast<const char*>(s);
 
 #ifdef STRICT_CHECK_OF_UNICODE
         MOZ_ASSERT(! ILLEGAL_CHAR_RANGE(p) , "passing non ASCII data");
 #endif // STRICT_CHECK_OF_UNICODE