Fixing warnings and style.

This commit is contained in:
Ben Vanik
2015-05-09 18:13:19 -07:00
parent 5954d23438
commit 21edd65354
10 changed files with 27 additions and 30 deletions

View File

@@ -182,7 +182,7 @@ LRESULT CALLBACK Win32Control::WndProcThunk(HWND hWnd, UINT message,
if (message == WM_NCCREATE) {
auto create_struct = reinterpret_cast<LPCREATESTRUCT>(lParam);
control = reinterpret_cast<Win32Control*>(create_struct->lpCreateParams);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (__int3264)(LONG_PTR) control);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (__int3264)(LONG_PTR)control);
} else {
control =
reinterpret_cast<Win32Control*>(GetWindowLongPtr(hWnd, GWLP_USERDATA));

View File

@@ -52,7 +52,7 @@ class Win32Control : public Control {
void OnResize(UIEvent& e) override;
static LRESULT CALLBACK
WndProcThunk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
WndProcThunk(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
virtual LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam);

View File

@@ -27,8 +27,7 @@ Win32MenuItem::Win32MenuItem(Type type, int id, const std::wstring& text)
}
}
Win32MenuItem::Win32MenuItem(Type type)
: Win32MenuItem(type, 0, L"") {}
Win32MenuItem::Win32MenuItem(Type type) : Win32MenuItem(type, 0, L"") {}
Win32MenuItem::Win32MenuItem(Type type, const std::wstring& text)
: Win32MenuItem(type, 0, text) {}
@@ -44,8 +43,9 @@ void Win32MenuItem::OnChildAdded(MenuItem* generic_child_item) {
switch (child_item->type()) {
case MenuItem::Type::kPopup:
AppendMenuW(handle_, MF_POPUP, (UINT)child_item->handle(),
child_item->text().c_str());
AppendMenuW(handle_, MF_POPUP,
reinterpret_cast<UINT_PTR>(child_item->handle()),
child_item->text().c_str());
break;
case MenuItem::Type::kSeparator:
AppendMenuW(handle_, MF_SEPARATOR, child_item->id(), 0);

View File

@@ -22,8 +22,8 @@ namespace win32 {
class Win32MenuItem : public MenuItem {
public:
Win32MenuItem(Type type);
Win32MenuItem(Type type, const std::wstring &text);
Win32MenuItem(Type type, int id, const std::wstring &text);
Win32MenuItem(Type type, const std::wstring& text);
Win32MenuItem(Type type, int id, const std::wstring& text);
~Win32MenuItem() override;
HMENU handle() { return handle_; }
@@ -34,9 +34,8 @@ class Win32MenuItem : public MenuItem {
void OnChildRemoved(MenuItem* child_item) override;
private:
HMENU handle_;
uint32_t position_; // Position within parent, if any
uint32_t position_; // Position within parent, if any
int id_;
};

View File

@@ -203,10 +203,8 @@ LRESULT Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam,
TABLET_DISABLE_TOUCHUIFORCEON | TABLET_ENABLE_MULTITOUCHDATA;
case WM_COMMAND: {
OnCommand(LOWORD(wParam));
break;
}
break;
OnCommand(LOWORD(wParam));
} break;
}
return Win32Control::WndProc(hWnd, message, wParam, lParam);