Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.174
 
1.175
 
MAIN:ragge:20071118172457
 
trees.c
_>7272 # include <stdarg.h>
 7373 
 7474 static void chkpun(NODE *p);
<>75 -static int chkenum(int, int, NODE *p);
7675 static int opact(NODE *p);
 7776 static int moditype(TWORD);
 7877 static NODE *strargs(NODE *);
     
 !
335334                         p->n_sue = sp->ssue;
 336335                         p->n_lval = 0;
 337336                         p->n_sp = sp;
<>338 -                        /* special case: MOETY is really an ICON... */
 339 -                        if (p->n_type == MOETY) {
 340 -                                p->n_sp = NULL;
  337+                        if (sp->sclass == MOE) {
  338+                                p->n_op = ICON;
341339                                 p->n_lval = sp->soffset;
 342340                                 p->n_df = NULL;
<>343 -                                p->n_type = ENUMTY;
 344 -                                p->n_op = ICON;
  341+                                p->n_sp = NULL;
345342                         }
 346343                         break;
 347344 
     
 !
759756         if (BTYPE(t2) == VOID && (t1 & TMASK))
 760757                 return;
 761758 
<>762 -        /* check for enumerations */
 763 -        if (t1 == ENUMTY || t2 == ENUMTY) {
 764 -                if (clogop(p->n_op) && p->n_op != EQ && p->n_op != NE) {
 765 -                        werror("comparison of enums");
 766 -                        return;
 767 -                }
 768 -                if (chkenum(t1, t2, p))
 769 -                        return;
 770 -        }
 771 -
772759         if (ISPTR(t1) || ISARY(t1))
 773760                 q = p->n_right;
 774761         else
     
 !
805792                                 }
 806793                                 ++d1;
 807794                                 ++d2;
<>808 -                        } else if (t1 == ENUMTY || t2 == ENUMTY) {
 809 -                                chkenum(t1, t2, p);
 810 -                                return;
811795                         } else
 812796                                 break;
 813797                         t1 = DECREF(t1);
     
 !
817801         }
 818802 }
 819803 
<>820 -static int
 821 -chkenum(int t1, int t2, NODE *p)
 822 -{
 823 -        if (t1 == ENUMTY && t2 == ENUMTY) {
 824 -                if (p->n_left->n_sue != p->n_right->n_sue)
 825 -                werror("enumeration type clash, operator %s", copst(p->n_op));
 826 -                        return 1;
 827 -        }
 828 -        if ((t1 == ENUMTY && !(t2 >= CHAR && t2 <= UNSIGNED)) ||
 829 -            (t2 == ENUMTY && !(t1 >= CHAR && t1 <= UNSIGNED))) {
 830 -                werror("illegal combination of enum and non-integer type");
 831 -                return 1;
 832 -        }
 833 -        return 0;
 834 -}
 835 -
836804 NODE *
 837805 stref(NODE *p)
 838806 {
     
 !
1024992         return(p);
 1025993 }
 1026994 
<>1027 -/*
 1028 - * change enums to ints, or appropriate types
 1029 - */
 1030 -void
 1031 -econvert( p ) register NODE *p; {
 1032 -
 1033 -
 1034 -        register TWORD ty;
 1035 -
 1036 -        if( (ty=BTYPE(p->n_type)) == ENUMTY || ty == MOETY ) {
 1037 -                if (p->n_sue->suesize == SZCHAR)
 1038 -                        ty = INT;
 1039 -                else if (p->n_sue->suesize == SZINT)
 1040 -                        ty = INT;
 1041 -                else if (p->n_sue->suesize == SZSHORT)
 1042 -                        ty = INT;
 1043 -                else if (p->n_sue->suesize == SZLONGLONG)
 1044 -                        ty = LONGLONG;
 1045 -                else
 1046 -                        ty = LONG;
 1047 -                ty = ctype(ty);
 1048 -                p->n_sue = MKSUE(ty);
 1049 -                MODTYPE(p->n_type,ty);
 1050 -                if (p->n_op == ICON && ty != LONG && ty != LONGLONG)
 1051 -                        p->n_type = INT, p->n_sue = MKSUE(INT);
 1052 -        }
 1053 -}
 1054 -
1055995 NODE *
 1056996 pconvert( p ) register NODE *p; {
 1057997 
     
 !
12131153                 t2 = DEUNSIGN(t2);
 12141154                 }
 12151155 
<>1216 -        if (t1 == ENUMTY || t1 == MOETY)
 1217 -                t1 = INT; /* XXX */
 1218 -        if (t2 == ENUMTY || t2 == MOETY)
 1219 -                t2 = INT; /* XXX */
12201156 #if 0
 12211157         if ((t1 == CHAR || t1 == SHORT) && o!= RETURN)
 12221158                 t1 = INT;
     
 !
12951231 makety(NODE *p, TWORD t, TWORD q, union dimfun *d, struct suedef *sue)
 12961232 {
 12971233 
<>1298 -        if (p->n_type == ENUMTY && p->n_op == ICON)
 1299 -                econvert(p);
13001234         if (t == p->n_type) {
 13011235                 p->n_df = d;
 13021236                 p->n_sue = sue;
     
 !
14111345 # define MSTR 04        /* structure */
 14121346 # define MPTR 010       /* pointer */
 14131347 # define MPTI 020       /* pointer or integer */
<>1414 -# define MENU 040       /* enumeration variable or member */
14151348 
 14161349 int
 14171350 opact(NODE *p)
     
 !
14571390 
 14581391         case MUL:
 14591392         case DIV:
<>1460 -                if ((mt1&MDBI) && (mt2&MENU)) return( TYMATCH );
 1461 -                if ((mt2&MDBI) && (mt1&MENU)) return( TYMATCH );
14621393                 if( mt12 & MDBI ) return( TYMATCH );
 14631394                 break;
 14641395 
     
 !
14871418 
 14881419         case QUEST:
 14891420         case COMOP:
<>1490 -                if( mt2&MENU ) return( TYPR+NCVTR );
14911421                 return( TYPR );
 14921422 
 14931423         case STREF:
     
 !
15091439                 if( mt12 & MSTR ) return( LVAL+NCVT+TYPL+OTHER );
 15101440         case CAST:
 15111441                 if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
<>1512 -#if 0
 1513 -                else if(mt1&MENU && mt2&MDBI) return( TYPL+LVAL+TYMATCH );
 1514 -                else if(mt2&MENU && mt1&MDBI) return( TYPL+LVAL+TYMATCH );
 1515 -                else if( (mt1&MENU)||(mt2&MENU) )
 1516 -                        return( LVAL+NCVT+TYPL+PTMATCH+PUN );
 1517 -#endif
15181442                 else if( mt1 & MPTR) return( LVAL+PTMATCH+PUN );
 15191443                 else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN );
 15201444                 break;
     
 !
15711495 {
 15721496         switch (ty) {
 15731497 
<>1574 -        case ENUMTY:
 1575 -        case MOETY:
 1576 -                return( MENU|MINT|MDBI|MPTI );
 1577 -
<_15781498         case STRTY:
 15791499         case UNIONTY:
 15801500                 return( MSTR );
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-01 20:44 +0200