From ec4efb9730d205cce09277844521ac2ed6288778 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 31 Jan 2020 10:28:07 +1100 Subject: Use more typesafe functions to remove casts. --- win32/PlatWin.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'win32/PlatWin.h') diff --git a/win32/PlatWin.h b/win32/PlatWin.h index 62b87fa3c..6fb8ff5f1 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -19,6 +19,14 @@ constexpr RECT RectFromPRectangle(PRectangle prc) noexcept { return rc; } +constexpr HWND HwndFromWindowID(WindowID wid) noexcept { + return static_cast(wid); +} + +inline HWND HwndFromWindow(const Window &w) noexcept { + return HwndFromWindowID(w.GetID()); +} + #if defined(USE_D2D) extern bool LoadD2D(); extern ID2D1Factory *pD2DFactory; -- cgit v1.2.3