From 64e6441d9c017663df134b1b02324295e0450baf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 29 Aug 2018 08:31:08 +0200 Subject: Windows code: Fix clang-tidy warnings about C-style casts Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira --- src/widgets/dialogs/qwizard_win.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/dialogs/qwizard_win.cpp') diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp index 5ef304c9f1..aa9ad7f290 100644 --- a/src/widgets/dialogs/qwizard_win.cpp +++ b/src/widgets/dialogs/qwizard_win.cpp @@ -606,8 +606,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q // Set up the DC const LOGFONT captionLogFont = getCaptionLogFont(hTheme); const HFONT hCaptionFont = CreateFontIndirect(&captionLogFont); - HBITMAP hOldBmp = (HBITMAP)SelectObject(dcMem, (HGDIOBJ) bmp); - HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont); + auto hOldBmp = reinterpret_cast(SelectObject(dcMem, (HGDIOBJ) bmp)); + auto hOldFont = reinterpret_cast(SelectObject(dcMem, (HGDIOBJ) hCaptionFont)); // Draw the text! DTTOPTS dto; @@ -654,7 +654,7 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc) dib.bmiHeader.biCompression = BI_RGB; bmp = CreateDIBSection(hdc, &dib, DIB_RGB_COLORS, NULL, NULL, 0); - HBITMAP hOldBmp = (HBITMAP)SelectObject(dcMem, (HGDIOBJ) bmp); + auto hOldBmp = reinterpret_cast(SelectObject(dcMem, (HGDIOBJ) bmp)); BitBlt(hdc, rectDp.left(), rectDp.top(), rectDp.width(), rectDp.height(), dcMem, 0, 0, SRCCOPY); SelectObject(dcMem, (HGDIOBJ) hOldBmp); -- cgit v1.2.3