diff --git a/mailnews/base/src/nsMsgLocalMailFolder.cpp b/mailnews/base/src/nsMsgLocalMailFolder.cpp index 04a88557612f..533ce066e6c2 100644 --- a/mailnews/base/src/nsMsgLocalMailFolder.cpp +++ b/mailnews/base/src/nsMsgLocalMailFolder.cpp @@ -23,6 +23,11 @@ #include "prprf.h" #include "nsIRDFResourceFactory.h" +// we need this because of an egcs 1.0 (and possibly gcc) compiler bug +// that doesn't allow you to call ::nsISupports::IID() inside of a class +// that multiply inherits from nsISupports +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + nsMsgLocalMailFolder::nsMsgLocalMailFolder(const char* uri) :nsMsgFolder(uri) { @@ -46,7 +51,7 @@ nsMsgLocalMailFolder::QueryInterface(REFNSIID iid, void** result) *result = nsnull; if (iid.Equals(nsIMsgLocalMailFolder::IID()) || - iid.Equals(::nsISupports::IID())) + iid.Equals(kISupportsIID)) { *result = NS_STATIC_CAST(nsIMsgLocalMailFolder*, this); AddRef(); @@ -364,7 +369,8 @@ nsMsgLocalMailFolder::FindChildNamed(const char *name, nsIMsgFolder ** aChild) supports = mSubFolders->ElementAt(i); if(folder) NS_RELEASE(folder); - if(NS_SUCCEEDED(supports->QueryInterface(::nsISupports::IID(), (void**)&folder))) + if(NS_SUCCEEDED(supports->QueryInterface(kISupportsIID, + (void**)&folder))) { char *folderName; diff --git a/mailnews/db/msgdb/src/nsDBFolderInfo.cpp b/mailnews/db/msgdb/src/nsDBFolderInfo.cpp index 98d14977762f..c1290098f07d 100644 --- a/mailnews/db/msgdb/src/nsDBFolderInfo.cpp +++ b/mailnews/db/msgdb/src/nsDBFolderInfo.cpp @@ -39,7 +39,7 @@ static const char * kUnreadPendingMessagesColumnName = "unreadPendingMsgs"; static const char * kMailboxNameColumnName = "mailboxName"; nsDBFolderInfo::nsDBFolderInfo(nsMsgDatabase *mdb) - : m_folderDate() // now + : m_folderDate(0) // now { m_mdbTable = NULL; m_mdbRow = NULL; diff --git a/mailnews/local/src/nsMSGFolderDataSource.cpp b/mailnews/local/src/nsMSGFolderDataSource.cpp index d47e5f75b8ad..c38d9a5a209e 100644 --- a/mailnews/local/src/nsMSGFolderDataSource.cpp +++ b/mailnews/local/src/nsMSGFolderDataSource.cpp @@ -40,6 +40,12 @@ static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); static NS_DEFINE_CID(kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID); +// we need this because of an egcs 1.0 (and possibly gcc) compiler bug +// that doesn't allow you to call ::nsISupports::IID() inside of a class +// that multiply inherits from nsISupports +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kIRDFCursorIID, NS_IRDFCURSOR_IID); + nsIRDFResource* nsMSGFolderDataSource::kNC_Child; nsIRDFResource* nsMSGFolderDataSource::kNC_Folder; nsIRDFResource* nsMSGFolderDataSource::kNC_Name; @@ -768,8 +774,8 @@ ArrayMsgFolderCursor::QueryInterface(REFNSIID iid, void** result) *result = nsnull; if (iid.Equals(nsIRDFAssertionCursor::IID()) || - iid.Equals(::nsIRDFCursor::IID()) || - iid.Equals(::nsISupports::IID())) { + iid.Equals(kIRDFCursorIID) || + iid.Equals(kISupportsIID)) { *result = NS_STATIC_CAST(nsIRDFAssertionCursor*, this); AddRef(); return NS_OK; diff --git a/mailnews/local/src/nsMailboxUrl.cpp b/mailnews/local/src/nsMailboxUrl.cpp index f2faf1ff072d..97a7cf36657e 100644 --- a/mailnews/local/src/nsMailboxUrl.cpp +++ b/mailnews/local/src/nsMailboxUrl.cpp @@ -34,6 +34,11 @@ #include "prprf.h" #include "nsCRT.h" +// we need this because of an egcs 1.0 (and possibly gcc) compiler bug +// that doesn't allow you to call ::nsISupports::IID() inside of a class +// that multiply inherits from nsISupports +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + nsMailboxUrl::nsMailboxUrl(nsISupports* aContainer, nsIURLGroup* aGroup) { NS_INIT_REFCNT(); @@ -88,7 +93,8 @@ nsresult nsMailboxUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr) return NS_ERROR_NULL_POINTER; } - if (aIID.Equals(nsIMailboxUrl::IID()) || aIID.Equals(::nsISupports::IID())) { + if (aIID.Equals(nsIMailboxUrl::IID()) || + aIID.Equals(kISupportsIID)) { *aInstancePtr = (void*) ((nsIMailboxUrl*)this); NS_ADDREF_THIS(); return NS_OK; diff --git a/mailnews/local/src/nsPop3URL.cpp b/mailnews/local/src/nsPop3URL.cpp index f0c6cd85dbd1..4dcd89e53e19 100644 --- a/mailnews/local/src/nsPop3URL.cpp +++ b/mailnews/local/src/nsPop3URL.cpp @@ -33,6 +33,12 @@ #include "prprf.h" #include "nsCRT.h" +// we need this because of an egcs 1.0 (and possibly gcc) compiler bug +// that doesn't allow you to call ::nsISupports::IID() inside of a class +// that multiply inherits from nsISupports +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + + nsPop3URL::nsPop3URL(nsISupports* aContainer, nsIURLGroup* aGroup) { NS_INIT_REFCNT(); @@ -86,7 +92,8 @@ nsresult nsPop3URL::QueryInterface(const nsIID &aIID, void** aInstancePtr) return NS_ERROR_NULL_POINTER; } - if (aIID.Equals(nsIPop3URL::IID()) || aIID.Equals(::nsISupports::IID())) { + if (aIID.Equals(nsIPop3URL::IID()) || + aIID.Equals(kISupportsIID)) { *aInstancePtr = (void*) ((nsIPop3URL*)this); AddRef(); return NS_OK; diff --git a/mailnews/news/src/nsNntpUrl.cpp b/mailnews/news/src/nsNntpUrl.cpp index bcd704fb0ebf..ae6c6dfaeeb0 100644 --- a/mailnews/news/src/nsNntpUrl.cpp +++ b/mailnews/news/src/nsNntpUrl.cpp @@ -33,6 +33,11 @@ #include "prprf.h" #include "nsCRT.h" +// we need this because of an egcs 1.0 (and possibly gcc) compiler bug +// that doesn't allow you to call ::nsISupports::IID() inside of a class +// that multiply inherits from nsISupports +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + nsNntpUrl::nsNntpUrl(nsISupports* aContainer, nsIURLGroup* aGroup) { NS_INIT_REFCNT(); @@ -95,7 +100,8 @@ nsresult nsNntpUrl::QueryInterface(const nsIID &aIID, void** aInstancePtr) return NS_ERROR_NULL_POINTER; } - if (aIID.Equals(nsINntpUrl::IID()) || aIID.Equals(::nsISupports::IID())) { + if (aIID.Equals(nsINntpUrl::IID()) || + aIID.Equals(kISupportsIID)) { *aInstancePtr = (void*) ((nsINntpUrl*)this); NS_ADDREF_THIS(); return NS_OK;