aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index df18f928f..c17cf87a1 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -646,7 +646,7 @@ void SurfaceGDI::Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesi
BrushColour(back);
std::vector<POINT> outline;
for (size_t i=0; i<npts; i++) {
- POINT pt = POINTFromPoint(pts[i]);
+ const POINT pt = POINTFromPoint(pts[i]);
outline.push_back(pt);
}
::Polygon(hdc, &outline[0], static_cast<int>(npts));
@@ -797,8 +797,8 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig
const BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0},
{{0, 0, 0, 0}}};
void *image = nullptr;
- HBITMAP hbmMem = CreateDIBSection(hMemDC, &bpih,
- DIB_RGB_COLORS, &image, NULL, 0);
+ HBITMAP hbmMem = ::CreateDIBSection(hMemDC, &bpih,
+ DIB_RGB_COLORS, &image, {}, 0);
if (hbmMem) {
HBITMAP hbmOld = SelectBitmap(hMemDC, hbmMem);
@@ -1505,7 +1505,7 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, const Font &font_, XYPOSITION yba
}
// Explicitly creating a text layout appears a little faster
- IDWriteTextLayout *pTextLayout;
+ IDWriteTextLayout *pTextLayout = nullptr;
const HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat,
rc.Width(), rc.Height(), &pTextLayout);
if (SUCCEEDED(hr)) {
@@ -1818,8 +1818,7 @@ void Window::InvalidateRectangle(PRectangle rc) {
}
void Window::SetFont(Font &font) {
- ::SendMessage(HwndFromWindowID(wid), WM_SETFONT,
- reinterpret_cast<WPARAM>(font.GetID()), 0);
+ SetWindowFont(HwndFromWindowID(wid), font.GetID(), 0);
}
namespace {
@@ -2072,7 +2071,7 @@ void ListBoxX::SetFont(Font &font) {
}
FormatAndMetrics *pfm = static_cast<FormatAndMetrics *>(font.GetID());
fontCopy = pfm->HFont();
- ::SendMessage(lb, WM_SETFONT, reinterpret_cast<WPARAM>(fontCopy), 0);
+ SetWindowFont(lb, fontCopy, 0);
}
}
@@ -2903,7 +2902,7 @@ bool Platform::ShowAssertionPopUps(bool assertionPopUps_) {
}
void Platform::Assert(const char *c, const char *file, int line) {
- char buffer[2000];
+ char buffer[2000] {};
sprintf(buffer, "Assertion [%s] failed at %s %d%s", c, file, line, assertionPopUps ? "" : "\r\n");
if (assertionPopUps) {
const int idButton = ::MessageBoxA(0, buffer, "Assertion failure",