From 454a4301b9d8da7e5ff73882e17123d02361a9bd Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Wed, 17 Oct 2007 00:31:02 +0000 Subject: [PATCH] Backout taras's check-in for bug 398435 to help find Tp regression. --- xpcom/ds/nsHashtable.cpp | 2 +- xpcom/glue/nsBaseHashtable.h | 2 +- xpcom/glue/nsTHashtable.h | 2 +- xpcom/glue/nsThreadUtils.cpp | 4 ++-- xpcom/io/nsBinaryStream.cpp | 2 +- xpcom/io/nsEscape.cpp | 18 +++++++++--------- xpcom/io/nsPipe3.cpp | 2 +- xpcom/io/nsScriptableInputStream.cpp | 2 +- xpcom/proxy/src/nsProxyEvent.cpp | 2 +- xpcom/proxy/src/nsProxyEventPrivate.h | 2 +- xpcom/reflect/xptinfo/public/xptinfo.h | 2 +- xpcom/reflect/xptinfo/src/xptiManifest.cpp | 16 ++++++++-------- xpcom/typelib/xpt/public/xpt_struct.h | 4 ++-- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/xpcom/ds/nsHashtable.cpp b/xpcom/ds/nsHashtable.cpp index 4566000ff31..7afddf4a2b0 100644 --- a/xpcom/ds/nsHashtable.cpp +++ b/xpcom/ds/nsHashtable.cpp @@ -795,7 +795,7 @@ nsObjectHashtable::RemoveAndDelete(nsHashKey *aKey) { void *value = Remove(aKey); if (value && mDestroyElementFun) - return !!(*mDestroyElementFun)(aKey, value, mDestroyElementClosure); + return (*mDestroyElementFun)(aKey, value, mDestroyElementClosure); return PR_FALSE; } diff --git a/xpcom/glue/nsBaseHashtable.h b/xpcom/glue/nsBaseHashtable.h index 48e9fd8f3b2..566dcb92fe1 100644 --- a/xpcom/glue/nsBaseHashtable.h +++ b/xpcom/glue/nsBaseHashtable.h @@ -103,7 +103,7 @@ public: * This function is especially useful for static hashtables. * @return PR_TRUE if the table has been initialized. */ - PRBool IsInitialized() const { return !!this->mTable.entrySize; } + PRBool IsInitialized() const { return this->mTable.entrySize; } /** * Return the number of entries in the table. diff --git a/xpcom/glue/nsTHashtable.h b/xpcom/glue/nsTHashtable.h index a06efea333f..fd4ee26c0df 100644 --- a/xpcom/glue/nsTHashtable.h +++ b/xpcom/glue/nsTHashtable.h @@ -128,7 +128,7 @@ public: * Check whether the table has been initialized. This can be useful for static hashtables. * @return the initialization state of the class. */ - PRBool IsInitialized() const { return !!mTable.entrySize; } + PRBool IsInitialized() const { return mTable.entrySize; } /** * KeyType is typedef'ed for ease of use. diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp index 0ae127194d7..e46c6b4459e 100644 --- a/xpcom/glue/nsThreadUtils.cpp +++ b/xpcom/glue/nsThreadUtils.cpp @@ -193,7 +193,7 @@ NS_HasPendingEvents(nsIThread *thread) #ifdef MOZILLA_INTERNAL_API if (!thread) { thread = NS_GetCurrentThread(); - NS_ENSURE_TRUE(thread, PR_FALSE); + NS_ENSURE_STATE(thread); } #else nsCOMPtr current; @@ -213,7 +213,7 @@ NS_ProcessNextEvent(nsIThread *thread, PRBool mayWait) #ifdef MOZILLA_INTERNAL_API if (!thread) { thread = NS_GetCurrentThread(); - NS_ENSURE_TRUE(thread, PR_FALSE); + NS_ENSURE_STATE(thread); } #else nsCOMPtr current; diff --git a/xpcom/io/nsBinaryStream.cpp b/xpcom/io/nsBinaryStream.cpp index 679299c6217..7beaca20d6d 100644 --- a/xpcom/io/nsBinaryStream.cpp +++ b/xpcom/io/nsBinaryStream.cpp @@ -475,7 +475,7 @@ nsBinaryInputStream::ReadBoolean(PRBool* aBoolean) { PRUint8 byteResult; nsresult rv = Read8(&byteResult); - *aBoolean = !!byteResult; + *aBoolean = byteResult; return rv; } diff --git a/xpcom/io/nsEscape.cpp b/xpcom/io/nsEscape.cpp index 063b9357515..139937f6783 100644 --- a/xpcom/io/nsEscape.cpp +++ b/xpcom/io/nsEscape.cpp @@ -379,11 +379,11 @@ NS_COM PRBool NS_EscapeURL(const char *part, static const char hexChars[] = "0123456789ABCDEF"; if (partLen < 0) partLen = strlen(part); - PRBool forced = !!(flags & esc_Forced); - PRBool ignoreNonAscii = !!(flags & esc_OnlyASCII); - PRBool ignoreAscii = !!(flags & esc_OnlyNonASCII); - PRBool writing = !!(flags & esc_AlwaysCopy); - PRBool colon = !!(flags & esc_Colon); + PRBool forced = (flags & esc_Forced); + PRBool ignoreNonAscii = (flags & esc_OnlyASCII); + PRBool ignoreAscii = (flags & esc_OnlyNonASCII); + PRBool writing = (flags & esc_AlwaysCopy); + PRBool colon = (flags & esc_Colon); register const unsigned char* src = (const unsigned char *) part; @@ -461,10 +461,10 @@ NS_COM PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRUint32 flags, nsACS if (len < 0) len = strlen(str); - PRBool ignoreNonAscii = !!(flags & esc_OnlyASCII); - PRBool ignoreAscii = !!(flags & esc_OnlyNonASCII); - PRBool writing = !!(flags & esc_AlwaysCopy); - PRBool skipControl = !!(flags & esc_SkipControl); + PRBool ignoreNonAscii = (flags & esc_OnlyASCII); + PRBool ignoreAscii = (flags & esc_OnlyNonASCII); + PRBool writing = (flags & esc_AlwaysCopy); + PRBool skipControl = (flags & esc_SkipControl); static const char hexChars[] = "0123456789ABCDEFabcdef"; diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index 2ff7c8a1239..a0d66efc337 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -1041,7 +1041,7 @@ nsPipeOutputStream::OnOutputException(nsresult reason, nsPipeEvents &events) LOG(("nsPipeOutputStream::OnOutputException [this=%x reason=%x]\n", this, reason)); - PRBool result = PR_FALSE; + nsresult result = PR_FALSE; NS_ASSERTION(NS_FAILED(reason), "huh? successful exception"); mWritable = PR_FALSE; diff --git a/xpcom/io/nsScriptableInputStream.cpp b/xpcom/io/nsScriptableInputStream.cpp index 548aaa04500..5570daf0c0a 100644 --- a/xpcom/io/nsScriptableInputStream.cpp +++ b/xpcom/io/nsScriptableInputStream.cpp @@ -213,7 +213,7 @@ nsScriptableInputStream::ReadBoolean(PRBool* aBoolean) { PRUint8 byteResult; nsresult rv = Read8(&byteResult); - *aBoolean = !!byteResult; + *aBoolean = byteResult; return rv; } diff --git a/xpcom/proxy/src/nsProxyEvent.cpp b/xpcom/proxy/src/nsProxyEvent.cpp index b6628c1efbd..bee1415f2ee 100644 --- a/xpcom/proxy/src/nsProxyEvent.cpp +++ b/xpcom/proxy/src/nsProxyEvent.cpp @@ -293,7 +293,7 @@ nsProxyObjectCallInfo::CopyStrings(PRBool copy) PRBool nsProxyObjectCallInfo::GetCompleted() { - return !!mCompleted; + return (PRBool)mCompleted; } void diff --git a/xpcom/proxy/src/nsProxyEventPrivate.h b/xpcom/proxy/src/nsProxyEventPrivate.h index 9a2c63739ed..80ecbb011fa 100644 --- a/xpcom/proxy/src/nsProxyEventPrivate.h +++ b/xpcom/proxy/src/nsProxyEventPrivate.h @@ -244,7 +244,7 @@ public: void SetCallersTarget(nsIEventTarget* target); PRBool IsSync() const { - return !!(mOwner->GetProxyType() & NS_PROXY_SYNC); + return mOwner->GetProxyType() & NS_PROXY_SYNC; } private: diff --git a/xpcom/reflect/xptinfo/public/xptinfo.h b/xpcom/reflect/xptinfo/public/xptinfo.h index 70606ff5f70..f6a5fcfef79 100644 --- a/xpcom/reflect/xptinfo/public/xptinfo.h +++ b/xpcom/reflect/xptinfo/public/xptinfo.h @@ -94,7 +94,7 @@ public: } PRBool IsArray() const - {return TagPart() == T_ARRAY;} + {return (PRBool) TagPart() == T_ARRAY;} // 'Dependent' means that params of this type are dependent upon other // params. e.g. an T_INTERFACE_IS is dependent upon some other param at diff --git a/xpcom/reflect/xptinfo/src/xptiManifest.cpp b/xpcom/reflect/xptinfo/src/xptiManifest.cpp index 4ac47a4a263..f0a28727625 100644 --- a/xpcom/reflect/xptinfo/src/xptiManifest.cpp +++ b/xpcom/reflect/xptinfo/src/xptiManifest.cpp @@ -102,14 +102,14 @@ xpti_InterfaceWriter(PLDHashTable *table, PLDHashEntryHdr *hdr, const xptiTypelib& typelib = entry->GetTypelibRecord(); - PRBool success = !!PR_fprintf(fd, "%d,%s,%s,%d,%d,%d\n", - (int) number, - entry->GetTheName(), - iidStr, - (int) typelib.GetFileIndex(), - (int) (typelib.IsZip() ? - typelib.GetZipItemIndex() : -1), - (int) entry->GetScriptableFlag()); + PRBool success = PR_fprintf(fd, "%d,%s,%s,%d,%d,%d\n", + (int) number, + entry->GetTheName(), + iidStr, + (int) typelib.GetFileIndex(), + (int) (typelib.IsZip() ? + typelib.GetZipItemIndex() : -1), + (int) entry->GetScriptableFlag()); nsCRT::free(iidStr); diff --git a/xpcom/typelib/xpt/public/xpt_struct.h b/xpcom/typelib/xpt/public/xpt_struct.h index a5ba3a4b2df..bcbc706ef63 100644 --- a/xpcom/typelib/xpt/public/xpt_struct.h +++ b/xpcom/typelib/xpt/public/xpt_struct.h @@ -268,8 +268,8 @@ struct XPTInterfaceDescriptor { #define XPT_ID_TAGMASK (~XPT_ID_FLAGMASK) #define XPT_ID_TAG(id) ((id).flags & XPT_ID_TAGMASK) -#define XPT_ID_IS_SCRIPTABLE(flags) (!!(flags & XPT_ID_SCRIPTABLE)) -#define XPT_ID_IS_FUNCTION(flags) (!!(flags & XPT_ID_FUNCTION)) +#define XPT_ID_IS_SCRIPTABLE(flags) (flags & XPT_ID_SCRIPTABLE) +#define XPT_ID_IS_FUNCTION(flags) (flags & XPT_ID_FUNCTION) extern XPT_PUBLIC_API(PRBool) XPT_GetInterfaceIndexByName(XPTInterfaceDirectoryEntry *ide_block,