mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 05:23:04 +01:00
Ensure set_format_body macro only accepts properly sized arguments
This commit is contained in:
@@ -85,9 +85,11 @@ static inline void set_format_arg_body(uint8 *args, size_t offset, uintptr_t val
|
||||
}
|
||||
|
||||
#define set_format_arg(offset, type, value) \
|
||||
set_format_arg_body(gCommonFormatArgs, offset, (uintptr_t)value, sizeof(type))
|
||||
do { static_assert(sizeof(type) <= sizeof(uintptr_t), "Type too large"); \
|
||||
set_format_arg_body(gCommonFormatArgs, offset, (uintptr_t)value, sizeof(type)); } while (0)
|
||||
|
||||
#define set_map_tooltip_format_arg(offset, type, value) \
|
||||
set_format_arg_body(gMapTooltipFormatArgs, offset, (uintptr_t)value, sizeof(type))
|
||||
do { static_assert(sizeof(type) <= sizeof(uintptr_t), "Type too large"); \
|
||||
set_format_arg_body(gMapTooltipFormatArgs, offset, (uintptr_t)value, sizeof(type)); } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user