Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
2856740e
Unverified
Commit
2856740e
authored
Mar 04, 2020
by
Rémi Verschelde
Committed by
GitHub
Mar 04, 2020
Browse files
Options
Browse Files
Download
Plain Diff
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
parents
98f88a41
c933eb7a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
register_core_types.cpp
core/register_core_types.cpp
+1
-1
rendering_device_vulkan.cpp
drivers/vulkan/rendering_device_vulkan.cpp
+1
-1
test_string.cpp
main/tests/test_string.cpp
+1
-1
rasterizer_canvas_rd.cpp
servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
+1
-1
No files found.
core/register_core_types.cpp
View file @
2856740e
...
...
@@ -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
();
...
...
drivers/vulkan/rendering_device_vulkan.cpp
View file @
2856740e
...
...
@@ -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
;
...
...
main/tests/test_string.cpp
View file @
2856740e
...
...
@@ -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
;
...
...
servers/visual/rasterizer_rd/rasterizer_canvas_rd.cpp
View file @
2856740e
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment