Bug 1766561 - Use proper formatting directives in various places. r=gfx-reviewers,nika,necko-reviewers,mhowell,rkraesig,bytesized,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D144920
This commit is contained in:
Mike Hommey 2022-05-03 20:49:09 +00:00
Родитель 2d6c8fdbc6
Коммит af52d87089
15 изменённых файлов: 58 добавлений и 50 удалений

Просмотреть файл

@ -276,7 +276,7 @@ bool DeviceManagerDx::CreateCompositorDevices() {
if (int32_t sleepSec =
StaticPrefs::gfx_direct3d11_sleep_on_create_device_AtStartup()) {
printf_stderr("Attach to PID: %d\n", GetCurrentProcessId());
printf_stderr("Attach to PID: %lu\n", GetCurrentProcessId());
Sleep(sleepSec * 1000);
}

Просмотреть файл

@ -570,7 +570,7 @@ nsresult gfxDWriteFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
}
}
LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %zu hash: %8.8x%s\n",
mName.get(), charmap->SizeOfIncludingThis(moz_malloc_size_of),
charmap->mHash, mCharacterMap == charmap ? " new" : ""));
if (LOG_CMAPDATA_ENABLED()) {

Просмотреть файл

@ -109,7 +109,7 @@ ProxyStream::ProxyStream(REFIID aIID, const BYTE* aInitBuf,
#if defined(ACCESSIBILITY)
auto curActCtx = ActivationContext::GetCurrent();
if (curActCtx.isOk()) {
strActCtx.AppendPrintf("0x%p", curActCtx.unwrap());
strActCtx.AppendPrintf("0x%" PRIxPTR, curActCtx.unwrap());
} else {
strActCtx.AppendPrintf("HRESULT 0x%08lX", curActCtx.unwrapErr());
}

Просмотреть файл

@ -108,7 +108,8 @@ class ActivityMonitorSecret final {
// for all other cases, we just send back fd://<value>
default: {
mLocation.AppendPrintf("fd://%d", PR_FileDesc2NativeHandle(mFd));
mLocation.AppendLiteral("fd://");
mLocation.AppendInt(PR_FileDesc2NativeHandle(mFd));
}
} // end switch
}

Просмотреть файл

@ -2123,10 +2123,16 @@ void DataChannelConnection::HandleSendFailedEvent(
if (ssfe->ssfe_flags & ~(SCTP_DATA_SENT | SCTP_DATA_UNSENT)) {
DC_DEBUG(("(flags = %x) ", ssfe->ssfe_flags));
}
DC_DEBUG(
("message with PPID = %u, SID = %d, flags: 0x%04x due to error = 0x%08x",
ntohl(ssfe->ssfe_info.snd_ppid), ssfe->ssfe_info.snd_sid,
ssfe->ssfe_info.snd_flags, ssfe->ssfe_error));
#ifdef XP_WIN
# define PRIPPID "lu"
#else
# define PRIPPID "u"
#endif
DC_DEBUG(("message with PPID = %" PRIPPID
", SID = %d, flags: 0x%04x due to error = 0x%08x",
ntohl(ssfe->ssfe_info.snd_ppid), ssfe->ssfe_info.snd_sid,
ssfe->ssfe_info.snd_flags, ssfe->ssfe_error));
#undef PRIPPID
n = ssfe->ssfe_length - sizeof(struct sctp_send_failed_event);
for (i = 0; i < n; ++i) {
DC_DEBUG((" 0x%02x", ssfe->ssfe_data[i]));

Просмотреть файл

@ -480,7 +480,7 @@ int32_t NamedPipeInfo::DoRead() {
IsNonblocking() ? &mReadOverlapped : nullptr);
if (success) {
LOG_NPIO_DEBUG("[%s][%p] %d bytes read", __func__, this, mReadEnd);
LOG_NPIO_DEBUG("[%s][%p] %lu bytes read", __func__, this, mReadEnd);
return mReadEnd;
}
@ -552,7 +552,7 @@ int32_t NamedPipeInfo::DoWrite() {
if (success) {
mWriteBegin += bytesWritten;
LOG_NPIO_DEBUG("[%s][%p] %d bytes written", __func__, this, bytesWritten);
LOG_NPIO_DEBUG("[%s][%p] %lu bytes written", __func__, this, bytesWritten);
return bytesWritten;
}
@ -591,7 +591,7 @@ int32_t NamedPipeInfo::DoWriteContinue() {
mHasPendingWrite = false;
mWriteBegin += bytesWritten;
LOG_NPIO_DEBUG("[%s][%p] %d bytes written", __func__, this, bytesWritten);
LOG_NPIO_DEBUG("[%s][%p] %lu bytes written", __func__, this, bytesWritten);
return bytesWritten;
}

Просмотреть файл

@ -297,7 +297,7 @@ NamedPipeService::Run() {
MOZ_ASSERT(obs.get());
if (success) {
LOG_NPS_DEBUG("OnDataAvailable: obs=%p, bytes=%d", obs.get(),
LOG_NPS_DEBUG("OnDataAvailable: obs=%p, bytes=%lu", obs.get(),
bytesTransferred);
obs->OnDataAvailable(bytesTransferred, overlapped);
} else {

Просмотреть файл

@ -562,7 +562,7 @@ BOOL StopService() {
// The service can be in a stopped state but the exe still in use
// so make sure the process is really gone before proceeding
WaitForProcessExit(L"maintenanceservice.exe", 30);
LOG(("Done waiting for service stop, last service state: %d", lastState));
LOG(("Done waiting for service stop, last service state: %lu", lastState));
return lastState == SERVICE_STOPPED;
}

Просмотреть файл

@ -227,7 +227,7 @@ BOOL StartUpdateProcess(int argc, LPWSTR* argv, LPCWSTR installDir,
// Check the return code of updater.exe to make sure we get 0
DWORD returnCode;
if (GetExitCodeProcess(pi.hProcess, &returnCode)) {
LOG(("Process finished with return code %d.", returnCode));
LOG(("Process finished with return code %lu.", returnCode));
// updater returns 0 if successful.
updateWasSuccessful = (returnCode == 0);
} else {

Просмотреть файл

@ -86,7 +86,7 @@ nsresult GetActiveDHCPNetworkAdapterName(
sizeof(IP_ADAPTER_ADDRESSES);
pAddresses.resize(outBufLen / sizeof(IP_ADAPTER_ADDRESSES));
LOG(
("Trying GetAdaptersAddresses with pAddresses sized to %d and buffer "
("Trying GetAdaptersAddresses with pAddresses sized to %zu and buffer "
"length of %d",
pAddresses.size(), outBufLen));

Просмотреть файл

@ -527,7 +527,7 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[],
__FILE__, __LINE__);
} else if (PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
printf_stderr(
"\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %d\n\n",
"\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %lu\n\n",
XRE_GetProcessTypeString(), base::GetCurrentProcId());
::Sleep(GetDebugChildPauseTime());
}

Просмотреть файл

@ -338,7 +338,7 @@ void IMMHandler::InitKeyboardLayout(nsWindow* aWindow, HKL aKeyboardLayout) {
MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::InitKeyboardLayout, aKeyboardLayout=%p (\"%s\"), "
"sCodePage=%lu, sIMEProperty=%s, sIMEUIProperty=%s",
"sCodePage=%u, sIMEProperty=%s, sIMEUIProperty=%s",
aKeyboardLayout, NS_ConvertUTF16toUTF8(sIMEName).get(), sCodePage,
GetIMEGeneralPropertyName(sIMEProperty).get(),
GetIMEUIPropertyName(sIMEUIProperty).get()));
@ -982,7 +982,7 @@ void IMMHandler::HandleStartComposition(nsWindow* aWindow,
MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::HandleStartComposition, START composition, "
"mCompositionStart=%ld",
"mCompositionStart=%u",
mCompositionStart));
}
@ -1163,7 +1163,7 @@ bool IMMHandler::HandleComposition(nsWindow* aWindow,
mClauseArray.SetLength(std::max<long>(0, clauseArrayLength));
MOZ_LOG(gIMELog, LogLevel::Info,
(" IMMHandler::HandleComposition, GCS_COMPCLAUSE, mClauseLength=%ld",
(" IMMHandler::HandleComposition, GCS_COMPCLAUSE, mClauseLength=%zu",
mClauseArray.Length()));
//--------------------------------------------------------
@ -1189,7 +1189,7 @@ bool IMMHandler::HandleComposition(nsWindow* aWindow,
MOZ_LOG(
gIMELog, LogLevel::Info,
(" IMMHandler::HandleComposition, GCS_COMPATTR, mAttributeLength=%ld",
(" IMMHandler::HandleComposition, GCS_COMPATTR, mAttributeLength=%zu",
mAttributeArray.Length()));
//--------------------------------------------------------
@ -1293,7 +1293,7 @@ bool IMMHandler::HandleReconvert(nsWindow* aWindow, LPARAM lParam,
if (pReconv->dwSize < needSize) {
MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::HandleReconvert, FAILED, pReconv->dwSize=%ld, "
"needSize=%ld",
"needSize=%u",
pReconv->dwSize, needSize));
return false;
}
@ -1336,8 +1336,8 @@ bool IMMHandler::HandleQueryCharPosition(nsWindow* aWindow, LPARAM lParam,
}
if (pCharPosition->dwSize < sizeof(IMECHARPOSITION)) {
MOZ_LOG(gIMELog, LogLevel::Error,
("IMMHandler::HandleReconvert, FAILED, pCharPosition->dwSize=%ld, "
"sizeof(IMECHARPOSITION)=%ld",
("IMMHandler::HandleReconvert, FAILED, pCharPosition->dwSize=%lu, "
"sizeof(IMECHARPOSITION)=%zu",
pCharPosition->dwSize, sizeof(IMECHARPOSITION)));
return false;
}
@ -1351,7 +1351,7 @@ bool IMMHandler::HandleQueryCharPosition(nsWindow* aWindow, LPARAM lParam,
if (pCharPosition->dwCharPos > len) {
MOZ_LOG(gIMELog, LogLevel::Error,
("IMMHandler::HandleQueryCharPosition, FAILED, "
"pCharPosition->dwCharPos=%ld, len=%ld",
"pCharPosition->dwCharPos=%ld, len=%u",
pCharPosition->dwCharPos, len));
return false;
}
@ -1500,7 +1500,7 @@ bool IMMHandler::HandleDocumentFeed(nsWindow* aWindow, LPARAM lParam,
if (pReconv->dwSize < needSize) {
MOZ_LOG(gIMELog, LogLevel::Error,
("IMMHandler::HandleDocumentFeed, FAILED, "
"pReconv->dwSize=%ld, needSize=%ld",
"pReconv->dwSize=%ld, needSize=%u",
pReconv->dwSize, needSize));
return false;
}
@ -1661,8 +1661,8 @@ void IMMHandler::DispatchCompositionChangeEvent(nsWindow* aWindow,
if (current > mCompositionString.Length()) {
MOZ_LOG(gIMELog, LogLevel::Info,
(" IMMHandler::DispatchCompositionChangeEvent, "
"mClauseArray[%ld]=%lu. "
"This is larger than mCompositionString.Length()=%lu",
"mClauseArray[%u]=%u. "
"This is larger than mCompositionString.Length()=%zu",
i + 1, current, mCompositionString.Length()));
current = int32_t(mCompositionString.Length());
}
@ -1688,8 +1688,8 @@ void IMMHandler::DispatchCompositionChangeEvent(nsWindow* aWindow,
lastOffset = current;
MOZ_LOG(gIMELog, LogLevel::Info,
(" IMMHandler::DispatchCompositionChangeEvent, index=%ld, "
"rangeType=%s, range length=%lu",
(" IMMHandler::DispatchCompositionChangeEvent, index=%u, "
"rangeType=%s, range length=%u",
i, ToChar(textRangeType), length));
}
}
@ -1701,8 +1701,8 @@ void IMMHandler::DispatchCompositionChangeEvent(nsWindow* aWindow,
uint32_t cursor = static_cast<uint32_t>(mCursorPosition);
if (cursor > mCompositionString.Length()) {
MOZ_LOG(gIMELog, LogLevel::Info,
(" IMMHandler::CreateTextRangeArray, mCursorPosition=%ld. "
"This is larger than mCompositionString.Length()=%lu",
(" IMMHandler::CreateTextRangeArray, mCursorPosition=%d. "
"This is larger than mCompositionString.Length()=%zu",
mCursorPosition, mCompositionString.Length()));
cursor = mCompositionString.Length();
}
@ -1905,7 +1905,7 @@ bool IMMHandler::GetCharacterRectOfSelectedTextAt(
MOZ_LOG(
gIMELog, LogLevel::Debug,
("IMMHandler::GetCharacterRectOfSelectedTextAt, Succeeded, "
"aOffset=%u, aCharRect={ x: %ld, y: %ld, width: %ld, height: %ld }, "
"aOffset=%u, aCharRect={ x: %d, y: %d, width: %d, height: %d }, "
"queryTextRectEvent={ mReply=%s }",
aOffset, aCharRect.X(), aCharRect.Y(), aCharRect.Width(),
aCharRect.Height(), ToString(queryTextRectEvent.mReply).c_str()));
@ -1939,7 +1939,7 @@ bool IMMHandler::GetCaretRect(nsWindow* aWindow,
}
MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::GetCaretRect, SUCCEEDED, "
"aCaretRect={ x: %ld, y: %ld, width: %ld, height: %ld }, "
"aCaretRect={ x: %d, y: %d, width: %d, height: %d }, "
"queryCaretRectEvent={ mReply=%s }",
aCaretRect.X(), aCaretRect.Y(), aCaretRect.Width(),
aCaretRect.Height(), ToString(queryCaretRectEvent.mReply).c_str()));
@ -2316,8 +2316,8 @@ nsresult IMMHandler::OnMouseButtonEvent(
}
MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnMouseButtonEvent, x,y=%ld,%ld, offset=%ld, "
"positioning=%ld",
("IMMHandler::OnMouseButtonEvent, x,y=%d,%d, offset=%d, "
"positioning=%d",
cursorPos.x, cursorPos.y, offset, positioning));
// send MS_MSIME_MOUSE message to default IME window.

Просмотреть файл

@ -4208,9 +4208,9 @@ nsCString KeyboardLayout::GetLayoutName(HKL aLayout) const {
// language) or 0xEYYYXXXX (IMM-IME), we can retrieve its name simply.
if (layout < 0xA000 || (layout & 0xF000) == 0xE000) {
nsAutoString key(kKeyboardLayouts);
key.AppendPrintf("%08X", layout < 0xA000
? layout
: reinterpret_cast<uintptr_t>(aLayout));
key.AppendPrintf("%08" PRIXPTR, layout < 0xA000
? layout
: reinterpret_cast<uintptr_t>(aLayout));
wchar_t buf[256];
if (NS_WARN_IF(!WinUtils::GetRegistryKey(
HKEY_LOCAL_MACHINE, key.get(), L"Layout Text", buf, sizeof(buf)))) {
@ -4221,7 +4221,7 @@ nsCString KeyboardLayout::GetLayoutName(HKL aLayout) const {
if (NS_WARN_IF((layout & 0xF000) != 0xF000)) {
nsCString result;
result.AppendPrintf("Odd HKL: 0x%08X",
result.AppendPrintf("Odd HKL: 0x%08" PRIXPTR,
reinterpret_cast<uintptr_t>(aLayout));
return result;
}

Просмотреть файл

@ -2378,7 +2378,7 @@ void TSFTextStore::FlushPendingActions() {
MOZ_LOG(gIMELog, LogLevel::Debug,
("0x%p TSFTextStore::FlushPendingActions() "
"flushing Type::eCompositionUpdate={ mData=\"%s\", "
"mRanges=0x%p, mRanges->Length()=%d }",
"mRanges=0x%p, mRanges->Length()=%zu }",
this, GetEscapedUTF8String(action.mData).get(),
action.mRanges.get(),
action.mRanges ? action.mRanges->Length() : 0));
@ -4067,14 +4067,14 @@ TSFTextStore::RetrieveRequestedAttrs(ULONG ulCount, TS_ATTRVAL* paAttrVals,
if (ulCount < expectedCount) {
MOZ_LOG(gIMELog, LogLevel::Error,
("0x%p TSFTextStore::RetrieveRequestedAttrs() FAILED due to "
"not enough count ulCount=%u, expectedCount=%u",
"not enough count ulCount=%lu, expectedCount=%lu",
this, ulCount, expectedCount));
return E_INVALIDARG;
}
MOZ_LOG(gIMELog, LogLevel::Info,
("0x%p TSFTextStore::RetrieveRequestedAttrs() called "
"ulCount=%d, mRequestedAttrValues=%s",
"ulCount=%lu, mRequestedAttrValues=%s",
this, ulCount, GetBoolName(mRequestedAttrValues)));
int32_t count = 0;
@ -6449,7 +6449,7 @@ void TSFTextStore::CreateNativeCaret() {
if (NS_WARN_IF(queryCaretRectEvent.Failed())) {
MOZ_LOG(gIMELog, LogLevel::Error,
("0x%p TSFTextStore::CreateNativeCaret() FAILED due to "
"eQueryCaretRect failure (offset=%d)",
"eQueryCaretRect failure (offset=%lld)",
this, caretOffset));
return;
}
@ -7267,8 +7267,8 @@ HRESULT
TSFTextStore::MouseTracker::Init(TSFTextStore* aTextStore) {
MOZ_LOG(gIMELog, LogLevel::Debug,
("0x%p TSFTextStore::MouseTracker::Init(aTextStore=0x%p), "
"aTextStore->mMouseTrackers.Length()=%d",
this, aTextStore->mMouseTrackers.Length()));
"aTextStore->mMouseTrackers.Length()=%zu",
this, aTextStore, aTextStore->mMouseTrackers.Length()));
if (&aTextStore->mMouseTrackers.LastElement() != this) {
MOZ_LOG(gIMELog, LogLevel::Error,
@ -7343,7 +7343,7 @@ TSFTextStore::MouseTracker::AdviseSink(TSFTextStore* aTextStore,
MOZ_LOG(gIMELog, LogLevel::Error,
("0x%p TSFTextStore::MouseTracker::AdviseMouseSink() FAILED "
"due to out of range, start=%ld, length=%ld, "
"textContent.Length()=%d",
"textContent.Length()=%zu",
this, start, length, textContent.Length()));
return E_INVALIDARG;
}
@ -7354,7 +7354,7 @@ TSFTextStore::MouseTracker::AdviseSink(TSFTextStore* aTextStore,
MOZ_LOG(gIMELog, LogLevel::Debug,
("0x%p TSFTextStore::MouseTracker::AdviseMouseSink(), "
"succeeded, mRange=%s, textContent.Length()=%d",
"succeeded, mRange=%s, textContent.Length()=%zu",
this, ToString(mRange).c_str(), textContent.Length()));
return S_OK;
}

Просмотреть файл

@ -1338,9 +1338,10 @@ bool MouseScrollHandler::Device::Elantech::HandleKeyMessage(nsWindow* aWidget,
// that are more easily comparable.
sZoomUntil = ::GetTickCount() & 0x7FFFFFFF;
MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::Device::Elantech::HandleKeyMessage(): sZoomUntil=%d",
sZoomUntil));
MOZ_LOG(
gMouseScrollLog, LogLevel::Info,
("MouseScroll::Device::Elantech::HandleKeyMessage(): sZoomUntil=%lu",
sZoomUntil));
}
return false;