comparison dmd/RealExp.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 cab4c37afb89
children ef02e2e203c2
comparison
equal deleted inserted replaced
71:8e24ef1dd139 72:2e2a5c3f943a
31 //printf("RealExp.RealExp(%Lg)\n", value); 31 //printf("RealExp.RealExp(%Lg)\n", value);
32 this.value = value; 32 this.value = value;
33 this.type = type; 33 this.type = type;
34 } 34 }
35 35
36 bool equals(Object o) 36 override bool equals(Object o)
37 { 37 {
38 assert(false); 38 assert(false);
39 } 39 }
40 40
41 Expression semantic(Scope sc) 41 override Expression semantic(Scope sc)
42 { 42 {
43 if (!type) 43 if (!type)
44 type = Type.tfloat64; 44 type = Type.tfloat64;
45 else 45 else
46 type = type.semantic(loc, sc); 46 type = type.semantic(loc, sc);
47 return this; 47 return this;
48 } 48 }
49 49
50 Expression interpret(InterState istate) 50 override Expression interpret(InterState istate)
51 { 51 {
52 assert(false); 52 assert(false);
53 } 53 }
54 54
55 string toChars() 55 override string toChars()
56 { 56 {
57 assert(false); 57 assert(false);
58 } 58 }
59 59
60 ulong toInteger() 60 override ulong toInteger()
61 { 61 {
62 assert(false); 62 assert(false);
63 } 63 }
64 64
65 ulong toUInteger() 65 override ulong toUInteger()
66 { 66 {
67 assert(false); 67 assert(false);
68 } 68 }
69 69
70 real toReal() 70 override real toReal()
71 { 71 {
72 return type.isreal() ? value : 0; 72 return type.isreal() ? value : 0;
73 } 73 }
74 74
75 real toImaginary() 75 override real toImaginary()
76 { 76 {
77 return type.isreal() ? 0 : value; 77 return type.isreal() ? 0 : value;
78 } 78 }
79 79
80 Complex!(real) toComplex() 80 override Complex!(real) toComplex()
81 { 81 {
82 return Complex!(real)(toReal(), toImaginary()); 82 return Complex!(real)(toReal(), toImaginary());
83 } 83 }
84 84
85 Expression castTo(Scope sc, Type t) 85 override Expression castTo(Scope sc, Type t)
86 { 86 {
87 Expression e = this; 87 Expression e = this;
88 if (type != t) 88 if (type != t)
89 { 89 {
90 if ((type.isreal() && t.isreal()) || 90 if ((type.isreal() && t.isreal()) ||
98 e = Expression.castTo(sc, t); 98 e = Expression.castTo(sc, t);
99 } 99 }
100 return e; 100 return e;
101 } 101 }
102 102
103 int isConst() 103 override int isConst()
104 { 104 {
105 return 1; 105 return 1;
106 } 106 }
107 107
108 bool isBool(bool result) 108 override bool isBool(bool result)
109 { 109 {
110 assert(false); 110 assert(false);
111 } 111 }
112 112
113 void toCBuffer(OutBuffer buf, HdrGenState* hgs) 113 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
114 { 114 {
115 assert(false); 115 assert(false);
116 } 116 }
117 117
118 void toMangleBuffer(OutBuffer buf) 118 override void toMangleBuffer(OutBuffer buf)
119 { 119 {
120 assert(false); 120 assert(false);
121 } 121 }
122 122
123 elem* toElem(IRState* irs) 123 override elem* toElem(IRState* irs)
124 { 124 {
125 eve c; 125 eve c;
126 tym_t ty; 126 tym_t ty;
127 127
128 //printf("RealExp.toElem(%p) %s\n", this, toChars()); 128 //printf("RealExp.toElem(%p) %s\n", this, toChars());
164 return el_const(ty, &c); 164 return el_const(ty, &c);
165 } 165 }
166 166
167 static private char[6] zeropad; 167 static private char[6] zeropad;
168 168
169 dt_t** toDt(dt_t** pdt) 169 override dt_t** toDt(dt_t** pdt)
170 { 170 {
171 float fvalue; 171 float fvalue;
172 double dvalue; 172 double dvalue;
173 real evalue; 173 real evalue;
174 174