Use explicit narrowing for SetWindowLongPtr()

This commit is contained in:
Robbert van der Helm
2021-04-26 18:09:28 +02:00
parent 661ea5f573
commit f6cf1a7dd2
+3 -2
View File
@@ -627,8 +627,9 @@ LRESULT CALLBACK window_proc(HWND handle,
// contains the last argument of `CreateWindowEx`, which was a // contains the last argument of `CreateWindowEx`, which was a
// pointer to the `Editor` object. We need to attach this to the // pointer to the `Editor` object. We need to attach this to the
// window handle so we can access our VST plugin instance later. // window handle so we can access our VST plugin instance later.
SetWindowLongPtr(handle, GWLP_USERDATA, SetWindowLongPtr(
reinterpret_cast<size_t>(editor)); handle, GWLP_USERDATA,
static_cast<LONG_PTR>(reinterpret_cast<size_t>(editor)));
} break; } break;
// Setting `SWP_NOCOPYBITS` somewhat reduces flickering on // Setting `SWP_NOCOPYBITS` somewhat reduces flickering on
// `fix_local_coordinates()` calls with plugins that don't do double // `fix_local_coordinates()` calls with plugins that don't do double