mirror of https://github.com/OpenRCT2/OpenRCT2.git
Add compiletime asserts to verify size hasn't changed.
This commit is contained in:
parent
ff1e5c7675
commit
be97031bb9
|
@ -696,6 +696,7 @@ static void window_tile_inspector_paste_element(rct_window *w)
|
||||||
// Construct the data to send using the surface's properties
|
// Construct the data to send using the surface's properties
|
||||||
sint32 data[2];
|
sint32 data[2];
|
||||||
memcpy(&data[0], &tileInspectorCopiedElement, 8);
|
memcpy(&data[0], &tileInspectorCopiedElement, 8);
|
||||||
|
static_assert(sizeof(data) == sizeof(tileInspectorCopiedElement), "Sizes do not match");
|
||||||
|
|
||||||
game_do_command(
|
game_do_command(
|
||||||
TILE_INSPECTOR_ANY_PASTE,
|
TILE_INSPECTOR_ANY_PASTE,
|
||||||
|
|
|
@ -5644,6 +5644,7 @@ void game_command_modify_tile(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx
|
||||||
rct_map_element element_to_paste;
|
rct_map_element element_to_paste;
|
||||||
sint32 data[] = { *edx, *edi };
|
sint32 data[] = { *edx, *edi };
|
||||||
memcpy(&element_to_paste, data, 8);
|
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);
|
*ebx = tile_inspector_paste_element_at(x, y, element_to_paste, flags);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue