summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHennadii Chernyshchyk <genaloner@gmail.com>2021-09-19 20:54:34 +0300
committerBastiaan Olij <mux213@gmail.com>2021-09-27 23:08:11 +1000
commit2b1100c87831e8af5f64fba7f7b4d25ab6da4f70 (patch)
treed9d6c492f9faf3b4db699339ed8fe189b8cd2576
parent7a2a7ea9e4d0507c957bf72fd3b90d2915479451 (diff)
downloadredot-cpp-2b1100c87831e8af5f64fba7f7b4d25ab6da4f70.tar.gz
Use default initialization
{ 0 } initializes only first element with zero explicitly and other elements with their default value (zeros too). Technically it will work the same, but will be more correct.
-rw-r--r--binding_generator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/binding_generator.py b/binding_generator.py
index 22ba8ba..dad8a48 100644
--- a/binding_generator.py
+++ b/binding_generator.py
@@ -238,7 +238,7 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
result.append(f"class {class_name} {{")
result.append(f"\tstatic constexpr size_t {snake_class_name}_SIZE = {size};")
- result.append(f"\tuint8_t opaque[{snake_class_name}_SIZE] {{ 0 }};")
+ result.append(f"\tuint8_t opaque[{snake_class_name}_SIZE] = {{}};")
result.append(
f"\t_FORCE_INLINE_ GDNativeTypePtr ptr() const {{ return const_cast<uint8_t (*)[{snake_class_name}_SIZE]>(&opaque); }}"
)