mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Removed a compiler warning
This commit is contained in:
parent
782f4d5d92
commit
dd6cf0e923
@ -1276,12 +1276,12 @@ nsGenericElement::AddScriptEventListener(nsIAtom* aAttribute,
|
||||
else {
|
||||
nsIEventListenerManager *manager;
|
||||
if (NS_OK == GetListenerManager(&manager)) {
|
||||
nsIScriptObjectOwner* owner;
|
||||
nsIScriptObjectOwner* cowner;
|
||||
if (NS_OK == mContent->QueryInterface(kIScriptObjectOwnerIID,
|
||||
(void**) &owner)) {
|
||||
ret = manager->AddScriptEventListener(context, owner,
|
||||
(void**) &cowner)) {
|
||||
ret = manager->AddScriptEventListener(context, cowner,
|
||||
aAttribute, aValue, aIID);
|
||||
NS_RELEASE(owner);
|
||||
NS_RELEASE(cowner);
|
||||
}
|
||||
NS_RELEASE(manager);
|
||||
}
|
||||
|
@ -118,10 +118,10 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* cp = aBuffer;
|
||||
const PRUnichar* end = aBuffer + aLength;
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
|
@ -2410,7 +2410,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
|
@ -1069,8 +1069,8 @@ CSSStyleSheetImpl::CSSStyleSheetImpl()
|
||||
mDocument(nsnull),
|
||||
mOwningNode(nsnull),
|
||||
mDisabled(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mDirty(PR_FALSE)
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
@ -1095,9 +1095,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
|
||||
mDocument(aCopy.mDocument),
|
||||
mOwningNode(aCopy.mOwningNode),
|
||||
mDisabled(aCopy.mDisabled),
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mInner(aCopy.mInner),
|
||||
mDirty(PR_FALSE)
|
||||
mInner(aCopy.mInner)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
|
@ -118,10 +118,10 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* cp = aBuffer;
|
||||
const PRUnichar* end = aBuffer + aLength;
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
|
@ -455,8 +455,6 @@ nsLoggingSink::WriteAttributes(const nsIParserNode& aNode)
|
||||
if (0 != strchr(gSkippedContentTags, aNode.GetNodeType())) {
|
||||
const nsString& content = aNode.GetSkippedContent();
|
||||
if (content.Length() > 0) {
|
||||
nsAutoString tmp;
|
||||
|
||||
QuoteText(content, tmp);
|
||||
(*mOutput) << " <content value=\"";
|
||||
(*mOutput) << tmp << "\"/>" << endl;
|
||||
|
@ -1276,12 +1276,12 @@ nsGenericElement::AddScriptEventListener(nsIAtom* aAttribute,
|
||||
else {
|
||||
nsIEventListenerManager *manager;
|
||||
if (NS_OK == GetListenerManager(&manager)) {
|
||||
nsIScriptObjectOwner* owner;
|
||||
nsIScriptObjectOwner* cowner;
|
||||
if (NS_OK == mContent->QueryInterface(kIScriptObjectOwnerIID,
|
||||
(void**) &owner)) {
|
||||
ret = manager->AddScriptEventListener(context, owner,
|
||||
(void**) &cowner)) {
|
||||
ret = manager->AddScriptEventListener(context, cowner,
|
||||
aAttribute, aValue, aIID);
|
||||
NS_RELEASE(owner);
|
||||
NS_RELEASE(cowner);
|
||||
}
|
||||
NS_RELEASE(manager);
|
||||
}
|
||||
|
@ -118,10 +118,10 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
|
||||
if (0 != aLength) {
|
||||
// See if we need to store the data in ucs2 or not
|
||||
PRBool need2 = PR_FALSE;
|
||||
const PRUnichar* cp = aBuffer;
|
||||
const PRUnichar* end = aBuffer + aLength;
|
||||
while (cp < end) {
|
||||
PRUnichar ch = *cp++;
|
||||
const PRUnichar* ucp = aBuffer;
|
||||
const PRUnichar* uend = aBuffer + aLength;
|
||||
while (ucp < uend) {
|
||||
PRUnichar ch = *ucp++;
|
||||
if (ch >> 8) {
|
||||
need2 = PR_TRUE;
|
||||
break;
|
||||
|
@ -2410,7 +2410,7 @@ nsGenericHTMLContainerElement::ReplaceChild(nsIDOMNode* aNewChild,
|
||||
IndexOf(content, pos);
|
||||
if (pos >= 0) {
|
||||
nsIContent* newContent = nsnull;
|
||||
nsresult res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
res = aNewChild->QueryInterface(kIContentIID, (void**)&newContent);
|
||||
NS_ASSERTION(NS_OK == res, "Must be an nsIContent");
|
||||
if (NS_OK == res) {
|
||||
// Check if this is a document fragment. If it is, we need
|
||||
|
@ -1069,8 +1069,8 @@ CSSStyleSheetImpl::CSSStyleSheetImpl()
|
||||
mDocument(nsnull),
|
||||
mOwningNode(nsnull),
|
||||
mDisabled(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mDirty(PR_FALSE)
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
@ -1095,9 +1095,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
|
||||
mDocument(aCopy.mDocument),
|
||||
mOwningNode(aCopy.mOwningNode),
|
||||
mDisabled(aCopy.mDisabled),
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mInner(aCopy.mInner),
|
||||
mDirty(PR_FALSE)
|
||||
mInner(aCopy.mInner)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
|
@ -66,7 +66,7 @@ int TestProps() {
|
||||
}
|
||||
|
||||
// Now make sure we don't find some garbage
|
||||
for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) {
|
||||
for (int i = 0; i < int(sizeof(kJunkNames) / sizeof(const char*)); i++) {
|
||||
const char* tag = kJunkNames[i];
|
||||
id = nsCSSProps::LookupName(tag);
|
||||
if (id >= 0) {
|
||||
@ -115,7 +115,7 @@ int TestKeywords() {
|
||||
}
|
||||
|
||||
// Now make sure we don't find some garbage
|
||||
for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) {
|
||||
for (int i = 0; i < int(sizeof(kJunkNames) / sizeof(const char*)); i++) {
|
||||
const char* tag = kJunkNames[i];
|
||||
id = nsCSSKeywords::LookupName(tag);
|
||||
if (id >= 0) {
|
||||
|
@ -1069,8 +1069,8 @@ CSSStyleSheetImpl::CSSStyleSheetImpl()
|
||||
mDocument(nsnull),
|
||||
mOwningNode(nsnull),
|
||||
mDisabled(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mDirty(PR_FALSE)
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
@ -1095,9 +1095,9 @@ CSSStyleSheetImpl::CSSStyleSheetImpl(const CSSStyleSheetImpl& aCopy)
|
||||
mDocument(aCopy.mDocument),
|
||||
mOwningNode(aCopy.mOwningNode),
|
||||
mDisabled(aCopy.mDisabled),
|
||||
mDirty(PR_FALSE),
|
||||
mScriptObject(nsnull),
|
||||
mInner(aCopy.mInner),
|
||||
mDirty(PR_FALSE)
|
||||
mInner(aCopy.mInner)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
nsCSSAtoms::AddrefAtoms();
|
||||
|
@ -455,8 +455,6 @@ nsLoggingSink::WriteAttributes(const nsIParserNode& aNode)
|
||||
if (0 != strchr(gSkippedContentTags, aNode.GetNodeType())) {
|
||||
const nsString& content = aNode.GetSkippedContent();
|
||||
if (content.Length() > 0) {
|
||||
nsAutoString tmp;
|
||||
|
||||
QuoteText(content, tmp);
|
||||
(*mOutput) << " <content value=\"";
|
||||
(*mOutput) << tmp << "\"/>" << endl;
|
||||
|
@ -190,8 +190,11 @@ ConverterInputStream::ConverterInputStream(nsIInputStream* aStream,
|
||||
if (aBufferSize == 0) {
|
||||
aBufferSize = 8192;
|
||||
}
|
||||
nsresult rv1 = NS_NewByteBuffer(&mByteData, nsnull, aBufferSize);
|
||||
nsresult rv2 = NS_NewUnicharBuffer(&mUnicharData, nsnull, aBufferSize);
|
||||
|
||||
// XXX what if these fail?
|
||||
NS_NewByteBuffer(&mByteData, nsnull, aBufferSize);
|
||||
NS_NewUnicharBuffer(&mUnicharData, nsnull, aBufferSize);
|
||||
|
||||
mByteDataOffset = 0;
|
||||
mUnicharDataOffset = 0;
|
||||
mUnicharDataLength = 0;
|
||||
|
@ -78,12 +78,12 @@ static Test tests[] = {
|
||||
{ "bar", "foo", 3 },
|
||||
{ "bar", "fo", 3 },
|
||||
};
|
||||
#define NUM_TESTS (sizeof(tests) / sizeof(tests[0]))
|
||||
#define NUM_TESTS int((sizeof(tests) / sizeof(tests[0])))
|
||||
|
||||
int main()
|
||||
{
|
||||
Test* tp = tests;
|
||||
for (PRIntn i = 0; i < NUM_TESTS; i++, tp++) {
|
||||
for (int i = 0; i < NUM_TESTS; i++, tp++) {
|
||||
Check(tp->s1, tp->s2, tp->n);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user