diff --git a/dom/media/eme/mediafoundation/WMFCDMImpl.cpp b/dom/media/eme/mediafoundation/WMFCDMImpl.cpp index 0626df6038af..21328dd4fdca 100644 --- a/dom/media/eme/mediafoundation/WMFCDMImpl.cpp +++ b/dom/media/eme/mediafoundation/WMFCDMImpl.cpp @@ -125,7 +125,7 @@ bool WMFCDMImpl::GetCapabilities(nsTArray& aOutConfigs) { ok = true; }, [](nsresult rv) { - EME_LOG("Fail to get key system capabilities. rv=%x", rv); + EME_LOG("Fail to get key system capabilities. rv=%x", uint32_t(rv)); }); } return ok; diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 2087d2439f2c..8b2b650ccd14 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -192,7 +192,8 @@ RefPtr GMPParent::Init(GeckoMediaPluginServiceParent* aService, uint32_t pluginArch = base::PROCESS_ARCH_INVALID; rv = GetPluginFileArch(aPluginDir, mName, pluginArch); if (NS_FAILED(rv)) { - GMP_PARENT_LOG_DEBUG("%s: Plugin arch error: %d", __FUNCTION__, rv); + GMP_PARENT_LOG_DEBUG("%s: Plugin arch error: %d", __FUNCTION__, + uint32_t(rv)); } else { GMP_PARENT_LOG_DEBUG("%s: Plugin arch: 0x%x", __FUNCTION__, pluginArch); } @@ -236,7 +237,8 @@ RefPtr GMPParent::Init(GeckoMediaPluginServiceParent* aService, rv = nsMacUtilsImpl::GetArchitecturesForBundle(&bundleArch); if (NS_FAILED(rv)) { // If we fail here, continue as if this is not a univeral binary. - GMP_PARENT_LOG_DEBUG("%s: Bundle arch error: %d", __FUNCTION__, rv); + GMP_PARENT_LOG_DEBUG("%s: Bundle arch error: %d", __FUNCTION__, + uint32_t(rv)); } else { GMP_PARENT_LOG_DEBUG("%s: Bundle arch: 0x%x", __FUNCTION__, bundleArch); } diff --git a/dom/media/gmp/GMPProcessParent.cpp b/dom/media/gmp/GMPProcessParent.cpp index f5ffafcce4db..7b554af993b2 100644 --- a/dom/media/gmp/GMPProcessParent.cpp +++ b/dom/media/gmp/GMPProcessParent.cpp @@ -210,7 +210,7 @@ bool GMPProcessParent::FillMacSandboxInfo(MacSandboxInfo& aInfo) { GMP_LOG_DEBUG( "GMPProcessParent::FillMacSandboxInfo: " "NS_NewLocalFile failed for plugin dir, rv=%d", - rv); + uint32_t(rv)); return false; } @@ -219,7 +219,7 @@ bool GMPProcessParent::FillMacSandboxInfo(MacSandboxInfo& aInfo) { GMP_LOG_DEBUG( "GMPProcessParent::FillMacSandboxInfo: " "failed to normalize plugin dir path, rv=%d", - rv); + uint32_t(rv)); return false; } diff --git a/dom/media/ipc/MFCDMChild.cpp b/dom/media/ipc/MFCDMChild.cpp index ab8bc93ac6bd..b16a2af37cb1 100644 --- a/dom/media/ipc/MFCDMChild.cpp +++ b/dom/media/ipc/MFCDMChild.cpp @@ -112,7 +112,7 @@ RefPtr MFCDMChild::GetCapabilities( } if (mState != NS_OK && mState != NS_ERROR_NOT_INITIALIZED) { - LOG("error=%x", nsresult(mState)); + LOG("error=%x", uint32_t(nsresult(mState))); return CapabilitiesPromise::CreateAndReject(mState, __func__); } @@ -159,7 +159,7 @@ already_AddRefed MFCDMChild::InvokeAsync( mRemotePromise->Then( mManagerThread, __func__, std::move(aCall), [self = RefPtr{this}, this, &aPromise, aCallerName](nsresult rv) { - LOG("error=%x", rv); + LOG("error=%x", uint32_t(rv)); mState = rv; aPromise.RejectIfExists(rv, aCallerName); }); @@ -182,7 +182,7 @@ RefPtr MFCDMChild::Init( } if (mState != NS_OK && mState != NS_ERROR_NOT_INITIALIZED) { - LOG("error=%x", nsresult(mState)); + LOG("error=%x", uint32_t(nsresult(mState))); return InitPromise::CreateAndReject(mState, __func__); } diff --git a/dom/media/ipc/MFCDMParent.cpp b/dom/media/ipc/MFCDMParent.cpp index 69ae556864d8..30d470ea3778 100644 --- a/dom/media/ipc/MFCDMParent.cpp +++ b/dom/media/ipc/MFCDMParent.cpp @@ -45,23 +45,23 @@ DEFINE_PROPERTYKEY(EME_CONTENTDECRYPTIONMODULE_ORIGIN_ID, 0x1218a3e2, 0xcfb0, } \ } while (false) -#define MFCDM_REJECT_IF(pred, rv) \ - do { \ - if (MOZ_UNLIKELY(pred)) { \ - MFCDM_PARENT_LOG("reject for [" #pred "], rv=%x", rv); \ - aResolver(rv); \ - return IPC_OK(); \ - } \ +#define MFCDM_REJECT_IF(pred, rv) \ + do { \ + if (MOZ_UNLIKELY(pred)) { \ + MFCDM_PARENT_LOG("reject for [" #pred "], rv=%x", uint32_t(rv)); \ + aResolver(rv); \ + return IPC_OK(); \ + } \ } while (false) -#define MFCDM_REJECT_IF_FAILED(op, rv) \ - do { \ - HRESULT hr = op; \ - if (MOZ_UNLIKELY(FAILED(hr))) { \ - MFCDM_PARENT_LOG("(" #op ") failed(hr=%lx), rv=%x", hr, rv); \ - aResolver(rv); \ - return IPC_OK(); \ - } \ +#define MFCDM_REJECT_IF_FAILED(op, rv) \ + do { \ + HRESULT hr = op; \ + if (MOZ_UNLIKELY(FAILED(hr))) { \ + MFCDM_PARENT_LOG("(" #op ") failed(hr=%lx), rv=%x", hr, uint32_t(rv)); \ + aResolver(rv); \ + return IPC_OK(); \ + } \ } while (false) // RAIIized PROPVARIANT. See diff --git a/dom/media/platforms/apple/AppleVTEncoder.cpp b/dom/media/platforms/apple/AppleVTEncoder.cpp index af91d99bcbbf..c7a7e2375e5e 100644 --- a/dom/media/platforms/apple/AppleVTEncoder.cpp +++ b/dom/media/platforms/apple/AppleVTEncoder.cpp @@ -157,7 +157,7 @@ RefPtr AppleVTEncoder::Init() { return InitPromise::CreateAndReject( MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, nsPrintfCString("fail to configurate profile level:%d", - specific.mProfileLevel)), + int(specific.mProfileLevel))), __func__); } } diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp index fef7616584a3..84e1c18381a9 100644 --- a/mozglue/android/APKOpen.cpp +++ b/mozglue/android/APKOpen.cpp @@ -288,7 +288,8 @@ Java_org_mozilla_gecko_mozglue_GeckoLoader_loadGeckoLibsNative( auto msg = errorInfo.match( [](const nsresult& aRv) { - return Smprintf("Error loading Gecko libraries: nsresult 0x%08X", aRv); + return Smprintf("Error loading Gecko libraries: nsresult 0x%08X", + uint32_t(aRv)); }, [](const DLErrorType& aErr) { return Smprintf("Error loading Gecko libraries: %s", aErr.get()); diff --git a/netwerk/socket/nsNamedPipeService.cpp b/netwerk/socket/nsNamedPipeService.cpp index 4cf41680d59b..a713a34c1d1b 100644 --- a/netwerk/socket/nsNamedPipeService.cpp +++ b/netwerk/socket/nsNamedPipeService.cpp @@ -174,7 +174,7 @@ NamedPipeService::AddDataObserver(void* aHandle, if (mObservers.Length() == 1) { rv = mThread->Dispatch(this, NS_DISPATCH_NORMAL); if (NS_WARN_IF(NS_FAILED(rv))) { - LOG_NPS_ERROR("Dispatch to thread failed (%08x)", rv); + LOG_NPS_ERROR("Dispatch to thread failed (%08x)", uint32_t(rv)); mObservers.Clear(); return rv; } diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 56c3247c571b..a64206fbc6ea 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -258,7 +258,8 @@ void nsNotifyAddrListener::calculateNetworkId(void) { mNetworkId.Truncate(); } Telemetry::Accumulate(Telemetry::NETWORK_ID2, 0); - LOG(("calculateNetworkId: no network ID Base64Encode error %X", rv)); + LOG(("calculateNetworkId: no network ID Base64Encode error %X", + uint32_t(rv))); return; } diff --git a/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp b/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp index 9ddb3bb99419..dae96cc3092f 100644 --- a/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp +++ b/toolkit/system/windowsDHCPClient/nsWindowsDHCPClient.cpp @@ -38,7 +38,7 @@ nsWindowsDHCPClient::GetOption(uint8_t aOption, nsACString& aRetVal) { LOG( ("Failed to get network adapter name in nsWindowsDHCPClient::GetOption " "due to error %d", - rv)); + uint32_t(rv))); return rv; } @@ -64,7 +64,7 @@ nsWindowsDHCPClient::GetOption(uint8_t aOption, nsACString& aRetVal) { LOG( ("Failed to get DHCP Option %d nsWindowsDHCPClient::GetOption due to " "error %d", - aOption, rv)); + aOption, uint32_t(rv))); return rv; } aRetVal.Assign(optionValue.data(), sizeOptionValue); diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index c355741c76c9..9fb1ec2263be 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -95,7 +95,7 @@ static void UpdateDriverSetupMacCommandLine(int& argc, char**& argv, LOG( ("Update driver error dispatching SetupMacCommandLine to main thread: " "%d\n", - rv)); + uint32_t(rv))); return; } diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index ca75eb319b1b..22f58cc616f0 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -291,7 +291,7 @@ class GeckoJavaSampler }, [result](nsresult aRv) { char errorString[9]; - sprintf(errorString, "%08x", aRv); + sprintf(errorString, "%08x", uint32_t(aRv)); result->CompleteExceptionally( mozilla::java::sdk::IllegalStateException::New(errorString) .Cast()); diff --git a/widget/android/ImageDecoderSupport.cpp b/widget/android/ImageDecoderSupport.cpp index f3e1c3e444a5..4418b79746f0 100644 --- a/widget/android/ImageDecoderSupport.cpp +++ b/widget/android/ImageDecoderSupport.cpp @@ -33,7 +33,7 @@ class ImageCallbackHelper : public imgIContainerCallback, NS_DECL_ISUPPORTS void CompleteExceptionally(nsresult aRv) { - nsPrintfCString error("Could not process image: 0x%08X", aRv); + nsPrintfCString error("Could not process image: 0x%08X", uint32_t(aRv)); mResult->CompleteExceptionally( java::Image::ImageProcessingException::New(error.get()) .Cast()); diff --git a/widget/windows/ScreenHelperWin.cpp b/widget/windows/ScreenHelperWin.cpp index b3a48bae23a8..8a0ec3b60838 100644 --- a/widget/windows/ScreenHelperWin.cpp +++ b/widget/windows/ScreenHelperWin.cpp @@ -127,7 +127,7 @@ BOOL CALLBACK CollectMonitors(HMONITOR aMon, HDC, LPRECT, LPARAM ioParam) { ("New screen [%s (%s) %d %u %f %f %f %d %d %d]", ToString(rect).c_str(), ToString(availRect).c_str(), pixelDepth, refreshRate, contentsScaleFactor.scale, defaultCssScaleFactor.scale, - dpi, isPseudoDisplay, orientation, angle)); + dpi, isPseudoDisplay, uint32_t(orientation), angle)); auto screen = MakeRefPtr( rect, availRect, pixelDepth, pixelDepth, refreshRate, contentsScaleFactor, defaultCssScaleFactor, dpi, Screen::IsPseudoDisplay(isPseudoDisplay), diff --git a/widget/windows/nsWindowTaskbarConcealer.cpp b/widget/windows/nsWindowTaskbarConcealer.cpp index 1863723cee01..075da707bb38 100644 --- a/widget/windows/nsWindowTaskbarConcealer.cpp +++ b/widget/windows/nsWindowTaskbarConcealer.cpp @@ -348,7 +348,7 @@ void TaskbarConcealerImpl::MarkAsHidingTaskbar(HWND aWnd, bool aMark) { if (FAILED(hr)) { MOZ_LOG(sTaskbarConcealerLog, LogLevel::Error, ("Call to PrepareFullScreen(%p, %s) failed with nsresult %x", aWnd, - sMark, hr)); + sMark, uint32_t(hr))); } }; diff --git a/xpcom/tests/gtest/TestHandleWatcher.cpp b/xpcom/tests/gtest/TestHandleWatcher.cpp index fd9f3ab95aa2..c003a026a14a 100644 --- a/xpcom/tests/gtest/TestHandleWatcher.cpp +++ b/xpcom/tests/gtest/TestHandleWatcher.cpp @@ -51,7 +51,7 @@ using HandleWatcher = mozilla::HandleWatcher; // implementation details from the MOZ_CRASH* family of macros MOZ_Crash(file, static_cast(line), MOZ_CrashPrintf("%s gave nsresult %s(%" PRIX32 ")", expr, - mozilla::GetStaticErrorName(res), res)); + mozilla::GetStaticErrorName(res), uint32_t(res))); } // UNWRAP: testing-oriented variant of Result::unwrap.