소스 검색

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.
Hennadii Chernyshchyk 3 년 전
부모
커밋
2b1100c878
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      binding_generator.py

+ 1 - 1
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); }}"
     )