comparison dmd/TypePointer.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 10317f0c89a5
children e28b18c23469
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
39 { 39 {
40 assert(this.classinfo == TypePointer.classinfo); 40 assert(this.classinfo == TypePointer.classinfo);
41 return cloneTo(new TypePointer(next)); 41 return cloneTo(new TypePointer(next));
42 } 42 }
43 } 43 }
44 Type syntaxCopy() 44 override Type syntaxCopy()
45 { 45 {
46 Type t = next.syntaxCopy(); 46 Type t = next.syntaxCopy();
47 if (t == next) 47 if (t == next)
48 t = this; 48 t = this;
49 else 49 else
52 t.mod = mod; 52 t.mod = mod;
53 } 53 }
54 return t; 54 return t;
55 } 55 }
56 56
57 Type semantic(Loc loc, Scope sc) 57 override Type semantic(Loc loc, Scope sc)
58 { 58 {
59 //printf("TypePointer.semantic()\n"); 59 //printf("TypePointer.semantic()\n");
60 if (deco) 60 if (deco)
61 return this; 61 return this;
62 Type n = next.semantic(loc, sc); 62 Type n = next.semantic(loc, sc);
76 next = n; 76 next = n;
77 transitive(); 77 transitive();
78 return merge(); 78 return merge();
79 } 79 }
80 80
81 ulong size(Loc loc) 81 override ulong size(Loc loc)
82 { 82 {
83 return PTRSIZE; 83 return PTRSIZE;
84 } 84 }
85 85
86 void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) 86 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod)
87 { 87 {
88 //printf("TypePointer::toCBuffer2() next = %d\n", next->ty); 88 //printf("TypePointer::toCBuffer2() next = %d\n", next->ty);
89 if (mod != this.mod) 89 if (mod != this.mod)
90 { 90 {
91 toCBuffer3(buf, hgs, mod); 91 toCBuffer3(buf, hgs, mod);
94 next.toCBuffer2(buf, hgs, this.mod); 94 next.toCBuffer2(buf, hgs, this.mod);
95 if (next.ty != Tfunction) 95 if (next.ty != Tfunction)
96 buf.writeByte('*'); 96 buf.writeByte('*');
97 } 97 }
98 98
99 MATCH implicitConvTo(Type to) 99 override MATCH implicitConvTo(Type to)
100 { 100 {
101 //printf("TypePointer.implicitConvTo(to = %s) %s\n", to.toChars(), toChars()); 101 //printf("TypePointer.implicitConvTo(to = %s) %s\n", to.toChars(), toChars());
102 102
103 if (equals(to)) 103 if (equals(to))
104 return MATCH.MATCHexact; 104 return MATCH.MATCHexact;
132 return MATCH.MATCHconvert; 132 return MATCH.MATCHconvert;
133 } 133 }
134 return MATCH.MATCHnomatch; 134 return MATCH.MATCHnomatch;
135 } 135 }
136 136
137 bool isscalar() 137 override bool isscalar()
138 { 138 {
139 return true; 139 return true;
140 } 140 }
141 141
142 Expression defaultInit(Loc loc) 142 override Expression defaultInit(Loc loc)
143 { 143 {
144 version (LOGDEFAULTINIT) { 144 version (LOGDEFAULTINIT) {
145 printf("TypePointer::defaultInit() '%s'\n", toChars()); 145 printf("TypePointer::defaultInit() '%s'\n", toChars());
146 } 146 }
147 Expression e = new NullExp(loc); 147 Expression e = new NullExp(loc);
148 e.type = this; 148 e.type = this;
149 return e; 149 return e;
150 } 150 }
151 151
152 bool isZeroInit(Loc loc) 152 override bool isZeroInit(Loc loc)
153 { 153 {
154 return true; 154 return true;
155 } 155 }
156 156
157 TypeInfoDeclaration getTypeInfoDeclaration() 157 override TypeInfoDeclaration getTypeInfoDeclaration()
158 { 158 {
159 return new TypeInfoPointerDeclaration(this); 159 return new TypeInfoPointerDeclaration(this);
160 } 160 }
161 161
162 bool hasPointers() 162 override bool hasPointers()
163 { 163 {
164 return true; 164 return true;
165 } 165 }
166 166
167 version (CPP_MANGLE) { 167 version (CPP_MANGLE) {
169 { 169 {
170 assert(false); 170 assert(false);
171 } 171 }
172 } 172 }
173 173
174 type* toCtype() 174 override type* toCtype()
175 { 175 {
176 type* tn; 176 type* tn;
177 type* t; 177 type* t;
178 178
179 //printf("TypePointer.toCtype() %s\n", toChars()); 179 //printf("TypePointer.toCtype() %s\n", toChars());