From da071d939fb5acb3bfcf197a29806d0b6b65891b Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 22 Dec 2016 15:06:25 +0100 Subject: [PATCH] msvcrt/tests: Correctly declare base class to avoid a compiler warning. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/tests/cpp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 490ddeea274..cf5e4c7d60b 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -969,7 +969,11 @@ static void test_rtti(void) void *child_class_sig0 = &child_class_sig0_vtbl[1]; void *virtual_base_class_vtbl[2] = {&virtual_base_class_rtti.object_locator}; int virtual_base_class_vbtbl[2] = {0, 0x100}; - void *virtual_base_class[2] = {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl}; + struct { + void *virtual_base[2]; + char data[0x110-sizeof(void*)]; + void *vbthis; + } virtual_base_class = { {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl} }; static const char* e_name = "name"; type_info *ti,*bti; @@ -1082,7 +1086,7 @@ static void test_rtti(void) ok(casted == (char*)&child_class+4, "failed cast to child class (%p %p)\n", casted, &child_class); casted = p__RTDynamicCast(&virtual_base_class, 0, &virtual_base_class_rtti.type_info[0], &virtual_base_class_rtti.type_info[1], 0); - ok(casted == (char*)&virtual_base_class+0x110+sizeof(void*), "failed cast to child class (%p %p)\n", casted, &virtual_base_class); + ok(casted == &virtual_base_class.vbthis, "failed cast to child class (%p %p)\n", casted, &virtual_base_class); } struct _demangle {