Various fixes to let the tree compile with gcc 2.95:

String constants are now (const char *)s and must be explicitly cast to (char *).
operator new is expected to be empty or throw an expection instead of returning null. (ifdef'd for gcc 2.95+)
Stricter checks on register clobbering in embedded asm. (at least I think that's what it is)
Expects the main function to return int, not something similiar to it like PRInt32.

Still requires a tweak to remove -mno-486 from NSPR's *.mk files.
This commit is contained in:
cls%seawood.org 1999-08-07 06:01:31 +00:00
Родитель 4b9157edbb
Коммит 3f1dcd11dc
11 изменённых файлов: 38 добавлений и 14 удалений

Просмотреть файл

@ -1830,7 +1830,7 @@ RDFGenericBuilderImpl::BuildContentFromTemplate(nsIContent *aTemplateNode,
if (NS_FAILED(rv)) return rv;
// test to see if the container has contents
char* isEmpty = IsEmpty(realKid, aChild) ? "true" : "false";
char* isEmpty = IsEmpty(realKid, aChild) ? (char *)"true" : (char *)"false";
rv = realKid->SetAttribute(kNameSpaceID_None, kEmptyAtom, isEmpty, PR_FALSE);
if (NS_FAILED(rv)) return rv;
}

Просмотреть файл

@ -9,7 +9,7 @@ static NS_DEFINE_IID(kCookieServiceCID, NS_COOKIESERVICE_CID);
PRInt32 main(PRInt32 argc, char *argv[])
int main(PRInt32 argc, char *argv[])
{
nsICookieService *cookieService = NULL;

Просмотреть файл

@ -43,7 +43,7 @@
#define NS_MENU_POPUP_LIST_INDEX (NS_AREA_FRAME_ABSOLUTE_LIST_INDEX + 1)
static gEatMouseMove = PR_FALSE;
static PRInt32 gEatMouseMove = PR_FALSE;
//
// NS_NewMenuFrame

Просмотреть файл

@ -700,7 +700,7 @@ nsresult nsMsgSearchOfflineMail::AddResultElement (nsIMsgDBHdr *pHeaders)
// Don't even bother to look at expunged messages awaiting compression
pHeaders->GetFlags(&msgFlags);
pValue->attribute = nsMsgSearchAttrib::Subject;
char *reString = (msgFlags & MSG_FLAG_HAS_RE) ? "Re: " : "";
char *reString = (msgFlags & MSG_FLAG_HAS_RE) ? (char *)"Re: " : (char *)"";
pHeaders->GetSubject(&subject);
pValue->u.string = PR_smprintf ("%s%s", reString, (const char*) nsAutoCString(subject)); // hack. invoke cast operator by force
newResult->AddValue (pValue);

Просмотреть файл

@ -644,7 +644,7 @@ nsMessenger::CopyMessages(nsIRDFCompositeDataSource *database, nsIDOMXULElement
folderArray->AppendElement(dstResource);
rv = DoCommand(database, isMove ? NC_RDF_MOVE : NC_RDF_COPY, folderArray, argumentArray);
rv = DoCommand(database, isMove ? (char *)NC_RDF_MOVE : (char *)NC_RDF_COPY, folderArray, argumentArray);
return rv;
#else

Просмотреть файл

@ -794,7 +794,7 @@ NS_IMETHODIMP QuotingOutputStreamListener::OnStopRequest(nsIChannel * /* aChanne
PRBool compHTML = PR_FALSE;
mComposeObj->GetComposeHTML(&compHTML);
mComposeObj->mTempComposeFileSpec = nsMsgCreateTempFileSpec(compHTML ? "nscomp.html" : "nscomp.txt");
mComposeObj->mTempComposeFileSpec = nsMsgCreateTempFileSpec(compHTML ? (char *)"nscomp.html" : (char *)"nscomp.txt");
if (!mComposeObj->mTempComposeFileSpec)
return NS_MSG_ERROR_WRITING_FILE;
@ -1500,7 +1500,7 @@ nsMsgCompose::ProcessSignature(nsOutputFileStream *aAppendFileStream)
}
else // Have to write data to a temp file then load the URL...
{
mSigFileSpec = nsMsgCreateTempFileSpec(m_composeHTML ? "sig.html" : "sig.txt");
mSigFileSpec = nsMsgCreateTempFileSpec(m_composeHTML ? (char *)"sig.html" : (char *)"sig.txt");
if (!mSigFileSpec)
return NS_ERROR_FAILURE;
@ -1566,7 +1566,7 @@ nsMsgCompose::BuildBodyMessage()
// Since we have a body in the comp fields, we need to create a
// body of this old body...
//
mTempComposeFileSpec = nsMsgCreateTempFileSpec(m_composeHTML ? "nscomp.html" : "nscomp.txt");
mTempComposeFileSpec = nsMsgCreateTempFileSpec(m_composeHTML ? (char *)"nscomp.html" : (char *)"nscomp.txt");
if (!mTempComposeFileSpec)
return NS_MSG_ERROR_WRITING_FILE;

Просмотреть файл

@ -1830,7 +1830,7 @@ RDFGenericBuilderImpl::BuildContentFromTemplate(nsIContent *aTemplateNode,
if (NS_FAILED(rv)) return rv;
// test to see if the container has contents
char* isEmpty = IsEmpty(realKid, aChild) ? "true" : "false";
char* isEmpty = IsEmpty(realKid, aChild) ? (char *)"true" : (char *)"false";
rv = realKid->SetAttribute(kNameSpaceID_None, kEmptyAtom, isEmpty, PR_FALSE);
if (NS_FAILED(rv)) return rv;
}

Просмотреть файл

@ -1830,7 +1830,7 @@ RDFGenericBuilderImpl::BuildContentFromTemplate(nsIContent *aTemplateNode,
if (NS_FAILED(rv)) return rv;
// test to see if the container has contents
char* isEmpty = IsEmpty(realKid, aChild) ? "true" : "false";
char* isEmpty = IsEmpty(realKid, aChild) ? (char *)"true" : (char *)"false";
rv = realKid->SetAttribute(kNameSpaceID_None, kEmptyAtom, isEmpty, PR_FALSE);
if (NS_FAILED(rv)) return rv;
}

Просмотреть файл

@ -76,7 +76,7 @@
*
*/
#define NS_DEF_PTR(cls) \
#define NS_DEF_PTR1(cls) \
class cls##Ptr { \
public: \
cls##Ptr(void) : mPtr(0) {} \
@ -126,11 +126,23 @@ public: \
operator cls*(void) { return mPtr; } \
const cls* operator->(void) const { return mPtr; } \
const cls& operator*(void) const { return *mPtr; } \
operator const cls* (void) const { return mPtr; } \
operator const cls* (void) const { return mPtr; }
#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define NS_DEF_PTR2(cls) \
private: \
void* operator new(size_t size) {} \
void operator delete(void* aPtr) {} \
cls* mPtr;
#else
#define NS_DEF_PTR2(cls) \
private: \
void* operator new(size_t size) { return 0; } \
void operator delete(void* aPtr) {} \
cls* mPtr; \
cls* mPtr;
#endif /* gcc 2.95 */
#define NS_DEF_PTR3(cls) \
public: \
friend inline PRBool operator==(const cls* aInterface, const cls##Ptr& aPtr) \
{ return PRBool(aInterface == aPtr.mPtr); } \
@ -138,5 +150,11 @@ friend inline PRBool operator!=(const cls* aInterface, const cls##Ptr& aPtr) \
{ return PRBool(aInterface != aPtr.mPtr); } \
}
#define NS_DEF_PTR(cls) \
NS_DEF_PTR1(cls) \
NS_DEF_PTR2(cls) \
NS_DEF_PTR3(cls)
#endif // nsIPtr_h___

Просмотреть файл

@ -109,7 +109,7 @@ nsresult nsXPTCStubBase::Stub##n() \
"call *%%edx" /* PrepareAndDispatch */ \
: "=a" (result) /* %0 */ \
: "d" (method) /* %1 */ \
: "ax", "dx", "cx", "memory" ); \
: "cx", "memory" ); \
return result; \
}

Просмотреть файл

@ -92,7 +92,9 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
static void* operator new(size_t /*size*/) {
#if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
return nsnull;
#endif
}
static void operator delete(void* /*memory*/) {}
@ -172,7 +174,9 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
static void* operator new(size_t /*size*/) {
#if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
return nsnull;
#endif
}
static void operator delete(void* /*memory*/) {}
};
@ -229,7 +233,9 @@ private:
// Not meant to be implemented. This makes it a compiler error to
// attempt to create an nsAutoLock object on the heap.
static void* operator new(size_t /*size*/) {
#if !(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
return nsnull;
#endif
}
static void operator delete(void* /*memory*/) {}
};