Fix lint errors

This commit is contained in:
Andreas Flöjt 2017-08-03 23:23:42 +02:00
parent 12dbcfa2ea
commit 0736de1e8d
2 changed files with 14 additions and 7 deletions

View file

@ -171,8 +171,11 @@ class NativeWindowViews : public NativeWindow,
bool PreHandleMSG( bool PreHandleMSG(
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) override; UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) override;
void HandleSizeEvent(WPARAM w_param, LPARAM l_param); void HandleSizeEvent(WPARAM w_param, LPARAM l_param);
static LRESULT CALLBACK SubclassProc(HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param, UINT_PTR subclass_id, DWORD_PTR ref_data); static LRESULT CALLBACK SubclassProc(
static LRESULT CALLBACK MouseHookProc(int n_code, WPARAM w_param, LPARAM l_param); HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param, UINT_PTR subclass_id,
DWORD_PTR ref_data);
static LRESULT CALLBACK MouseHookProc(
int n_code, WPARAM w_param, LPARAM l_param);
#endif #endif
// NativeWindow: // NativeWindow:

View file

@ -165,7 +165,8 @@ bool NativeWindowViews::PreHandleMSG(
// Chromium removes the legacy window in the future it may be fine to // Chromium removes the legacy window in the future it may be fine to
// move the logic to this very switch statement. // move the logic to this very switch statement.
HWND legacy_window = reinterpret_cast<HWND>(l_param); HWND legacy_window = reinterpret_cast<HWND>(l_param);
SetWindowSubclass(legacy_window, SubclassProc, 1, reinterpret_cast<DWORD_PTR>(this)); SetWindowSubclass(
legacy_window, SubclassProc, 1, reinterpret_cast<DWORD_PTR>(this));
if (legacy_window_map_.size() == 0) { if (legacy_window_map_.size() == 0) {
mouse_hook_ = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0); mouse_hook_ = SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc, NULL, 0);
} }
@ -228,7 +229,9 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
} }
} }
LRESULT CALLBACK NativeWindowViews::SubclassProc(HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param, UINT_PTR subclass_id, DWORD_PTR ref_data) { LRESULT CALLBACK NativeWindowViews::SubclassProc(
HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param, UINT_PTR subclass_id,
DWORD_PTR ref_data) {
NativeWindowViews* window = reinterpret_cast<NativeWindowViews*>(ref_data); NativeWindowViews* window = reinterpret_cast<NativeWindowViews*>(ref_data);
switch (msg) { switch (msg) {
case WM_MOUSELEAVE: { case WM_MOUSELEAVE: {
@ -260,7 +263,8 @@ LRESULT CALLBACK NativeWindowViews::SubclassProc(HWND hwnd, UINT msg, WPARAM w_p
return DefSubclassProc(hwnd, msg, w_param, l_param); return DefSubclassProc(hwnd, msg, w_param, l_param);
} }
LRESULT CALLBACK NativeWindowViews::MouseHookProc(int n_code, WPARAM w_param, LPARAM l_param) { LRESULT CALLBACK NativeWindowViews::MouseHookProc(
int n_code, WPARAM w_param, LPARAM l_param) {
if (n_code < 0) { if (n_code < 0) {
return CallNextHookEx(NULL, n_code, w_param, l_param); return CallNextHookEx(NULL, n_code, w_param, l_param);
} }
@ -280,7 +284,7 @@ LRESULT CALLBACK NativeWindowViews::MouseHookProc(int n_code, WPARAM w_param, LP
// just left it as is. // just left it as is.
RECT client_rect; RECT client_rect;
GetClientRect(legacy.first, &client_rect); GetClientRect(legacy.first, &client_rect);
POINT p = ((MSLLHOOKSTRUCT*)l_param)->pt; POINT p = reinterpret_cast<MSLLHOOKSTRUCT*>(l_param)->pt;
ScreenToClient(legacy.first, &p); ScreenToClient(legacy.first, &p);
if (PtInRect(&client_rect, p)) { if (PtInRect(&client_rect, p)) {
WPARAM w = 0; // No virtual keys pressed for our purposes WPARAM w = 0; // No virtual keys pressed for our purposes