~ubuntu-branches/ubuntu/maverick/aspectc++/maverick

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/src/CConstant.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
  switch (oper) {
125
125
    case TOK_NOT: return !v;
126
126
    case TOK_PLUS: return +v;
127
 
    case TOK_MINUS: return -v;
 
127
    case TOK_MINUS: return -(LONG_LONG)v;
128
128
    case TOK_TILDE: return ~v;
129
129
    default: return v; /* error */
130
130
  }
143
143
  switch (oper) {
144
144
    case TOK_AND: return v1 & v2;
145
145
    case TOK_MUL: return v1 * v2;
146
 
    case TOK_DIV: return v1 / v2;
 
146
    case TOK_DIV: return (v1 && v2) ? v1 / v2 : (LONG_LONG)0;
147
147
    case TOK_EQL: return v1 == v2;
148
148
    case TOK_NEQ: return v1 != v2;
149
149
    case TOK_LEQ: return v1 <= v2;
156
156
    case TOK_ROOF: return v1 ^ v2;
157
157
    case TOK_MINUS: return v1 - v2;
158
158
    case TOK_OR_OR: return v1 || v2;
159
 
    case TOK_MODULO: return v1 % v2;
 
159
    case TOK_MODULO: return (v1 && v2) ? v1 % v2 : (LONG_LONG)0;
160
160
    case TOK_GREATER: return v1 > v2;
161
161
    case TOK_AND_AND: return v1 && v2;
162
162
    default: return v1; /* error */
167
167
  switch (oper) {
168
168
    case TOK_AND: return v1 & v2;
169
169
    case TOK_MUL: return v1 * v2;
170
 
    case TOK_DIV: return v1 / v2;
 
170
    case TOK_DIV: return (v1 && v2) ? v1 / v2 : (U_LONG_LONG)0;
171
171
    case TOK_EQL: return v1 == v2;
172
172
    case TOK_NEQ: return v1 != v2;
173
173
    case TOK_LEQ: return v1 <= v2;
180
180
    case TOK_ROOF: return v1 ^ v2;
181
181
    case TOK_MINUS: return v1 - v2;
182
182
    case TOK_OR_OR: return v1 || v2;
183
 
    case TOK_MODULO: return v1 % v2;
 
183
    case TOK_MODULO: return (v1 && v2) ? v1 % v2 : (U_LONG_LONG)0;
184
184
    case TOK_GREATER: return v1 > v2;
185
185
    case TOK_AND_AND: return v1 && v2;
186
186
    default: return v1; /* error */
190
190
long double CConstant::compute (long double v1, int oper, long double v2) const {
191
191
  switch (oper) {
192
192
    case TOK_MUL: return v1 * v2;
193
 
    case TOK_DIV: return v1 / v2;
 
193
    case TOK_DIV: return (v1 && v2) ? v1 / v2 : (long double)0.0;
194
194
    case TOK_EQL: return v1 == v2;
195
195
    case TOK_NEQ: return v1 != v2;
196
196
    case TOK_LEQ: return v1 <= v2;