Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.109
 
1.110
 
MAIN:ragge:20040608210724
 
trees.c
_>699699         /* check for enumerations */
 700700         if (t1==ENUMTY || t2==ENUMTY) {
 701701                 if( clogop( p->n_op ) && p->n_op != EQ && p->n_op != NE ) {
<> 702+#ifdef notdef
  703+                /* C99 says that enums always should be handled as ints */
702704                         werror( "comparison of enums" );
<> 705+#endif
703706                         return;
 704707                         }
 705708                 if (t1==ENUMTY && t2==ENUMTY) {
<> 709+#ifdef notdef
  710+                /* C99 says that enums always should be handled as ints */
706711                         if (p->n_left->n_sue!=p->n_right->n_sue)
 707712                                 werror("enumeration type clash, "
 708713                                     "operator %s", copst(p->n_op));
<> 714+#endif
709715                         return;
 710716                 }
 711717                 if ((t1 == ENUMTY && t2 <= BTMASK) ||
     
 !
10971103 
 10981104         /* rules are:
 10991105                 if assignment, type of LHS
<>1100 -                if any float or doubles, make double
 1101 -                if any longlongs, make long long
  1106+                if any doubles, make double
  1107+                else if any float make float
  1108+                else if any longlongs, make long long
11021109                 else if any longs, make long
<>1103 -                otherwise, make int
  1110+                else etcetc.
11041111                 if either operand is unsigned, the result is...
 11051112         */
 11061113 
     
 !
11291136                 t2 = INT;
 11301137 #endif
 11311138 
<>1132 -        if (t1 == FLOAT && t2 == FLOAT)
 1133 -                t = FLOAT;
  1139+        if (t1 == LDOUBLE || t2 == LDOUBLE)
  1140+                t = LDOUBLE;
11341141         else if (t1 == DOUBLE || t2 == DOUBLE)
 11351142                 t = DOUBLE;
<> 1143+        else if (t1 == FLOAT || t2 == FLOAT)
  1144+                t = FLOAT;
11361145         else if (t1==LONGLONG || t2 == LONGLONG)
 11371146                 t = LONGLONG;
 11381147         else if (t1==LONG || t2==LONG)
     
 !
14691478 
 14701479         case ENUMTY:
 14711480         case MOETY:
<>1472 -                return( MENU|MINT );
  1481+                return( MENU|MINT|MDBI );
14731482 
 14741483         case STRTY:
 14751484         case UNIONTY:
     
 !
15301539         }
 15311540 #endif
 15321541 #if 1
<> 1542+#if 0
  1543+        p = block(REG, NIL, NIL, type, df, sue);
  1544+        p->n_rval = FPREG;
  1545+        p->n_qual = 0;
  1546+        r = offcon(*nr, type, df, sue);
  1547+        p = block(PLUS, p, r, type, df, sue);
  1548+        p = block(UMUL, p, NIL, type, df, sue);
  1549+        return p;
  1550+#else
15331551         p = block(OREG, NIL, NIL, type, df, sue);
 15341552         p->n_rval = FPREG;
 15351553         p->n_qual = 0;
 15361554         r = offcon(*nr, type, df, sue);
 15371555         p->n_lval = r->n_lval;
 15381556         nfree(r);
 15391557         return p;
<> 1558+#endif
15401559 #else
 15411560         type = INCREF(type);
 15421561         p = block(REG, NIL, NIL, type, df, sue);
     
 !
16551674                 p->n_op = ICON;
 16561675         }
 16571676         if (l->n_op == ICON && r->n_op == ICON) {
<>1658 -                if (conval(l, p->n_op, r) == 0)
 1659 -                        cerror("logwalk");
 1660 -                p->n_lval = l->n_lval;
 1661 -                p->n_op = ICON;
 1662 -                nfree(l);
 1663 -                nfree(r);
  1677+                if (conval(l, p->n_op, r) == 0) {
  1678+                        /*
  1679+                         * people sometimes tend to do really odd compares,
  1680+                         * like "if ("abc" == "def")" etc.
  1681+                         * do it runtime instead.
  1682+                         */
  1683+                } else {
  1684+                        p->n_lval = l->n_lval;
  1685+                        p->n_op = ICON;
  1686+                        nfree(l);
  1687+                        nfree(r);
  1688+                }
<_16641689         }
 16651690 }
 16661691 
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-11-01 05:50 +0100