Porting fixes for gcc trunk (to become 3.3): Eliminate C-only option from CXXFLAGS. Don't use pasting for things that are still separate tokens. Don't pass objects of non-POD type through |...|. Don't include strstream.h, which isn't used anymore anyway. b=170250 r=bbaetz sr=alecf

This commit is contained in:
dbaron%fas.harvard.edu 2002-09-30 14:18:27 +00:00
Родитель a57e1f3bcc
Коммит 630ee775dd
22 изменённых файлов: 30 добавлений и 32 удалений

2
configure поставляемый
Просмотреть файл

@ -4498,7 +4498,7 @@ fi
if test "$GNU_CXX"; then
# Turn on GNU specific features
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy"
if test ! "$QTDIR"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS}"

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

@ -640,7 +640,7 @@ fi
if test "$GNU_CXX"; then
# Turn on GNU specific features
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wbad-function-cast -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy"
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy"
dnl The following warning breaks Qt
if test ! "$QTDIR"; then

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

@ -171,7 +171,7 @@ nsCommentNode::List(FILE* out, PRInt32 aIndent) const
PRInt32 indx;
for (indx = aIndent; --indx >= 0; ) fputs(" ", out);
fprintf(out, "Comment@%p refcount=%d<!--", this, mRefCnt);
fprintf(out, "Comment@%p refcount=%d<!--", this, mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

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

@ -3777,7 +3777,7 @@ nsGenericContainerElement::List(FILE* out, PRInt32 aIndent) const
ListAttributes(out);
fprintf(out, " refcount=%d<", mRefCnt);
fprintf(out, " refcount=%d<", mRefCnt.get());
PRBool canHaveKids;
CanContainChildren(canHaveKids);

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

@ -802,7 +802,8 @@ void nsStyleContext::List(FILE* out, PRInt32 aIndent)
// Indent
PRInt32 ix;
for (ix = aIndent; --ix >= 0; ) fputs(" ", out);
fprintf(out, "%p(%d) parent=%p ", (void*)this, mRefCnt, (void *)mParent);
fprintf(out, "%p(%d) parent=%p ",
(void*)this, mRefCnt.get(), (void *)mParent);
if (mPseudoTag) {
nsAutoString buffer;
mPseudoTag->ToString(buffer);

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

@ -170,7 +170,7 @@ nsTextNode::List(FILE* out, PRInt32 aIndent) const
PRInt32 index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "Text@%p refcount=%d<", this, mRefCnt);
fprintf(out, "Text@%p refcount=%d<", this, mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

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

@ -2436,7 +2436,7 @@ nsGenericHTMLElement::List(FILE* out, PRInt32 aIndent) const
ListAttributes(out);
fprintf(out, " refcount=%d<", mRefCnt);
fprintf(out, " refcount=%d<", mRefCnt.get());
PRBool canHaveKids;
CanContainChildren(canHaveKids);

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

@ -171,7 +171,7 @@ nsXMLCDATASection::List(FILE* out, PRInt32 aIndent) const
PRInt32 index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "CDATASection refcount=%d<", mRefCnt);
fprintf(out, "CDATASection refcount=%d<", mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

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

@ -189,7 +189,7 @@ nsXMLEntity::List(FILE* out, PRInt32 aIndent) const
PRInt32 index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "Entity refcount=%d<!ENTITY ", mRefCnt);
fprintf(out, "Entity refcount=%d<!ENTITY ", mRefCnt.get());
nsAutoString tmp(mName);
if (!mPublicId.IsEmpty()) {

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

@ -178,7 +178,7 @@ nsXMLNotation::List(FILE* out, PRInt32 aIndent) const
PRInt32 index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "Notation refcount=%d<!NOTATION ", mRefCnt);
fprintf(out, "Notation refcount=%d<!NOTATION ", mRefCnt.get());
nsAutoString tmp(mName);
if (!mPublicId.IsEmpty()) {

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

@ -159,7 +159,7 @@ nsXMLProcessingInstruction::List(FILE* out, PRInt32 aIndent) const
PRInt32 index;
for (index = aIndent; --index >= 0; ) fputs(" ", out);
fprintf(out, "Processing instruction refcount=%d<", mRefCnt);
fprintf(out, "Processing instruction refcount=%d<", mRefCnt.get());
nsAutoString tmp;
ToCString(tmp, 0, mText.GetLength());

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

@ -146,7 +146,7 @@ nsLDAPOperation::SimpleBind(const nsACString& passwd)
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPOperation::SimpleBind(): called; bindName = '%s'; ",
bindName));
bindName.get()));
mMsgID = ldap_simple_bind(mConnectionHandle, bindName.get(),
PromiseFlatCString(passwd).get());
@ -255,7 +255,9 @@ nsLDAPOperation::SearchExt(const nsACString& aBaseDn, PRInt32 aScope,
PR_LOG(gLDAPLogModule, PR_LOG_DEBUG,
("nsLDAPOperation::SearchExt(): called with aBaseDn = '%s'; "
"aFilter = '%s', aAttrCounts = %u, aSizeLimit = %d",
aBaseDn, aFilter, aAttrCount, aSizeLimit));
PromiseFlatCString(aBaseDn).get(),
PromiseFlatCString(aFilter).get(),
aAttrCount, aSizeLimit));
char **attrs = 0;

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

