bug 453892: fix prbool bugs in xpconnect. r=jorendorff
authorTaras Glek <tglek@mozilla.com>
Mon, 08 Sep 2008 11:19:58 -0700
changeset 18991 41a61ce08b266e8abb85e7e7cef3af1f71669150
parent 18990 f574044a8f493e67f2629e10a03926447ecdc38d
child 18992 56a46aed3502f35598ec9ed030327954ba269cd7
push id1887
push usertglek@mozilla.com
push dateMon, 08 Sep 2008 18:20:03 +0000
treeherderautoland@41a61ce08b26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs453892
milestone1.9.1b1pre
bug 453892: fix prbool bugs in xpconnect. r=jorendorff
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcwrappednative.cpp
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -1891,17 +1891,17 @@ public:
     GetSecurityInfoAddr() {return &mSecurityInfo;}
 
     JSUint32
     GetClassInfoFlags() const {return mClassInfoFlags;}
 
 #ifdef GET_IT
 #undef GET_IT
 #endif
-#define GET_IT(f_) const {return (JSBool)(mClassInfoFlags & nsIClassInfo:: f_ );}
+#define GET_IT(f_) const {return !!(mClassInfoFlags & nsIClassInfo:: f_ );}
 
     JSBool ClassIsSingleton()           GET_IT(SINGLETON)
     JSBool ClassIsThreadSafe()          GET_IT(THREADSAFE)
     JSBool ClassIsMainThreadOnly()      GET_IT(MAIN_THREAD_ONLY)
     JSBool ClassIsDOMObject()           GET_IT(DOM_OBJECT)
     JSBool ClassIsPluginObject()        GET_IT(PLUGIN_OBJECT)
 
 #undef GET_IT
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -2887,17 +2887,17 @@ XPCWrappedNative::HandlePossibleNameCase
        nsCRT::IsUpper((char)oldStr[0]) &&
        nsnull != (newStr = nsCRT::strdup(oldStr)))
     {
         newStr[0] = (PRUnichar) nsCRT::ToLower((char)newStr[0]);
         newJSStr = JS_NewUCStringCopyZ(ccx, (const jschar*)newStr);
         nsCRT::free(newStr);
         if(newJSStr && (set ?
              set->FindMember(STRING_TO_JSVAL(newJSStr), &member, &localIface) :
-                        (JSBool)NS_PTR_TO_INT32(iface->FindMember(STRING_TO_JSVAL(newJSStr)))))
+                        NS_PTR_TO_INT32(iface->FindMember(STRING_TO_JSVAL(newJSStr)))))
         {
             // found it!
             const char* ifaceName = set ?
                     localIface->GetNameString() :
                     iface->GetNameString();
             const char* goodName = JS_GetStringBytes(newJSStr);
             const char* badName = JS_GetStringBytes(oldJSStr);
             char* locationStr = nsnull;