From fc42dce87e3e276b2218b7f61f706d19cdcfdc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 24 Jan 2017 23:33:33 +0100 Subject: [PATCH] Use our own assert_struct_size macro for static assert --- src/openrct2/windows/tile_inspector.c | 2 +- src/openrct2/world/map.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/windows/tile_inspector.c b/src/openrct2/windows/tile_inspector.c index 489a5c2f95..fb0884e2d8 100644 --- a/src/openrct2/windows/tile_inspector.c +++ b/src/openrct2/windows/tile_inspector.c @@ -696,7 +696,7 @@ static void window_tile_inspector_paste_element(rct_window *w) // Construct the data to send using the surface's properties sint32 data[2]; memcpy(&data[0], &tileInspectorCopiedElement, 8); - static_assert(sizeof(data) == sizeof(tileInspectorCopiedElement), "Sizes do not match"); + assert_struct_size(data, sizeof(tileInspectorCopiedElement)); game_do_command( TILE_INSPECTOR_ANY_PASTE, diff --git a/src/openrct2/world/map.c b/src/openrct2/world/map.c index bc32c32c1b..74bae68e61 100644 --- a/src/openrct2/world/map.c +++ b/src/openrct2/world/map.c @@ -5643,8 +5643,8 @@ void game_command_modify_tile(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx { rct_map_element element_to_paste; sint32 data[] = { *edx, *edi }; + assert_struct_size(data, sizeof(element_to_paste)); memcpy(&element_to_paste, data, 8); - static_assert(sizeof(data) == sizeof(element_to_paste), "Sizes do not match"); *ebx = tile_inspector_paste_element_at(x, y, element_to_paste, flags); return; }