Bug 539585: Fix warning "warning: format '%p' expects type 'void *'" in xpcom directory. r=bsmedberg

This commit is contained in:
Daniel Holbert 2010-03-05 10:41:25 -08:00
parent 6989296175
commit 59c5b6d0cc
3 changed files with 9 additions and 5 deletions

View File

@ -86,13 +86,15 @@ Foo::Foo(PRInt32 aID)
{
mID = aID;
++gCount;
fprintf(stdout, "init: %d (%p), %d total)\n", mID, this, gCount);
fprintf(stdout, "init: %d (%p), %d total)\n",
mID, static_cast<void*>(this), gCount);
}
Foo::~Foo()
{
--gCount;
fprintf(stdout, "destruct: %d (%p), %d remain)\n", mID, this, gCount);
fprintf(stdout, "destruct: %d (%p), %d remain)\n",
mID, static_cast<void*>(this), gCount);
}
NS_IMPL_ISUPPORTS1(Foo, IFoo)
@ -124,7 +126,8 @@ void DumpArray(nsISupportsArray* aArray, PRInt32 aExpectedCount, PRInt32 aElemen
for (index = 0; (index < count) && (index < aExpectedCount); index++) {
IFoo* foo = (IFoo*)(aArray->ElementAt(index));
fprintf(stdout, "%2d: %d=%d (%p) c: %d %s\n",
index, aElementIDs[index], foo->ID(), foo, foo->RefCnt() - 1,
index, aElementIDs[index], foo->ID(),
static_cast<void*>(foo), foo->RefCnt() - 1,
AssertEqual(foo->ID(), aElementIDs[index]));
foo->Release();
}

View File

@ -89,7 +89,8 @@ public:
void LogAction(Object* aObj, const char* aAction) {
if (logging) {
printf("%d %p(%d): %s\n", PR_IntervalNow(), aObj, aObj->mLastUsed, aAction);
printf("%d %p(%d): %s\n", PR_IntervalNow(),
static_cast<void*>(aObj), aObj->mLastUsed, aAction);
}
}

View File

@ -404,7 +404,7 @@ XPT_DumpInterfaceDirectoryEntry(XPTCursor *cursor,
fprintf(stdout, "%*sNamespace: %s\n",
indent, " ", ide->name_space ? ide->name_space : "none");
fprintf(stdout, "%*sAddress of interface descriptor: %p\n",
indent, " ", ide->interface_descriptor);
indent, " ", (void*)(ide->interface_descriptor));
fprintf(stdout, "%*sDescriptor:\n", indent, " ");