Bug 1766561 - Use proper formatting directives for LPARAM and WPARAM. r=Jamie,rkraesig

Unfortunately, while with MSVC one would use the `I` modifier to format
LPARAM/LONG_PTR, it doesn't work with clang-cl on 32-bits, because
LONG_PTR there is long, but `I` expects an int.

Differential Revision: https://phabricator.services.mozilla.com/D144916
This commit is contained in:
Mike Hommey 2022-05-03 20:49:08 +00:00
Родитель 1663cab462
Коммит f047620639
6 изменённых файлов: 85 добавлений и 57 удалений

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

@ -10,6 +10,7 @@
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/UniquePtrExtensions.h" #include "mozilla/UniquePtrExtensions.h"
#include "mozilla/WindowsVersion.h" #include "mozilla/WindowsVersion.h"
#include "nsdefs.h"
#include "nspr/prenv.h" #include "nspr/prenv.h"
#include "nsTHashMap.h" #include "nsTHashMap.h"
@ -169,8 +170,8 @@ Maybe<bool> Compatibility::OnUIAMessage(WPARAM aWParam, LPARAM aLParam) {
// The section name always ends with this suffix, which is derived from the // The section name always ends with this suffix, which is derived from the
// current thread id and the UIA message's WPARAM and LPARAM. // current thread id and the UIA message's WPARAM and LPARAM.
nsAutoString partialSectionSuffix; nsAutoString partialSectionSuffix;
partialSectionSuffix.AppendPrintf("_%08x_%08x_%08x", ::GetCurrentThreadId(), partialSectionSuffix.AppendPrintf("_%08x_%08" PRIxLPTR "_%08zx",
static_cast<DWORD>(aLParam), aWParam); ::GetCurrentThreadId(), aLParam, aWParam);
// Find any named Section that matches the naming convention of the UIA shared // Find any named Section that matches the naming convention of the UIA shared
// memory. // memory.

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

@ -595,7 +595,8 @@ bool IMMHandler::ProcessMessage(nsWindow* aWindow, UINT msg, WPARAM& wParam,
void IMMHandler::OnInputLangChange(nsWindow* aWindow, WPARAM wParam, void IMMHandler::OnInputLangChange(nsWindow* aWindow, WPARAM wParam,
LPARAM lParam, MSGResult& aResult) { LPARAM lParam, MSGResult& aResult) {
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnInputLangChange, hWnd=%p, wParam=%08x, lParam=%08x", ("IMMHandler::OnInputLangChange, hWnd=%p, wParam=%08zx, "
"lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), wParam, lParam)); aWindow->GetWindowHandle(), wParam, lParam));
aWindow->NotifyIME(REQUEST_TO_COMMIT_COMPOSITION); aWindow->NotifyIME(REQUEST_TO_COMMIT_COMPOSITION);
@ -627,7 +628,8 @@ bool IMMHandler::OnIMEComposition(nsWindow* aWindow, WPARAM wParam,
LPARAM lParam, MSGResult& aResult) { LPARAM lParam, MSGResult& aResult) {
MOZ_LOG( MOZ_LOG(
gIMELog, LogLevel::Info, gIMELog, LogLevel::Info,
("IMMHandler::OnIMEComposition, hWnd=%p, lParam=%08x, mIsComposing=%s, " ("IMMHandler::OnIMEComposition, hWnd=%p, lParam=%08" PRIxLPTR
", mIsComposing=%s, "
"GCS_RESULTSTR=%s, GCS_COMPSTR=%s, GCS_COMPATTR=%s, GCS_COMPCLAUSE=%s, " "GCS_RESULTSTR=%s, GCS_COMPSTR=%s, GCS_COMPATTR=%s, GCS_COMPCLAUSE=%s, "
"GCS_CURSORPOS=%s,", "GCS_CURSORPOS=%s,",
aWindow->GetWindowHandle(), lParam, GetBoolName(mIsComposing), aWindow->GetWindowHandle(), lParam, GetBoolName(mIsComposing),
@ -685,7 +687,7 @@ bool IMMHandler::OnIMEEndComposition(nsWindow* aWindow, MSGResult& aResult) {
bool IMMHandler::OnIMEChar(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, bool IMMHandler::OnIMEChar(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
MSGResult& aResult) { MSGResult& aResult) {
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMEChar, hWnd=%p, char=%08x", ("IMMHandler::OnIMEChar, hWnd=%p, char=%08zx",
aWindow->GetWindowHandle(), wParam)); aWindow->GetWindowHandle(), wParam));
// We don't need to fire any compositionchange events from here. This method // We don't need to fire any compositionchange events from here. This method
@ -716,13 +718,13 @@ bool IMMHandler::OnIMENotify(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
case IMN_CHANGECANDIDATE: case IMN_CHANGECANDIDATE:
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMENotify, hWnd=%p, IMN_CHANGECANDIDATE, " ("IMMHandler::OnIMENotify, hWnd=%p, IMN_CHANGECANDIDATE, "
"lParam=%08x", "lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), lParam)); aWindow->GetWindowHandle(), lParam));
break; break;
case IMN_CLOSECANDIDATE: case IMN_CLOSECANDIDATE:
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMENotify, hWnd=%p, IMN_CLOSECANDIDATE, " ("IMMHandler::OnIMENotify, hWnd=%p, IMN_CLOSECANDIDATE, "
"lParam=%08x", "lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), lParam)); aWindow->GetWindowHandle(), lParam));
break; break;
case IMN_CLOSESTATUSWINDOW: case IMN_CLOSESTATUSWINDOW:
@ -736,10 +738,10 @@ bool IMMHandler::OnIMENotify(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
aWindow->GetWindowHandle())); aWindow->GetWindowHandle()));
break; break;
case IMN_OPENCANDIDATE: case IMN_OPENCANDIDATE:
MOZ_LOG( MOZ_LOG(gIMELog, LogLevel::Info,
gIMELog, LogLevel::Info, ("IMMHandler::OnIMENotify, hWnd=%p, IMN_OPENCANDIDATE, "
("IMMHandler::OnIMENotify, hWnd=%p, IMN_OPENCANDIDATE, lParam=%08x", "lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), lParam)); aWindow->GetWindowHandle(), lParam));
break; break;
case IMN_OPENSTATUSWINDOW: case IMN_OPENSTATUSWINDOW:
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
@ -749,7 +751,7 @@ bool IMMHandler::OnIMENotify(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
case IMN_SETCANDIDATEPOS: case IMN_SETCANDIDATEPOS:
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMENotify, hWnd=%p, IMN_SETCANDIDATEPOS, " ("IMMHandler::OnIMENotify, hWnd=%p, IMN_SETCANDIDATEPOS, "
"lParam=%08x", "lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), lParam)); aWindow->GetWindowHandle(), lParam));
break; break;
case IMN_SETCOMPOSITIONFONT: case IMN_SETCOMPOSITIONFONT:
@ -818,7 +820,7 @@ bool IMMHandler::OnIMERequest(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
return true; return true;
default: default:
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMERequest, hWnd=%p, wParam=%08x", ("IMMHandler::OnIMERequest, hWnd=%p, wParam=%08zx",
aWindow->GetWindowHandle(), wParam)); aWindow->GetWindowHandle(), wParam));
aResult.mConsumed = false; aResult.mConsumed = false;
return true; return true;
@ -828,9 +830,10 @@ bool IMMHandler::OnIMERequest(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
// static // static
bool IMMHandler::OnIMESelect(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, bool IMMHandler::OnIMESelect(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
MSGResult& aResult) { MSGResult& aResult) {
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(
("IMMHandler::OnIMESelect, hWnd=%p, wParam=%08x, lParam=%08x", gIMELog, LogLevel::Info,
aWindow->GetWindowHandle(), wParam, lParam)); ("IMMHandler::OnIMESelect, hWnd=%p, wParam=%08zx, lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), wParam, lParam));
// not implement yet // not implement yet
aResult.mConsumed = false; aResult.mConsumed = false;
@ -841,7 +844,7 @@ bool IMMHandler::OnIMESelect(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
bool IMMHandler::OnIMESetContext(nsWindow* aWindow, WPARAM wParam, bool IMMHandler::OnIMESetContext(nsWindow* aWindow, WPARAM wParam,
LPARAM lParam, MSGResult& aResult) { LPARAM lParam, MSGResult& aResult) {
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::OnIMESetContext, hWnd=%p, %s, lParam=%08x", ("IMMHandler::OnIMESetContext, hWnd=%p, %s, lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), wParam ? "Active" : "Deactive", lParam)); aWindow->GetWindowHandle(), wParam ? "Active" : "Deactive", lParam));
aResult.mConsumed = false; aResult.mConsumed = false;
@ -902,10 +905,11 @@ bool IMMHandler::OnChar(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
WPARAM recWParam; WPARAM recWParam;
LPARAM recLParam; LPARAM recLParam;
DequeueIMECharRecords(recWParam, recLParam); DequeueIMECharRecords(recWParam, recLParam);
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(
("IMMHandler::OnChar, aWindow=%p, wParam=%08x, lParam=%08x, " gIMELog, LogLevel::Info,
"recorded: wParam=%08x, lParam=%08x", ("IMMHandler::OnChar, aWindow=%p, wParam=%08zx, lParam=%08" PRIxLPTR ", "
aWindow->GetWindowHandle(), wParam, lParam, recWParam, recLParam)); "recorded: wParam=%08zx, lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), wParam, lParam, recWParam, recLParam));
// If an unexpected char message comes, we should reset the records, // If an unexpected char message comes, we should reset the records,
// of course, this shouldn't happen. // of course, this shouldn't happen.
if (recWParam != wParam || recLParam != lParam) { if (recWParam != wParam || recLParam != lParam) {
@ -1281,7 +1285,8 @@ bool IMMHandler::HandleReconvert(nsWindow* aWindow, LPARAM lParam,
} }
*oResult = needSize; *oResult = needSize;
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::HandleReconvert, succeeded, result=%ld", *oResult)); ("IMMHandler::HandleReconvert, succeeded, result=%" PRIdLPTR,
*oResult));
return true; return true;
} }
@ -1310,9 +1315,10 @@ bool IMMHandler::HandleReconvert(nsWindow* aWindow, LPARAM lParam,
len * sizeof(WCHAR)); len * sizeof(WCHAR));
} }
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(
("IMMHandler::HandleReconvert, SUCCEEDED, pReconv=%s, result=%ld", gIMELog, LogLevel::Info,
GetReconvertStringLog(pReconv).get(), *oResult)); ("IMMHandler::HandleReconvert, SUCCEEDED, pReconv=%s, result=%" PRIdLPTR,
GetReconvertStringLog(pReconv).get(), *oResult));
return true; return true;
} }
@ -1484,9 +1490,9 @@ bool IMMHandler::HandleDocumentFeed(nsWindow* aWindow, LPARAM lParam,
if (!pReconv) { if (!pReconv) {
*oResult = needSize; *oResult = needSize;
MOZ_LOG( MOZ_LOG(gIMELog, LogLevel::Info,
gIMELog, LogLevel::Info, ("IMMHandler::HandleDocumentFeed, succeeded, result=%" PRIdLPTR,
("IMMHandler::HandleDocumentFeed, succeeded, result=%ld", *oResult)); *oResult));
return true; return true;
} }
@ -1530,7 +1536,8 @@ bool IMMHandler::HandleDocumentFeed(nsWindow* aWindow, LPARAM lParam,
paragraph.BeginReading(), len * sizeof(WCHAR)); paragraph.BeginReading(), len * sizeof(WCHAR));
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(gIMELog, LogLevel::Info,
("IMMHandler::HandleDocumentFeed, SUCCEEDED, pReconv=%s, result=%ld", ("IMMHandler::HandleDocumentFeed, SUCCEEDED, pReconv=%s, "
"result=%" PRIdLPTR,
GetReconvertStringLog(pReconv).get(), *oResult)); GetReconvertStringLog(pReconv).get(), *oResult));
return true; return true;
@ -2326,9 +2333,10 @@ nsresult IMMHandler::OnMouseButtonEvent(
// static // static
bool IMMHandler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, bool IMMHandler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
MSGResult& aResult) { MSGResult& aResult) {
MOZ_LOG(gIMELog, LogLevel::Info, MOZ_LOG(
("IMMHandler::OnKeyDownEvent, hWnd=%p, wParam=%08x, lParam=%08x", gIMELog, LogLevel::Info,
aWindow->GetWindowHandle(), wParam, lParam)); ("IMMHandler::OnKeyDownEvent, hWnd=%p, wParam=%08zx, lParam=%08" PRIxLPTR,
aWindow->GetWindowHandle(), wParam, lParam));
aResult.mConsumed = false; aResult.mConsumed = false;
switch (wParam) { switch (wParam) {
case VK_TAB: case VK_TAB:

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

@ -419,21 +419,21 @@ static const nsCString GetCharacterCodeName(WPARAM aCharCode) {
return "ZERO WIDTH NO-BREAK SPACE (0xFEFF)"_ns; return "ZERO WIDTH NO-BREAK SPACE (0xFEFF)"_ns;
default: { default: {
if (aCharCode < ' ' || (aCharCode >= 0x80 && aCharCode < 0xA0)) { if (aCharCode < ' ' || (aCharCode >= 0x80 && aCharCode < 0xA0)) {
return nsPrintfCString("control (0x%04X)", aCharCode); return nsPrintfCString("control (0x%04zX)", aCharCode);
} }
if (NS_IS_HIGH_SURROGATE(aCharCode)) { if (NS_IS_HIGH_SURROGATE(aCharCode)) {
return nsPrintfCString("high surrogate (0x%04X)", aCharCode); return nsPrintfCString("high surrogate (0x%04zX)", aCharCode);
} }
if (NS_IS_LOW_SURROGATE(aCharCode)) { if (NS_IS_LOW_SURROGATE(aCharCode)) {
return nsPrintfCString("low surrogate (0x%04X)", aCharCode); return nsPrintfCString("low surrogate (0x%04zX)", aCharCode);
} }
return IS_IN_BMP(aCharCode) return IS_IN_BMP(aCharCode)
? nsPrintfCString( ? nsPrintfCString(
"'%s' (0x%04X)", "'%s' (0x%04zX)",
NS_ConvertUTF16toUTF8(nsAutoString(aCharCode)).get(), NS_ConvertUTF16toUTF8(nsAutoString(aCharCode)).get(),
aCharCode) aCharCode)
: nsPrintfCString( : nsPrintfCString(
"'%s' (0x%08X)", "'%s' (0x%08zX)",
NS_ConvertUTF16toUTF8(nsAutoString(aCharCode)).get(), NS_ConvertUTF16toUTF8(nsAutoString(aCharCode)).get(),
aCharCode); aCharCode);
} }
@ -555,7 +555,7 @@ static const nsCString GetMessageName(UINT aMessage) {
static const nsCString GetVirtualKeyCodeName(WPARAM aVK) { static const nsCString GetVirtualKeyCodeName(WPARAM aVK) {
if (aVK >= ArrayLength(kVirtualKeyName)) { if (aVK >= ArrayLength(kVirtualKeyName)) {
return nsPrintfCString("Invalid (0x%08X)", aVK); return nsPrintfCString("Invalid (0x%08zX)", aVK);
} }
return nsCString(kVirtualKeyName[aVK]); return nsCString(kVirtualKeyName[aVK]);
} }
@ -667,7 +667,7 @@ static const nsCString GetAppCommandName(WPARAM aCommand) {
case APPCOMMAND_VOLUME_UP: case APPCOMMAND_VOLUME_UP:
return "APPCOMMAND_VOLUME_UP"_ns; return "APPCOMMAND_VOLUME_UP"_ns;
default: default:
return nsPrintfCString("Unknown app command (0x%08X)", aCommand); return nsPrintfCString("Unknown app command (0x%08zX)", aCommand);
} }
} }
@ -680,7 +680,8 @@ static const nsCString GetAppCommandDeviceName(LPARAM aDevice) {
case FAPPCOMMAND_OEM: case FAPPCOMMAND_OEM:
return "FAPPCOMMAND_OEM"_ns; return "FAPPCOMMAND_OEM"_ns;
default: default:
return nsPrintfCString("Unknown app command device (0x%04X)", aDevice); return nsPrintfCString("Unknown app command device (0x%04" PRIXLPTR ")",
aDevice);
} }
}; };
@ -723,7 +724,7 @@ class MOZ_STACK_CLASS GetAppCommandKeysName final : public nsAutoCString {
} }
if (aKeys) { if (aKeys) {
MaybeAppendSeparator(); MaybeAppendSeparator();
AppendPrintf("Unknown Flags (0x%04X)", aKeys); AppendPrintf("Unknown Flags (0x%04zX)", aKeys);
} }
if (IsEmpty()) { if (IsEmpty()) {
AssignLiteral("none (0x0000)"); AssignLiteral("none (0x0000)");
@ -749,7 +750,8 @@ static const nsCString ToString(const MSG& aMSG) {
case WM_SYSKEYDOWN: case WM_SYSKEYDOWN:
case WM_SYSKEYUP: case WM_SYSKEYUP:
result.AppendPrintf( result.AppendPrintf(
"virtual keycode=%s, repeat count=%d, " "virtual keycode=%s, repeat count=%" PRIdLPTR
", "
"scancode=0x%02X, extended key=%s, " "scancode=0x%02X, extended key=%s, "
"context code=%s, previous key state=%s, " "context code=%s, previous key state=%s, "
"transition state=%s", "transition state=%s",
@ -765,7 +767,8 @@ static const nsCString ToString(const MSG& aMSG) {
case WM_SYSCHAR: case WM_SYSCHAR:
case WM_SYSDEADCHAR: case WM_SYSDEADCHAR:
result.AppendPrintf( result.AppendPrintf(
"character code=%s, repeat count=%d, " "character code=%s, repeat count=%" PRIdLPTR
", "
"scancode=0x%02X, extended key=%s, " "scancode=0x%02X, extended key=%s, "
"context code=%s, previous key state=%s, " "context code=%s, previous key state=%s, "
"transition state=%s", "transition state=%s",
@ -778,14 +781,15 @@ static const nsCString ToString(const MSG& aMSG) {
break; break;
case WM_APPCOMMAND: case WM_APPCOMMAND:
result.AppendPrintf( result.AppendPrintf(
"window handle=0x%p, app command=%s, device=%s, dwKeys=%s", "window handle=0x%zx, app command=%s, device=%s, dwKeys=%s",
aMSG.wParam, aMSG.wParam,
GetAppCommandName(GET_APPCOMMAND_LPARAM(aMSG.lParam)).get(), GetAppCommandName(GET_APPCOMMAND_LPARAM(aMSG.lParam)).get(),
GetAppCommandDeviceName(GET_DEVICE_LPARAM(aMSG.lParam)).get(), GetAppCommandDeviceName(GET_DEVICE_LPARAM(aMSG.lParam)).get(),
GetAppCommandKeysName(GET_KEYSTATE_LPARAM(aMSG.lParam)).get()); GetAppCommandKeysName(GET_KEYSTATE_LPARAM(aMSG.lParam)).get());
break; break;
default: default:
result.AppendPrintf("wParam=%u, lParam=%u", aMSG.wParam, aMSG.lParam); result.AppendPrintf("wParam=%zu, lParam=%" PRIdLPTR, aMSG.wParam,
aMSG.lParam);
break; break;
} }
result.AppendPrintf(", hwnd=0x%p", aMSG.hwnd); result.AppendPrintf(", hwnd=0x%p", aMSG.hwnd);

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

@ -200,8 +200,10 @@ void SessionChangeObserver::OnWinEventProc(HWND aHwnd, UINT aMsg,
if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &currentSessionId)) { if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &currentSessionId)) {
isCurrentSession = Nothing(); isCurrentSession = Nothing();
} else { } else {
LOG("SessionChangeObserver::OnWinEventProc() aWParam %d aLParam %d " LOG("SessionChangeObserver::OnWinEventProc() aWParam %zu aLParam "
"currentSessionId %d this %p", "%" PRIdLPTR
" "
"currentSessionId %lu this %p",
aWParam, aLParam, currentSessionId, this); aWParam, aLParam, currentSessionId, this);
isCurrentSession = Some(static_cast<DWORD>(aLParam) == currentSessionId); isCurrentSession = Some(static_cast<DWORD>(aLParam) == currentSessionId);

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

@ -209,7 +209,7 @@ bool MouseScrollHandler::ProcessMessage(nsWindow* aWidget, UINT msg,
case WM_KEYUP: case WM_KEYUP:
MOZ_LOG(gMouseScrollLog, LogLevel::Info, MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::ProcessMessage(): aWidget=%p, " ("MouseScroll::ProcessMessage(): aWidget=%p, "
"msg=%s(0x%04X), wParam=0x%02X, ::GetMessageTime()=%d", "msg=%s(0x%04X), wParam=0x%02zX, ::GetMessageTime()=%ld",
aWidget, aWidget,
msg == WM_KEYDOWN ? "WM_KEYDOWN" msg == WM_KEYDOWN ? "WM_KEYDOWN"
: msg == WM_KEYUP ? "WM_KEYUP" : msg == WM_KEYUP ? "WM_KEYUP"
@ -374,7 +374,8 @@ void MouseScrollHandler::ProcessNativeMouseWheelMessage(nsWindow* aWidget,
MOZ_LOG(gMouseScrollLog, LogLevel::Info, MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::ProcessNativeMouseWheelMessage: aWidget=%p, " ("MouseScroll::ProcessNativeMouseWheelMessage: aWidget=%p, "
"aMessage=%s, wParam=0x%08X, lParam=0x%08X, point: { x=%d, y=%d }", "aMessage=%s, wParam=0x%08zX, lParam=0x%08" PRIXLPTR
", point: { x=%d, y=%d }",
aWidget, aWidget,
aMessage == WM_MOUSEWHEEL ? "WM_MOUSEWHEEL" aMessage == WM_MOUSEWHEEL ? "WM_MOUSEWHEEL"
: aMessage == WM_MOUSEHWHEEL ? "WM_MOUSEHWHEEL" : aMessage == WM_MOUSEHWHEEL ? "WM_MOUSEHWHEEL"
@ -494,7 +495,7 @@ bool MouseScrollHandler::ProcessNativeScrollMessage(nsWindow* aWidget,
MOZ_LOG(gMouseScrollLog, LogLevel::Info, MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::ProcessNativeScrollMessage: aWidget=%p, " ("MouseScroll::ProcessNativeScrollMessage: aWidget=%p, "
"aMessage=%s, wParam=0x%08X, lParam=0x%08X", "aMessage=%s, wParam=0x%08zX, lParam=0x%08" PRIXLPTR,
aWidget, aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL", aWidget, aMessage == WM_VSCROLL ? "WM_VSCROLL" : "WM_HSCROLL",
aWParam, aLParam)); aWParam, aLParam));
@ -552,7 +553,7 @@ void MouseScrollHandler::HandleMouseWheelMessage(nsWindow* aWidget,
MOZ_LOG( MOZ_LOG(
gMouseScrollLog, LogLevel::Info, gMouseScrollLog, LogLevel::Info,
("MouseScroll::HandleMouseWheelMessage: aWidget=%p, " ("MouseScroll::HandleMouseWheelMessage: aWidget=%p, "
"aMessage=MOZ_WM_MOUSE%sWHEEL, aWParam=0x%08X, aLParam=0x%08X", "aMessage=MOZ_WM_MOUSE%sWHEEL, aWParam=0x%08zX, aLParam=0x%08" PRIXLPTR,
aWidget, aMessage == MOZ_WM_MOUSEVWHEEL ? "V" : "H", aWParam, aLParam)); aWidget, aMessage == MOZ_WM_MOUSEVWHEEL ? "V" : "H", aWParam, aLParam));
mIsWaitingInternalMessage = false; mIsWaitingInternalMessage = false;
@ -657,7 +658,7 @@ void MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(
MOZ_LOG( MOZ_LOG(
gMouseScrollLog, LogLevel::Info, gMouseScrollLog, LogLevel::Info,
("MouseScroll::HandleScrollMessageAsMouseWheelMessage: aWidget=%p, " ("MouseScroll::HandleScrollMessageAsMouseWheelMessage: aWidget=%p, "
"aMessage=MOZ_WM_%sSCROLL, aWParam=0x%08X, aLParam=0x%08X, " "aMessage=MOZ_WM_%sSCROLL, aWParam=0x%08zX, aLParam=0x%08" PRIXLPTR ", "
"wheelEvent { mRefPoint: { x: %d, y: %d }, mDeltaX: %f, mDeltaY: %f, " "wheelEvent { mRefPoint: { x: %d, y: %d }, mDeltaX: %f, mDeltaY: %f, "
"mLineOrPageDeltaX: %d, mLineOrPageDeltaY: %d, " "mLineOrPageDeltaX: %d, mLineOrPageDeltaY: %d, "
"isShift: %s, isControl: %s, isAlt: %s, isMeta: %s }", "isShift: %s, isControl: %s, isAlt: %s, isMeta: %s }",
@ -1555,8 +1556,8 @@ nsresult MouseScrollHandler::SynthesizingEvent::Synthesize(
MOZ_LOG( MOZ_LOG(
gMouseScrollLog, LogLevel::Info, gMouseScrollLog, LogLevel::Info,
("MouseScrollHandler::SynthesizingEvent::Synthesize(): aCursorPoint: { " ("MouseScrollHandler::SynthesizingEvent::Synthesize(): aCursorPoint: { "
"x: %d, y: %d }, aWnd=0x%p, aMessage=0x%04X, aWParam=0x%08X, " "x: %d, y: %d }, aWnd=0x%p, aMessage=0x%04X, aWParam=0x%08zX, "
"aLParam=0x%08X, IsSynthesized()=%s, mStatus=%s", "aLParam=0x%08" PRIXLPTR ", IsSynthesized()=%s, mStatus=%s",
aCursorPoint.x, aCursorPoint.y, aWnd, aMessage, aWParam, aLParam, aCursorPoint.x, aCursorPoint.y, aWnd, aMessage, aWParam, aLParam,
GetBoolName(IsSynthesizing()), GetStatusName())); GetBoolName(IsSynthesizing()), GetStatusName()));
@ -1602,9 +1603,10 @@ void MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(
MOZ_LOG(gMouseScrollLog, LogLevel::Info, MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(): " ("MouseScrollHandler::SynthesizingEvent::NativeMessageReceived(): "
"aWidget=%p, aWidget->GetWindowHandle()=0x%p, mWnd=0x%p, " "aWidget=%p, aWidget->GetWindowHandle()=0x%p, mWnd=0x%p, "
"aMessage=0x%04X, aWParam=0x%08X, aLParam=0x%08X, mStatus=%s", "aMessage=0x%04X, aWParam=0x%08zX, aLParam=0x%08" PRIXLPTR
aWidget, aWidget ? aWidget->GetWindowHandle() : 0, mWnd, aMessage, ", mStatus=%s",
aWParam, aLParam, GetStatusName())); aWidget, aWidget ? aWidget->GetWindowHandle() : nullptr, mWnd,
aMessage, aWParam, aLParam, GetStatusName()));
// We failed to receive our sent message, we failed to do the job. // We failed to receive our sent message, we failed to do the job.
Finish(); Finish();

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

@ -24,6 +24,17 @@
# define VERIFY(exp) (exp) # define VERIFY(exp) (exp)
#endif // !_DEBUG #endif // !_DEBUG
// inttypes.h-like macro for LONG_PTR/LPARAM formatting.
#ifdef HAVE_64BIT_BUILD
# define PRIdLPTR "lld"
# define PRIxLPTR "llx"
# define PRIXLPTR "llX"
#else
# define PRIdLPTR "ld"
# define PRIxLPTR "lx"
# define PRIXLPTR "lX"
#endif
// Win32 logging modules: // Win32 logging modules:
// nsWindow, nsSound, and nsClipboard // nsWindow, nsSound, and nsClipboard
// //