Mercurial > projects > ddmd
comparison dmd/EnumDeclaration.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 | 460959608115 |
children | ad4792a1cfd6 |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
61 this.loc = loc; | 61 this.loc = loc; |
62 type = new TypeEnum(this); | 62 type = new TypeEnum(this); |
63 this.memtype = memtype; | 63 this.memtype = memtype; |
64 } | 64 } |
65 | 65 |
66 Dsymbol syntaxCopy(Dsymbol s) | 66 override Dsymbol syntaxCopy(Dsymbol s) |
67 { | 67 { |
68 Type t = null; | 68 Type t = null; |
69 if (memtype) | 69 if (memtype) |
70 t = memtype.syntaxCopy(); | 70 t = memtype.syntaxCopy(); |
71 | 71 |
78 ed = new EnumDeclaration(loc, ident, t); | 78 ed = new EnumDeclaration(loc, ident, t); |
79 ScopeDsymbol.syntaxCopy(ed); | 79 ScopeDsymbol.syntaxCopy(ed); |
80 return ed; | 80 return ed; |
81 } | 81 } |
82 | 82 |
83 void semantic(Scope sc) | 83 override void semantic(Scope sc) |
84 { | 84 { |
85 Type t; | 85 Type t; |
86 Scope sce; | 86 Scope sce; |
87 | 87 |
88 //writef("EnumDeclaration.semantic(sd = %p, '%s') %s\n", sc.scopesym, sc.scopesym.toChars(), toChars()); | 88 //writef("EnumDeclaration.semantic(sd = %p, '%s') %s\n", sc.scopesym, sc.scopesym.toChars(), toChars()); |
294 if (sc != sce) | 294 if (sc != sce) |
295 sce.pop(); | 295 sce.pop(); |
296 //members.print(); | 296 //members.print(); |
297 } | 297 } |
298 | 298 |
299 bool oneMember(Dsymbol* ps) | 299 override bool oneMember(Dsymbol* ps) |
300 { | 300 { |
301 if (isAnonymous()) | 301 if (isAnonymous()) |
302 return Dsymbol.oneMembers(members, ps); | 302 return Dsymbol.oneMembers(members, ps); |
303 return Dsymbol.oneMember(ps); | 303 return Dsymbol.oneMember(ps); |
304 } | 304 } |
305 | 305 |
306 void toCBuffer(OutBuffer buf, HdrGenState* hgs) | 306 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
307 { | 307 { |
308 int i; | 308 int i; |
309 | 309 |
310 buf.writestring("enum "); | 310 buf.writestring("enum "); |
311 if (ident) | 311 if (ident) |
338 } | 338 } |
339 buf.writeByte('}'); | 339 buf.writeByte('}'); |
340 buf.writenl(); | 340 buf.writenl(); |
341 } | 341 } |
342 | 342 |
343 Type getType() | 343 override Type getType() |
344 { | 344 { |
345 return type; | 345 return type; |
346 } | 346 } |
347 | 347 |
348 string kind() | 348 override string kind() |
349 { | 349 { |
350 return "enum"; | 350 return "enum"; |
351 } | 351 } |
352 | 352 |
353 version (DMDV2) { | 353 version (DMDV2) { |
354 Dsymbol search(Loc, Identifier ident, int flags) | 354 override Dsymbol search(Loc, Identifier ident, int flags) |
355 { | 355 { |
356 //printf("%s.EnumDeclaration.search('%s')\n", toChars(), ident.toChars()); | 356 //printf("%s.EnumDeclaration.search('%s')\n", toChars(), ident.toChars()); |
357 if (scope_) | 357 if (scope_) |
358 // Try one last time to resolve this enum | 358 // Try one last time to resolve this enum |
359 semantic(scope_); | 359 semantic(scope_); |
366 } | 366 } |
367 | 367 |
368 return ScopeDsymbol.search(loc, ident, flags); | 368 return ScopeDsymbol.search(loc, ident, flags); |
369 } | 369 } |
370 } | 370 } |
371 bool isDeprecated() // is Dsymbol deprecated? | 371 override bool isDeprecated() // is Dsymbol deprecated? |
372 { | 372 { |
373 return isdeprecated; | 373 return isdeprecated; |
374 } | 374 } |
375 | 375 |
376 void emitComment(Scope sc) | 376 override void emitComment(Scope sc) |
377 { | 377 { |
378 assert(false); | 378 assert(false); |
379 } | 379 } |
380 | 380 |
381 void toDocBuffer(OutBuffer buf) | 381 override void toDocBuffer(OutBuffer buf) |
382 { | 382 { |
383 assert(false); | 383 assert(false); |
384 } | 384 } |
385 | 385 |
386 EnumDeclaration isEnumDeclaration() { return this; } | 386 override EnumDeclaration isEnumDeclaration() { return this; } |
387 | 387 |
388 void toObjFile(int multiobj) // compile to .obj file | 388 override void toObjFile(int multiobj) // compile to .obj file |
389 { | 389 { |
390 //printf("EnumDeclaration.toObjFile('%s')\n", toChars()); | 390 //printf("EnumDeclaration.toObjFile('%s')\n", toChars()); |
391 version (DMDV2) { | 391 version (DMDV2) { |
392 if (isAnonymous()) | 392 if (isAnonymous()) |
393 return; | 393 return; |
430 void toDebug() | 430 void toDebug() |
431 { | 431 { |
432 assert(false); | 432 assert(false); |
433 } | 433 } |
434 | 434 |
435 int cvMember(ubyte* p) | 435 override int cvMember(ubyte* p) |
436 { | 436 { |
437 assert(false); | 437 assert(false); |
438 } | 438 } |
439 | 439 |
440 Symbol* sinit; | 440 Symbol* sinit; |