Merge pull request #36385 from kuruk-mm/some_static_asserts
Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert
This commit is contained in:
commit
2856740e6b
4 changed files with 4 additions and 4 deletions
|
@ -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