diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qpixmap/tst_qpixmap.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 5020cf9..8a63e25 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -92,18 +92,18 @@ void tst_QPixmap::toHBITMAP() QVERIFY(GetObject(bitmap, sizeof(BITMAP), &bitmapInfo)); - QCOMPARE(100, (int) bitmapInfo.bmWidth); - QCOMPARE(100, (int) bitmapInfo.bmHeight); + QCOMPARE(LONG(100), bitmapInfo.bmWidth); + QCOMPARE(LONG(100), bitmapInfo.bmHeight); const HDC displayDc = GetDC(0); const HDC bitmapDc = CreateCompatibleDC(displayDc); - const HBITMAP nullBitmap = (HBITMAP) SelectObject(bitmapDc, bitmap); + const HBITMAP nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap)); const COLORREF pixel = GetPixel(bitmapDc, 0, 0); - QCOMPARE((int)GetRValue(pixel), red); - QCOMPARE((int)GetGValue(pixel), green); - QCOMPARE((int)GetBValue(pixel), blue); + QCOMPARE(int(GetRValue(pixel)), red); + QCOMPARE(int(GetGValue(pixel)), green); + QCOMPARE(int(GetBValue(pixel)), blue); // Clean up SelectObject(bitmapDc, nullBitmap); @@ -261,7 +261,9 @@ void tst_QPixmap::fromHICON() const QString iconFileName = image + QStringLiteral(".ico"); QVERIFY2(QFileInfo(iconFileName).exists(), qPrintable(iconFileName)); - const HICON icon = (HICON)LoadImage(0, (wchar_t*)(iconFileName).utf16(), IMAGE_ICON, width, height, LR_LOADFROMFILE); + const HICON icon = + static_cast<HICON>(LoadImage(0, reinterpret_cast<const wchar_t *>(iconFileName.utf16()), + IMAGE_ICON, width, height, LR_LOADFROMFILE)); const QImage imageFromHICON = QtWin::fromHICON(icon).toImage(); DestroyIcon(icon); |