Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.165
 
1.166
 
MAIN:ragge:20071004165430
 
trees.c
_>7272 # include <stdarg.h>
 7373 
 7474 static void chkpun(NODE *p);
<> 75+static int chkenum(int, int, NODE *p);
7576 static int opact(NODE *p);
 7677 static int moditype(TWORD);
 7778 static NODE *strargs(NODE *);
     
 !
756757         if (BTYPE(t2) == VOID && (t1 & TMASK))
 757758                 return;
 758759 
<>759 -#ifdef notdef
 760 -        /* C99 says that enums always should be handled as ints */
761760         /* check for enumerations */
<>762 -        if (t1==ENUMTY || t2==ENUMTY) {
 763 -                if( clogop( p->n_op ) && p->n_op != EQ && p->n_op != NE ) {
 764 -                        werror( "comparison of enums" );
  761+        if (t1 == ENUMTY || t2 == ENUMTY) {
  762+                if (clogop(p->n_op) && p->n_op != EQ && p->n_op != NE) {
  763+                        werror("comparison of enums");
765764                         return;
<>766 -                        }
 767 -                if (t1==ENUMTY && t2==ENUMTY) {
 768 -                        if (p->n_left->n_sue!=p->n_right->n_sue)
 769 -                                werror("enumeration type clash, "
 770 -                                    "operator %s", copst(p->n_op));
 771 -                        return;
772765                 }
<>773 -                if ((t1 == ENUMTY && t2 <= BTMASK) ||
 774 -                    (t2 == ENUMTY && t1 <= BTMASK))
  766+                if (chkenum(t1, t2, p))
775767                         return;
 776768         }
<>777 -#endif
778769 
 779770         if (ISPTR(t1) || ISARY(t1))
 780771                 q = p->n_right;
     
 !
812803                                 }
 813804                                 ++d1;
 814805                                 ++d2;
<> 806+                        } else if (t1 == ENUMTY || t2 == ENUMTY) {
  807+                                chkenum(t1, t2, p);
  808+                                return;
815809                         } else
 816810                                 break;
 817811                         t1 = DECREF(t1);
     
 !
821815         }
 822816 }
 823817 
<> 818+static int
  819+chkenum(int t1, int t2, NODE *p)
  820+{
  821+        if (t1 == ENUMTY && t2 == ENUMTY) {
  822+                if (p->n_left->n_sue != p->n_right->n_sue)
  823+                werror("enumeration type clash, operator %s", copst(p->n_op));
  824+                        return 1;
  825+        }
  826+        if ((t1 == ENUMTY && !(t2 >= CHAR && t2 <= UNSIGNED)) ||
  827+            (t2 == ENUMTY && !(t1 >= CHAR && t1 <= UNSIGNED))) {
  828+                werror("illegal combination of enum and non-integer type");
  829+                return 1;
  830+        }
  831+        return 0;
  832+}
  833+
<_824834 NODE *
 825835 stref(NODE *p)
 826836 {
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-09-02 16:11 +0200