comparison dmd/ArrayInitializer.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 35afd9294854
children ef02e2e203c2
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
37 super(loc); 37 super(loc);
38 index = new Expressions(); 38 index = new Expressions();
39 value = new Initializers(); 39 value = new Initializers();
40 } 40 }
41 41
42 Initializer syntaxCopy() 42 override Initializer syntaxCopy()
43 { 43 {
44 //printf("ArrayInitializer.syntaxCopy()\n"); 44 //printf("ArrayInitializer.syntaxCopy()\n");
45 45
46 ArrayInitializer ai = new ArrayInitializer(loc); 46 ArrayInitializer ai = new ArrayInitializer(loc);
47 47
68 this.value.push(cast(void*)value); 68 this.value.push(cast(void*)value);
69 dim = 0; 69 dim = 0;
70 type = null; 70 type = null;
71 } 71 }
72 72
73 Initializer semantic(Scope sc, Type t) 73 override Initializer semantic(Scope sc, Type t)
74 { 74 {
75 uint i; 75 uint i;
76 uint length; 76 uint length;
77 77
78 //printf("ArrayInitializer.semantic(%s)\n", t.toChars()); 78 //printf("ArrayInitializer.semantic(%s)\n", t.toChars());
123 error(loc, "array dimension %u exceeds max of %ju", dim, amax / t.nextOf().size()); 123 error(loc, "array dimension %u exceeds max of %ju", dim, amax / t.nextOf().size());
124 124
125 return this; 125 return this;
126 } 126 }
127 127
128 Type inferType(Scope sc) 128 override Type inferType(Scope sc)
129 { 129 {
130 //printf("ArrayInitializer.inferType() %s\n", toChars()); 130 //printf("ArrayInitializer.inferType() %s\n", toChars());
131 type = Type.terror; 131 type = Type.terror;
132 for (size_t i = 0; i < value.dim; i++) 132 for (size_t i = 0; i < value.dim; i++)
133 { 133 {
157 } 157 }
158 158
159 /******************************** 159 /********************************
160 * If possible, convert array initializer to array literal. 160 * If possible, convert array initializer to array literal.
161 */ 161 */
162 Expression toExpression() 162 override Expression toExpression()
163 { 163 {
164 Expression e; 164 Expression e;
165 165
166 //printf("ArrayInitializer.toExpression(), dim = %d\n", dim); 166 //printf("ArrayInitializer.toExpression(), dim = %d\n", dim);
167 //static int i; if (++i == 2) halt(); 167 //static int i; if (++i == 2) halt();
246 Initializer toAssocArrayInitializer() 246 Initializer toAssocArrayInitializer()
247 { 247 {
248 assert(false); 248 assert(false);
249 } 249 }
250 250
251 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 251 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
252 { 252 {
253 assert(false); 253 assert(false);
254 } 254 }
255 255
256 dt_t* toDt() 256 override dt_t* toDt()
257 { 257 {
258 //printf("ArrayInitializer.toDt('%s')\n", toChars()); 258 //printf("ArrayInitializer.toDt('%s')\n", toChars());
259 Type tb = type.toBasetype(); 259 Type tb = type.toBasetype();
260 Type tn = tb.nextOf().toBasetype(); 260 Type tn = tb.nextOf().toBasetype();
261 261
367 dt_t* toDtBit() // for bit arrays 367 dt_t* toDtBit() // for bit arrays
368 { 368 {
369 assert(false); 369 assert(false);
370 } 370 }
371 371
372 ArrayInitializer isArrayInitializer() { return this; } 372 override ArrayInitializer isArrayInitializer() { return this; }
373 } 373 }