Mercurial > projects > ddmd
comparison dmd/StructInitializer.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | f708f0452e81 |
children | 43073c7c7769 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
47 value = new Initializers(); | 47 value = new Initializers(); |
48 | 48 |
49 vars = new Array(); | 49 vars = new Array(); |
50 } | 50 } |
51 | 51 |
52 Initializer syntaxCopy() | 52 override Initializer syntaxCopy() |
53 { | 53 { |
54 StructInitializer ai = new StructInitializer(loc); | 54 StructInitializer ai = new StructInitializer(loc); |
55 | 55 |
56 assert(field.dim == value.dim); | 56 assert(field.dim == value.dim); |
57 ai.field.setDim(field.dim); | 57 ai.field.setDim(field.dim); |
73 //printf("StructInitializer.addInit(field = %p, value = %p)\n", field, value); | 73 //printf("StructInitializer.addInit(field = %p, value = %p)\n", field, value); |
74 this.field.push(cast(void*)field); | 74 this.field.push(cast(void*)field); |
75 this.value.push(cast(void*)value); | 75 this.value.push(cast(void*)value); |
76 } | 76 } |
77 | 77 |
78 Initializer semantic(Scope sc, Type t) | 78 override Initializer semantic(Scope sc, Type t) |
79 { | 79 { |
80 TypeStruct ts; | 80 TypeStruct ts; |
81 int errors = 0; | 81 int errors = 0; |
82 | 82 |
83 //printf("StructInitializer.semantic(t = %s) %s\n", t.toChars(), toChars()); | 83 //printf("StructInitializer.semantic(t = %s) %s\n", t.toChars(), toChars()); |
177 /*************************************** | 177 /*************************************** |
178 * This works by transforming a struct initializer into | 178 * This works by transforming a struct initializer into |
179 * a struct literal. In the future, the two should be the | 179 * a struct literal. In the future, the two should be the |
180 * same thing. | 180 * same thing. |
181 */ | 181 */ |
182 Expression toExpression() | 182 override Expression toExpression() |
183 { | 183 { |
184 Expression e; | 184 Expression e; |
185 | 185 |
186 //printf("StructInitializer.toExpression() %s\n", toChars()); | 186 //printf("StructInitializer.toExpression() %s\n", toChars()); |
187 if (!ad) // if fwd referenced | 187 if (!ad) // if fwd referenced |
212 delete elements; | 212 delete elements; |
213 //error(loc, "struct initializers as expressions are not allowed"); | 213 //error(loc, "struct initializers as expressions are not allowed"); |
214 return null; | 214 return null; |
215 } | 215 } |
216 | 216 |
217 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 217 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
218 { | 218 { |
219 assert(false); | 219 assert(false); |
220 } | 220 } |
221 | 221 |
222 dt_t* toDt() | 222 override dt_t* toDt() |
223 { | 223 { |
224 scope Array dts = new Array(); | 224 scope Array dts = new Array(); |
225 uint i; | 225 uint i; |
226 uint j; | 226 uint j; |
227 dt_t* dt; | 227 dt_t* dt; |
337 dtnzeros(pdtend, ad.structsize - offset); | 337 dtnzeros(pdtend, ad.structsize - offset); |
338 | 338 |
339 return dt; | 339 return dt; |
340 } | 340 } |
341 | 341 |
342 StructInitializer isStructInitializer() { return this; } | 342 override StructInitializer isStructInitializer() { return this; } |
343 } | 343 } |