Michael Stefaniuc : gdi32/tests: Use the standard way of allocating a struct with VLA on the stack.
Alexandre Julliard
julliard at winehq.org
Mon Aug 19 14:33:00 CDT 2013
Module: wine
Branch: master
Commit: da425748bb441bb471de728af090b10550917eff
URL: http://source.winehq.org/git/wine.git/?a=commit;h=da425748bb441bb471de728af090b10550917eff
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Mon Aug 19 11:44:18 2013 +0200
gdi32/tests: Use the standard way of allocating a struct with VLA on the stack.
---
dlls/gdi32/tests/pen.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/gdi32/tests/pen.c b/dlls/gdi32/tests/pen.c
index ed7927a..bbbb439 100644
--- a/dlls/gdi32/tests/pen.c
+++ b/dlls/gdi32/tests/pen.c
@@ -511,12 +511,8 @@ static void test_ps_userstyle(void)
LOGBRUSH lb;
HPEN pen;
INT size, i;
-
- struct
- {
- EXTLOGPEN elp;
- DWORD style_data[15];
- } ext_pen;
+ char buffer[offsetof(EXTLOGPEN, elpStyleEntry[16])];
+ EXTLOGPEN *ext_pen = (EXTLOGPEN *)buffer;
lb.lbColor = 0x00ff0000;
lb.lbStyle = BS_SOLID;
@@ -561,11 +557,11 @@ static void test_ps_userstyle(void)
pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 16, style);
ok(pen != 0, "ExtCreatePen should not fail\n");
- size = GetObject(pen, sizeof(ext_pen), &ext_pen);
+ size = GetObject(pen, sizeof(buffer), ext_pen);
expect(FIELD_OFFSET(EXTLOGPEN,elpStyleEntry[16]), size);
for(i = 0; i < 16; i++)
- expect(style[i], ext_pen.elp.elpStyleEntry[i]);
+ expect(style[i], ext_pen->elpStyleEntry[i]);
DeleteObject(pen);
}
More information about the wine-cvs
mailing list