@@ -112,24 +112,24 @@ namespace kivm {
112112 void init (ClassFileStream &stream, cp_info **constant_pool);
113113 };
114114
115- struct ClassFile {
115+ struct ClassFile final {
116116 /* *
117117 * The magic item supplies the magic number identifying the class file format.
118118 * It has the value 0xCAFEBABE.
119119 */
120- u4 magic;
121- u2 minor_version;
122- u2 major_version;
120+ u4 magic{} ;
121+ u2 minor_version{} ;
122+ u2 major_version{} ;
123123
124- u2 constant_pool_count;
124+ u2 constant_pool_count{} ;
125125
126126 /* *
127127 * The constant_pool table is indexed
128128 * from {@code 1} to {@code constant_pool_count - 1}.
129129 */
130- cp_info **constant_pool;
130+ cp_info **constant_pool = nullptr ;
131131
132- u2 access_flags;
132+ u2 access_flags{} ;
133133
134134 /* *
135135 * The value of the {@code this_class} item must be
@@ -138,7 +138,7 @@ namespace kivm {
138138 * a {@code CONSTANT_Class_info} structure (§4.4.1)
139139 * representing the class or interface defined by this class file.
140140 */
141- u2 this_class;
141+ u2 this_class{} ;
142142
143143 /* *
144144 * For a class, the value of the {@code super_class} item either must
@@ -147,18 +147,18 @@ namespace kivm {
147147 * a {@code CONSTANT_Class_info} structure representing
148148 * the direct superclass of the class defined by this class file.
149149 */
150- u2 super_class;
150+ u2 super_class{} ;
151151
152- u2 interfaces_count;
153- u2 *interfaces;
152+ u2 interfaces_count{} ;
153+ u2 *interfaces = nullptr ;
154154
155- u2 fields_count;
156- field_info *fields;
155+ u2 fields_count{} ;
156+ field_info *fields = nullptr ;
157157
158- u2 methods_count;
159- method_info *methods;
158+ u2 methods_count{} ;
159+ method_info *methods = nullptr ;
160160
161- u2 attributes_count;
162- attribute_info **attributes;
161+ u2 attributes_count{} ;
162+ attribute_info **attributes = nullptr ;
163163 };
164164}
0 commit comments