From 0736de1e8d3e40aee6bcb60927c8e656617b9fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fl=C3=B6jt?= Date: Thu, 3 Aug 2017 23:23:42 +0200 Subject: [PATCH] Fix lint errors --- atom/browser/native_window_views.h | 7 +++++-- atom/browser/native_window_views_win.cc | 14 +++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 2c2a06702e..d88becef22 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -171,8 +171,11 @@ class NativeWindowViews : public NativeWindow, bool PreHandleMSG( UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) override; 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 MouseHookProc(int n_code, 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 MouseHookProc( + int n_code, WPARAM w_param, LPARAM l_param); #endif // NativeWindow: diff --git a/atom/browser/native_window_views_win.cc b/atom/browser/native_window_views_win.cc index 06b26c3888..f17712afbd 100644 --- a/atom/browser/native_window_views_win.cc +++ b/atom/browser/native_window_views_win.cc @@ -165,7 +165,8 @@ bool NativeWindowViews::PreHandleMSG( // Chromium removes the legacy window in the future it may be fine to // move the logic to this very switch statement. HWND legacy_window = reinterpret_cast(l_param); - SetWindowSubclass(legacy_window, SubclassProc, 1, reinterpret_cast(this)); + SetWindowSubclass( + legacy_window, SubclassProc, 1, reinterpret_cast(this)); if (legacy_window_map_.size() == 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(ref_data); switch (msg) { 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); } -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) { return CallNextHookEx(NULL, n_code, w_param, l_param); } @@ -280,10 +284,10 @@ LRESULT CALLBACK NativeWindowViews::MouseHookProc(int n_code, WPARAM w_param, LP // just left it as is. RECT client_rect; GetClientRect(legacy.first, &client_rect); - POINT p = ((MSLLHOOKSTRUCT*)l_param)->pt; + POINT p = reinterpret_cast(l_param)->pt; ScreenToClient(legacy.first, &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 LPARAM l = MAKELPARAM(p.x, p.y); PostMessage(legacy.first, WM_MOUSEMOVE, w, l); }