From 160320f2c569842fe41b7cc8715ee81a5d2d2a16 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Mon, 17 May 2010 16:36:31 -0700 Subject: [PATCH] Bug 560393, part 2: (xpcom directory) Fix compile warning: format $f expects type $t1, but argument 2 has type $t2. r=bsmedberg --- xpcom/components/nsNativeComponentLoader.cpp | 2 +- xpcom/tests/TestCOMPtr.cpp | 2 +- xpcom/tests/TestHashtables.cpp | 16 ++++++++-------- xpcom/tests/TestRefPtr.cpp | 2 +- xpcom/typelib/xpt/tools/xpt_dump.c | 3 ++- xpcom/typelib/xpt/tools/xpt_link.c | 3 ++- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/xpcom/components/nsNativeComponentLoader.cpp b/xpcom/components/nsNativeComponentLoader.cpp index 9f77af33af5e..3b3dac7c8d75 100644 --- a/xpcom/components/nsNativeComponentLoader.cpp +++ b/xpcom/components/nsNativeComponentLoader.cpp @@ -173,7 +173,7 @@ nsNativeModuleLoader::LoadModule(nsILocalFile* aFile, nsIModule* *aResult) fprintf(stderr, "nsNativeModuleLoader::LoadModule(\"%s\") - load FAILED, " "rv: %lx, error:\n\t%s\n", - filePath.get(), rv, errorMsg); + filePath.get(), (unsigned long)rv, errorMsg); #endif return rv; diff --git a/xpcom/tests/TestCOMPtr.cpp b/xpcom/tests/TestCOMPtr.cpp index e3e833b4f2d3..ca377ba27ead 100644 --- a/xpcom/tests/TestCOMPtr.cpp +++ b/xpcom/tests/TestCOMPtr.cpp @@ -368,7 +368,7 @@ main() { printf(">>main()\n"); - printf("sizeof(nsCOMPtr) --> %d\n", sizeof(nsCOMPtr)); + printf("sizeof(nsCOMPtr) --> %u\n", unsigned(sizeof(nsCOMPtr))); TestBloat_Raw_Unsafe(); TestBloat_Smart(); diff --git a/xpcom/tests/TestHashtables.cpp b/xpcom/tests/TestHashtables.cpp index 59c76819ac52..e4740e6c3b7d 100644 --- a/xpcom/tests/TestHashtables.cpp +++ b/xpcom/tests/TestHashtables.cpp @@ -93,7 +93,7 @@ EntityNode gEntities[] = { {"macr",175} }; -#define ENTITY_COUNT (sizeof(gEntities)/sizeof(EntityNode)) +#define ENTITY_COUNT (unsigned(sizeof(gEntities)/sizeof(EntityNode))) class EntityToUnicodeEntry : public PLDHashEntryHdr { @@ -460,7 +460,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); PRUint32 i; for (i = 0; i < ENTITY_COUNT; ++i) { @@ -527,7 +527,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); for (i = 0; i < ENTITY_COUNT; ++i) { printf(" Putting entry %u...", gEntities[i].mUnicode); @@ -592,7 +592,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); for (i = 0; i < ENTITY_COUNT; ++i) { printf(" Putting entry %u...", gEntities[i].mUnicode); @@ -661,7 +661,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); for (i = 0; i < ENTITY_COUNT; ++i) { printf(" Putting entry %u...", gEntities[i].mUnicode); @@ -729,7 +729,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); nsCOMArray fooArray; @@ -805,7 +805,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); for (i = 0; i < ENTITY_COUNT; ++i) { printf(" Putting entry %u...", gEntities[i].mUnicode); @@ -879,7 +879,7 @@ main(void) { } printf("OK\n"); - printf("Filling hash with %d entries.\n", ENTITY_COUNT); + printf("Filling hash with %u entries.\n", ENTITY_COUNT); for (i = 0; i < ENTITY_COUNT; ++i) { printf(" Putting entry %u...", gEntities[i].mUnicode); diff --git a/xpcom/tests/TestRefPtr.cpp b/xpcom/tests/TestRefPtr.cpp index 3f9504be1ff4..65a35559ad45 100644 --- a/xpcom/tests/TestRefPtr.cpp +++ b/xpcom/tests/TestRefPtr.cpp @@ -368,7 +368,7 @@ main() { printf(">>main()\n"); - printf("sizeof(nsRefPtr) --> %d\n", sizeof(nsRefPtr)); + printf("sizeof(nsRefPtr) --> %u\n", unsigned(sizeof(nsRefPtr))); TestBloat_Raw_Unsafe(); TestBloat_Smart(); diff --git a/xpcom/typelib/xpt/tools/xpt_dump.c b/xpcom/typelib/xpt/tools/xpt_dump.c index ebc2747c8089..da083114b928 100644 --- a/xpcom/typelib/xpt/tools/xpt_dump.c +++ b/xpcom/typelib/xpt/tools/xpt_dump.c @@ -227,7 +227,8 @@ main(int argc, char **argv) if (flen > 0) { size_t rv = fread(whole, 1, flen, in); if (rv < flen) { - fprintf(stderr, "short read (%d vs %d)! ouch!\n", rv, flen); + fprintf(stderr, "short read (%u vs %u)! ouch!\n", + (unsigned int)rv, (unsigned int)flen); goto out; } if (ferror(in) != 0 || fclose(in) != 0) diff --git a/xpcom/typelib/xpt/tools/xpt_link.c b/xpcom/typelib/xpt/tools/xpt_link.c index c245d4a15095..76bb903ff301 100644 --- a/xpcom/typelib/xpt/tools/xpt_link.c +++ b/xpcom/typelib/xpt/tools/xpt_link.c @@ -236,7 +236,8 @@ main(int argc, char **argv) if (flen > 0) { size_t rv = fread(whole, 1, flen, in); if (rv < flen) { - fprintf(stderr, "short read (%d vs %d)! ouch!\n", rv, flen); + fprintf(stderr, "short read (%u vs %u)! ouch!\n", + (unsigned int)rv, (unsigned int)flen); return 1; } if (ferror(in) != 0 || fclose(in) != 0) {