@ -1086,7 +1086,7 @@ nsXPConnect::DebugDump(PRInt16 depth)
{
#ifdef DEBUG
depth-- ;
XPC_LOG_ALWAYS(("nsXPConnect @ %x with mRefCnt = %d", this, mRefCnt));
XPC_LOG_ALWAYS(("nsXPConnect @ %x with mRefCnt = %d", this, mRefCnt.get()));
XPC_LOG_INDENT();
XPC_LOG_ALWAYS(("gSelf @ %x", gSelf));
XPC_LOG_ALWAYS(("gOnceAliveNowDead is %d", (int)gOnceAliveNowDead));

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

@ -497,7 +497,7 @@ NS_IMETHODIMP
nsXPCWrappedJS::DebugDump(PRInt16 depth)
{
#ifdef DEBUG
XPC_LOG_ALWAYS(("nsXPCWrappedJS @ %x with mRefCnt = %d", this, mRefCnt));
XPC_LOG_ALWAYS(("nsXPCWrappedJS @ %x with mRefCnt = %d", this, mRefCnt.get()));
XPC_LOG_INDENT();
PRBool isRoot = mRoot == this;

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

@ -1599,7 +1599,7 @@ nsXPCWrappedJSClass::DebugDump(PRInt16 depth)
{
#ifdef DEBUG
depth-- ;
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x with mRefCnt = %d", this, mRefCnt));
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x with mRefCnt = %d", this, mRefCnt.get()));
XPC_LOG_INDENT();
char* name;
mInfo->GetName(&name);

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

@ -2320,7 +2320,7 @@ NS_IMETHODIMP XPCWrappedNative::DebugDump(PRInt16 depth)
{
#ifdef DEBUG
depth-- ;
XPC_LOG_ALWAYS(("XPCWrappedNative @ %x with mRefCnt = %d", this, mRefCnt));
XPC_LOG_ALWAYS(("XPCWrappedNative @ %x with mRefCnt = %d", this, mRefCnt.get()));
XPC_LOG_INDENT();
if(HasProto())

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

@ -472,8 +472,8 @@ TestArgFormatter(JSContext* jscontext, JSObject* glob, nsIXPConnect* xpc)
if(!JS_ConvertArguments(jscontext, 5, argv, "s %ip %iv %is s",
&a_out,
getter_AddRefs(b_out),
getter_AddRefs(c_out),
NS_STATIC_CAST(nsISupports**, getter_AddRefs(b_out)),
NS_STATIC_CAST(nsIVariant**, getter_AddRefs(c_out)),
NS_STATIC_CAST(nsAString*, &d_out),
&e_out))
{

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

@ -61,7 +61,7 @@ NS_IMETHODIMP_(nsrefcnt) xpctestNoisy::AddRef(void)
NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "xpctestNoisy", sizeof(*this));
printf("Noisy %d - incremented refcount to %d\n", mID, mRefCnt);
printf("Noisy %d - incremented refcount to %d\n", mID, mRefCnt.get());
return mRefCnt;
}
@ -69,7 +69,7 @@ NS_IMETHODIMP_(nsrefcnt) xpctestNoisy::Release(void)
{
NS_PRECONDITION(0 != mRefCnt, "dup release");
--mRefCnt;
printf("Noisy %d - decremented refcount to %d\n", mID, mRefCnt);
printf("Noisy %d - decremented refcount to %d\n", mID, mRefCnt.get());
NS_LOG_RELEASE(this, mRefCnt, "xpctestNoisy");
if (mRefCnt == 0) {
NS_DELETEXPCOM(this);

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

@ -802,7 +802,8 @@ void nsStyleContext::List(FILE* out, PRInt32 aIndent)
// Indent
PRInt32 ix;
for (ix = aIndent; --ix >= 0; ) fputs(" ", out);
fprintf(out, "%p(%d) parent=%p ", (void*)this, mRefCnt, (void *)mParent);
fprintf(out, "%p(%d) parent=%p ",
(void*)this, mRefCnt.get(), (void *)mParent);
if (mPseudoTag) {
nsAutoString buffer;
mPseudoTag->ToString(buffer);

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

@ -74,13 +74,6 @@
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#if defined(WIN32) || defined(XP_OS2_VACPP)
#include <strstrea.h>
#else
#include <strstream.h>
#endif
#include <ctype.h> // tolower
// XXX For font setting below

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

@ -97,6 +97,7 @@ class nsAutoRefCnt {
nsrefcnt operator=(nsrefcnt aValue) { return (mValue = aValue); }
operator nsrefcnt() const { return mValue; }
nsrefcnt get() const { return mValue; }
private:
// do not define these to enforce the faster prefix notation
nsrefcnt operator++(int);

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

@ -60,7 +60,7 @@
/*
* IDL_tree_warning bombs on libIDL version 6.5, and I don't want to not write
* warnings... so I define a versioned one here. Thanks to Mike Shaver for the
* ## idiom, that allows us to pass through varargs calls.
* this solution, which allows us to pass through varargs calls.
*/
#if !(LIBIDL_MAJOR_VERSION == 0 && LIBIDL_MINOR_VERSION == 6 && \
LIBIDL_MICRO_VERSION == 5) && !defined(DEBUG_shaver)
@ -71,10 +71,10 @@
* parens, e.g. XPIDL_WARNING((foo, bar, "sil"))
*
* Probably best removed when we leave 6.5. */
#define XPIDL_WARNING(x) IDL_tree_warning##x
#define XPIDL_WARNING(x) IDL_tree_warning x
#else
extern void xpidl_tree_warning(IDL_tree p, int level, const char *fmt, ...);
#define XPIDL_WARNING(x) xpidl_tree_warning##x
#define XPIDL_WARNING(x) xpidl_tree_warning x
#endif
/*