gdiplus/tests: Get rid of some GCC11 warnings (-Warray-bounds).

don't pretend using a BITMAPINFO when only a BITMAPINFOHEADER is used

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-14 10:28:12 +01:00 committed by Alexandre Julliard
parent 224d073388
commit aa9d1bd130

View file

@ -1313,21 +1313,20 @@ static void test_GdipDrawImagePointsRect(void)
GpGraphics *graphics = NULL; GpGraphics *graphics = NULL;
GpPointF ptf[4]; GpPointF ptf[4];
GpBitmap *bm = NULL; GpBitmap *bm = NULL;
BYTE rbmi[sizeof(BITMAPINFOHEADER)];
BYTE buff[400]; BYTE buff[400];
BITMAPINFO *bmi = (BITMAPINFO*)rbmi; BITMAPINFOHEADER bmihdr;
HDC hdc = GetDC( hwnd ); HDC hdc = GetDC( hwnd );
if (!hdc) if (!hdc)
return; return;
memset(rbmi, 0, sizeof(rbmi)); memset(&bmihdr, 0, sizeof(bmihdr));
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmihdr.biSize = sizeof(BITMAPINFOHEADER);
bmi->bmiHeader.biWidth = 10; bmihdr.biWidth = 10;
bmi->bmiHeader.biHeight = 10; bmihdr.biHeight = 10;
bmi->bmiHeader.biPlanes = 1; bmihdr.biPlanes = 1;
bmi->bmiHeader.biBitCount = 32; bmihdr.biBitCount = 32;
bmi->bmiHeader.biCompression = BI_RGB; bmihdr.biCompression = BI_RGB;
status = GdipCreateBitmapFromGdiDib(bmi, buff, &bm); status = GdipCreateBitmapFromGdiDib((BITMAPINFO*)&bmihdr, buff, &bm);
expect(Ok, status); expect(Ok, status);
ok(NULL != bm, "Expected bitmap to be initialized\n"); ok(NULL != bm, "Expected bitmap to be initialized\n");
status = GdipCreateFromHDC(hdc, &graphics); status = GdipCreateFromHDC(hdc, &graphics);