mirror of
https://github.com/godotengine/godot
synced 2024-09-04 22:38:28 +00:00
Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert
This commit is contained in:
parent
aee36ec01b
commit
c933eb7acc
|
@ -100,7 +100,7 @@ extern void unregister_variant_methods();
|
|||
void register_core_types() {
|
||||
|
||||
//consistency check
|
||||
ERR_FAIL_COND(sizeof(Callable) > 16);
|
||||
static_assert(sizeof(Callable) <= 16);
|
||||
|
||||
ObjectDB::setup();
|
||||
ResourceCache::setup();
|
||||
|
|
|
@ -6862,7 +6862,7 @@ void RenderingDeviceVulkan::initialize(VulkanContext *p_context) {
|
|||
max_descriptors_per_pool = GLOBAL_DEF("rendering/vulkan/descriptor_pools/max_descriptors_per_pool", 64);
|
||||
|
||||
//check to make sure DescriptorPoolKey is good
|
||||
ERR_FAIL_COND(sizeof(uint64_t) * 3 < UNIFORM_TYPE_MAX * sizeof(uint16_t));
|
||||
static_assert(sizeof(uint64_t) * 3 >= UNIFORM_TYPE_MAX * sizeof(uint16_t));
|
||||
|
||||
draw_list = NULL;
|
||||
draw_list_count = 0;
|
||||
|
|
|
@ -1172,7 +1172,7 @@ MainLoop *test() {
|
|||
|
||||
/** A character length != wchar_t may be forced, so the tests won't work */
|
||||
|
||||
ERR_FAIL_COND_V(sizeof(CharType) != sizeof(wchar_t), NULL);
|
||||
static_assert(sizeof(CharType) == sizeof(wchar_t));
|
||||
|
||||
int count = 0;
|
||||
int passed = 0;
|
||||
|
|
|
@ -2480,7 +2480,7 @@ RasterizerCanvasRD::RasterizerCanvasRD(RasterizerStorageRD *p_storage) {
|
|||
|
||||
state.time = 0;
|
||||
|
||||
ERR_FAIL_COND(sizeof(PushConstant) != 128);
|
||||
static_assert(sizeof(PushConstant) == 128);
|
||||
}
|
||||
|
||||
bool RasterizerCanvasRD::free(RID p_rid) {
|
||||
|
|
Loading…
Reference in a new issue