Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.228
 
1.229
 
MAIN:ragge:20090127171203
 
trees.c
_>13011301                 printf(" => ");
 13021302                 tprint(stdout, tu, 0);
 13031303                 printf("\n");
<> 1304+                fwalk(p, eprint, 0);
13041305         }
 13051306 #endif
 13061307 
 13071308         return(p);
 13081309         }
 13091310 
 13101311 /*
<> 1312+ * Create a float const node of zero.
  1313+ */
  1314+static NODE *
  1315+fzero(TWORD t)
  1316+{
  1317+        NODE *p = block(FCON, NIL, NIL, t, 0, MKSUE(t));
  1318+
  1319+        p->n_dcon = FLOAT_CAST(0, INT);
  1320+        return p;
  1321+}
  1322+
  1323+/*
13111324  * make p into type t by inserting a conversion
 13121325  */
 13131326 NODE *
     
 !
13211334                 return(p);
 13221335         }
 13231336 
<>1324 -        if ((p->n_type == FLOAT || p->n_type == DOUBLE || p->n_type == LDOUBLE)
 1325 -            && (t == FLOAT || t == DOUBLE || t == LDOUBLE) && p->n_op == FCON) {
 1326 -                p->n_type = t;
 1327 -                p->n_qual = q;
 1328 -                p->n_df = d;
 1329 -                p->n_sue = sue;
 1330 -                return(p);
  1337+        if (p->n_op == FCON) {
  1338+                int isf = ISFTY(t);
  1339+                NODE *r;
  1340+
  1341+                if (isf||ISITY(t)) {
  1342+                        if (isf == ISFTY(p->n_type)) {
  1343+                                p->n_type = t;
  1344+                                p->n_qual = q;
  1345+                                p->n_df = d;
  1346+                                p->n_sue = sue;
  1347+                                return(p);
  1348+                        } else if (isf == ISITY(p->n_type)) {
  1349+                                /* will be zero */
  1350+                                nfree(p);
  1351+                                return fzero(t);
  1352+                        } else if (ISCTY(p->n_type))
  1353+                                cerror("complex constant");
  1354+                } else if (ISCTY(t)) {
  1355+                        if (ISITY(p->n_type)) {
  1356+                                /* convert to correct subtype */
  1357+                                r = fzero(t - (COMPLEX-DOUBLE));
  1358+                                p->n_type = t + (IMAG-COMPLEX);
  1359+                                p->n_qual = q;
  1360+                                p->n_df = d;
  1361+                                p->n_sue = MKSUE(p->n_type);
  1362+                                return block(CM, r, p, t, 0, MKSUE(t));
  1363+                        } else if (ISFTY(p->n_type)) {
  1364+                                /* convert to correct subtype */
  1365+                                r = fzero(t + (IMAG-COMPLEX));
  1366+                                p->n_type = t - (COMPLEX-DOUBLE);
  1367+                                p->n_qual = q;
  1368+                                p->n_df = d;
  1369+                                p->n_sue = MKSUE(p->n_type);
  1370+                                return block(CM, p, r, t, 0, MKSUE(t));
  1371+                        } else if (ISCTY(p->n_type))
  1372+                                cerror("complex constant2");
  1373+                }
13311374         }
 13321375 
 13331376         if (t & TMASK) {
     
 !
13381381         }
 13391382 
 13401383         if (p->n_op == ICON) {
<>1341 -                if (t == DOUBLE || t == FLOAT) {
  1384+                if (ISFTY(t)) {
13421385                         p->n_op = FCON;
 13431386                         p->n_dcon = FLOAT_CAST(p->n_lval, p->n_type);
 13441387                         p->n_type = t;
 13451388                         p->n_qual = q;
 13461389                         p->n_sue = MKSUE(t);
 13471390                         return (clocal(p));
<>1348 -                }
  1391+                } else if (ISCTY(t) || ISITY(t))
  1392+                        cerror("complex constant3");
13491393         }
 13501394         p = block(SCONV, p, NIL, t, d, sue);
 13511395         p->n_qual = q;
     
 !
15951639         case FLOAT:
 15961640         case DOUBLE:
 15971641         case LDOUBLE:
<> 1642+#ifndef NO_COMPLEX
  1643+        case FCOMPLEX:
  1644+        case COMPLEX:
  1645+        case LCOMPLEX:
  1646+        case FIMAG:
  1647+        case IMAG:
  1648+        case LIMAG:
  1649+#endif
<_15981650                 return( MDBI );
 15991651         default:
 16001652                 return( MPTR|MPTI );
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-01 18:19 +0200