Bug 801803: More nsresult as enum class creates warnings r=me

This commit is contained in:
David Zbarsky 2012-10-15 21:00:20 -04:00
parent 158318bf31
commit 4dfd290449
5 changed files with 12 additions and 7 deletions

View File

@ -1546,7 +1546,8 @@ nsCacheService::CreateDiskDevice()
if (NS_FAILED(rv)) {
#if DEBUG
printf("###\n");
printf("### mDiskDevice->Init() failed (0x%.8x)\n", rv);
printf("### mDiskDevice->Init() failed (0x%.8x)\n",
static_cast<uint32_t>(rv));
printf("### - disabling disk cache for this session.\n");
printf("###\n");
#endif

View File

@ -34,7 +34,7 @@ public:
nsresult status)
{
printf("%d: OnLookupComplete called [host=%s status=%x rec=%p]\n",
mIndex, mHost.get(), status, (void*)rec);
mIndex, static_cast<uint32_t>(mHost.get()), status, (void*)rec);
if (NS_SUCCEEDED(status)) {
nsAutoCString buf;
@ -111,7 +111,8 @@ int main(int argc, char **argv)
nsIDNSService::RESOLVE_CANONICAL_NAME,
listener, nullptr, getter_AddRefs(req));
if (NS_FAILED(rv))
printf("### AsyncResolve failed [rv=%x]\n", rv);
printf("### AsyncResolve failed [rv=%x]\n",
static_cast<uint32_t>(rv));
}
printf("main thread sleeping for %d seconds...\n", sleepLen);

View File

@ -57,7 +57,8 @@ NS_IMETHODIMP
FetchObserver::OnStopRequest(nsIRequest *request, nsISupports *context,
nsresult status)
{
printf("FetchObserver::OnStopRequest [status=%x]\n", status);
printf("FetchObserver::OnStopRequest [status=%x]\n",
static_cast<uint32_t>(status));
QuitPumpingEvents();
return NS_OK;
@ -121,7 +122,8 @@ main(int argc, char **argv)
rv = DoIncrementalFetch(argv[1], argv[2], chunkSize, interval);
if (NS_FAILED(rv))
fprintf(stderr, "ERROR: DoIncrementalFetch failed [%x]\n", rv);
fprintf(stderr, "ERROR: DoIncrementalFetch failed [%x]\n",
static_cast<uint32_t>(rv));
NS_ShutdownXPCOM(nullptr);
return 0;

View File

@ -24,7 +24,7 @@ using namespace mozilla;
#define RETURN_IF_FAILED(rv, what) \
PR_BEGIN_MACRO \
if (NS_FAILED(rv)) { \
printf(what ": failed - %08x\n", rv); \
printf(what ": failed - %08x\n", static_cast<uint32_t>(rv)); \
return -1; \
} \
PR_END_MACRO

View File

@ -180,7 +180,8 @@ MyListener::OnDataAvailable(nsIRequest *req, nsISupports *ctxt,
}
if (NS_FAILED(rv)) {
printf(">>> stream->Read failed with rv=%x\n", rv);
printf(">>> stream->Read failed with rv=%x\n",
static_cast<uint32_t>(rv));
return rv;
}