Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.30
 
1.31
 
MAIN:ragge:20030531103446
 
pftn.c
_>6161 
 6262         if( q < node || q >= &node[TREESZ] ) cerror( "defid call" );
 6363 
<>64 -        idp = q->tn.rval;
  64+        idp = q->n_rval;
6565 
 6666         if( idp < 0 ) cerror( "tyreduce" );
 6767         p = &stab[idp];
 6868 
 6969 # ifndef BUG1
 7070         if (ddebug) {
 7171                 printf("defid(%s (%d), ", p->sname, idp);
<>72 -                tprint(q->in.type);
  72+                tprint(q->n_type);
7373                 printf(", %s, (%d,%d)), level %d\n", scnames(class),
<>74 -                    q->fn.cdim, q->fn.csiz, blevel);
  74+                    q->n_cdim, q->n_csiz, blevel);
7575         }
 7676 # endif
 7777 
 7878         fixtype( q, class );
 7979 
<>80 -        type = q->in.type;
  80+        type = q->n_type;
8181         class = fixclass( class, type );
 8282 
 8383         stp = p->stype;
     
 !
120120 
 121121         /* test (and possibly adjust) dimensions */
 122122         dsym = p->dimoff;
<>123 -        ddef = q->fn.cdim;
  123+        ddef = q->n_cdim;
124124         changed = 0;
 125125         for( temp=type; temp&TMASK; temp = DECREF(temp) ){
 126126                 if( ISARY(temp) ){
     
 !
141141                 }
 142142 
 143143         /* check that redeclarations are to the same structure */
<>144 -        if( (temp==STRTY||temp==UNIONTY||temp==ENUMTY) && p->sizoff != q->fn.csiz
  144+        if( (temp==STRTY||temp==UNIONTY||temp==ENUMTY) && p->sizoff != q->n_csiz
145145                  && class!=STNAME && class!=UNAME && class!=ENAME ){
 146146                 goto mismatch;
 147147                 }
     
 !
275275                 }
 276276         if (blevel > slev && class != EXTERN && class != FORTRAN &&
 277277             class != UFORTRAN) {
<>278 -                q->tn.rval = idp = hide( p );
  278+                q->n_rval = idp = hide( p );
279279                 p = &stab[idp];
 280280                 goto enter;
 281281         }
     
 !
306306                 case STRTY:
 307307                 case UNIONTY:
 308308                 case ENUMTY:
<>309 -                        p->sizoff = q->fn.csiz;
  309+                        p->sizoff = q->n_csiz;
310310                         break;
 311311                 default:
 312312                         p->sizoff = BTYPE(type);
     
 !
315315 
 316316         /* copy dimensions */
 317317 
<>318 -        p->dimoff = q->fn.cdim;
  318+        p->dimoff = q->n_cdim;
319319 
 320320         /* allocate offsets */
 321321         if( class&FIELD ){
     
 !
445445 # endif
 446446                 if (p->stype == FARG) {
 447447                         q = block(FREE,NIL,NIL,INT,0,INT);
<>448 -                        q->tn.rval = j;
  448+                        q->n_rval = j;
449449                         defid(q, PARAM);
 450450                 }
 451451                 FIXARG(p); /* local arg hook, eg. for sym. debugger */
     
 !
474474         case UNDEF:
 475475         def:
 476476                 q = block(FREE, NIL, NIL, 0, 0, 0);
<>477 -                q->tn.rval = idn;
 478 -                q->in.type = (soru&INSTRUCT) ? STRTY :
  477+                q->n_rval = idn;
  478+                q->n_type = (soru&INSTRUCT) ? STRTY :
479479                     ((soru&INUNION) ? UNIONTY : ENUMTY);
 480480                 defid(q, (soru&INSTRUCT) ? STNAME :
 481481                     ((soru&INUNION) ? UNAME : ENAME));
     
 !
507507         NODE *q;
 508508 
 509509         q = block( FREE, NIL, NIL, MOETY, 0, 0 );
<>510 -        q->tn.rval = idn;
  510+        q->n_rval = idn;
511511         if( idn>=0 ) defid( q, MOE );
 512512 }
 513513 
     
 !
525525         strucoff = 0;
 526526         instruct = soru;
 527527         q = block(FREE, NIL, NIL, 0, 0, 0);
<>528 -        q->tn.rval = idn;
  528+        q->n_rval = idn;
529529         if (instruct==INSTRUCT) {
 530530                 strunem = MOS;
<>531 -                q->in.type = STRTY;
  531+                q->n_type = STRTY;
532532                 if (idn >= 0)
 533533                         defid(q, STNAME);
 534534         } else if(instruct == INUNION) {
 535535                 strunem = MOU;
<>536 -                q->in.type = UNIONTY;
  536+                q->n_type = UNIONTY;
537537                 if (idn >= 0)
 538538                         defid(q, UNAME);
 539539         } else { /* enum */
 540540                 strunem = MOE;
<>541 -                q->in.type = ENUMTY;
  541+                q->n_type = ENUMTY;
542542                 if (idn >= 0)
 543543                         defid(q, ENAME);
 544544         }
<>545 -        psave(idn = q->tn.rval);
  545+        psave(idn = q->n_rval);
546546         /* the "real" definition is where the members are seen */
 547547         if (idn >= 0)
 548548                 stab[idn].suse = lineno;
     
 !
10931093 
 10941094         dimtab[curdim] = i; /* in case of later sizeof ... */
 10951095         p = buildtree(STRING, NIL, NIL);
<>1096 -        p->tn.rval = -strlab;
  1096+        p->n_rval = -strlab;
10971097         return(p);
 10981098 }
 10991099 
     
 !
12441244         inforce( pstk->in_off );
 12451245 
 12461246         p = buildtree( ASSIGN, block( NAME, NIL,NIL, t, d, s ), p );
<>1247 -        p->in.left->in.op = FREE;
 1248 -        p->in.left = p->in.right;
 1249 -        p->in.right = NIL;
 1250 -        p->in.left = optim( p->in.left );
 1251 -        o = p->in.left->in.op;
  1247+        p->n_left->n_op = FREE;
  1248+        p->n_left = p->n_right;
  1249+        p->n_right = NIL;
  1250+        p->n_left = optim( p->n_left );
  1251+        o = p->n_left->n_op;
12521252         if( o == UNARY AND ){
<>1253 -                o = p->in.left->in.op = FREE;
 1254 -                p->in.left = p->in.left->in.left;
  1253+                o = p->n_left->n_op = FREE;
  1254+                p->n_left = p->n_left->n_left;
12551255                 }
<>1256 -        p->in.op = INIT;
  1256+        p->n_op = INIT;
12571257 
 12581258         if( sz < SZINT ){ /* special case: bit fields, etc. */
<>1259 -                if( o != ICON || p->in.left->tn.rval != NONAME )
  1259+                if( o != ICON || p->n_left->n_rval != NONAME )
12601260                         uerror( "illegal initialization" );
 12611261                 else
<>1262 -                        incode( p->in.left, sz );
  1262+                        incode( p->n_left, sz );
12631263         } else if( o == FCON ){
<>1264 -                fincode( p->in.left->fpn.fval, sz );
  1264+                fincode( p->n_left->n_fcon, sz );
12651265         } else if( o == DCON ){
<>1266 -                fincode( p->in.left->dpn.dval, sz );
  1266+                fincode( p->n_left->n_dcon, sz );
12671267         } else {
 12681268                 p = optim(p);
<>1269 -                if( p->in.left->in.op != ICON )
  1269+                if( p->n_left->n_op != ICON )
12701270                         uerror( "illegal initialization" );
 12711271                 else
 12721272                         cinit( p, sz );
     
 !
15461546 {
 15471547         int al,sz,type;
 15481548 
<>1549 -        type = (new<0)? pty->in.type : p->stype;
  1549+        type = (new<0)? pty->n_type : p->stype;
15501550 
 15511551         /* this must be fixed to use the current type in alignments */
<>1552 -        switch( new<0?pty->in.type:p->stype ){
  1552+        switch( new<0?pty->n_type:p->stype ){
15531553 
 15541554         case ENUMTY:
 15551555                 {
 15561556                         int s;
<>1557 -                        s = new<0 ? pty->fn.csiz : p->sizoff;
  1557+                        s = new<0 ? pty->n_csiz : p->sizoff;
15581558                         al = dimtab[s+2];
 15591559                         sz = dimtab[s];
 15601560                         break;
     
 !
16561656 
 16571657         /* if an array is not initialized, no empty dimension */
 16581658         if (class != EXTERN && class != TYPEDEF &&
<>1659 -            ISARY(p->in.type) && dimtab[p->fn.cdim]==0)
  1659+            ISARY(p->n_type) && dimtab[p->n_cdim]==0)
16601660                 uerror("null storage definition");
 16611661 
 16621662 #ifndef LCOMM
 16631663         if (class==EXTDEF || class==STATIC)
 16641664 #else
 16651665         if (class==STATIC) {
<>1666 -                struct symtab *s = &stab[p->tn.rval];
  1666+                struct symtab *s = &stab[p->n_rval];
16671667                 extern int stabLCSYM;
 16681668                 int sz = tsize(s->stype, s->dimoff, s->sizoff)/SZCHAR;
 16691669                 
     
 !
16781678 #endif
 16791679         {
 16801680                 /* simulate initialization by 0 */
<>1681 -                beginit(p->tn.rval, class);
  1681+                beginit(p->n_rval, class);
16821682                 endinit();
 16831683         }
 16841684         if (commflag)
<>1685 -                commdec(p->tn.rval);
  1685+                commdec(p->n_rval);
16861686 }
 16871687 
 16881688 /*
     
 !
17001700         sign = 0;       /* 0, SIGNED or UNSIGNED */
 17011701 
 17021702         /* Remove initial QUALIFIERs */
<>1703 -        if (p && p->in.op == QUALIFIER) {
 1704 -                p->in.op = FREE;
 1705 -                p = p->in.left;
  1703+        if (p && p->n_op == QUALIFIER) {
  1704+                p->n_op = FREE;
  1705+                p = p->n_left;
17061706         }
 17071707 
 17081708         /* Handle initial classes special */
<>1709 -        if (p && p->in.op == CLASS) {
 1710 -                class = p->in.type;
 1711 -                p->in.op = FREE;
 1712 -                p = p->in.left;
  1709+        if (p && p->n_op == CLASS) {
  1710+                class = p->n_type;
  1711+                p->n_op = FREE;
  1712+                p = p->n_left;
17131713         }
 17141714 
 17151715         /* Remove more QUALIFIERs */
<>1716 -        if (p && p->in.op == QUALIFIER) {
 1717 -                p->in.op = FREE;
 1718 -                p = p->in.left;
  1716+        if (p && p->n_op == QUALIFIER) {
  1717+                p->n_op = FREE;
  1718+                p = p->n_left;
17191719         }
 17201720 
<>1721 -        if (p && p->in.op == TYPE && p->in.left == NIL) {
  1721+        if (p && p->n_op == TYPE && p->n_left == NIL) {
17221722 #ifdef CHAR_UNSIGNED
<>1723 -                if (p->in.type == CHAR)
 1724 -                        p->in.type = UCHAR;
  1723+                if (p->n_type == CHAR)
  1724+                        p->n_type = UCHAR;
17251725 #endif
<>1726 -                p->in.su = class;
  1726+                p->n_su = class;
17271727                 return p;
 17281728         }
 17291729 
 17301730         while (p != NIL) {
<>1731 -                if (p->in.op == QUALIFIER) /* Skip const/volatile */
  1731+                if (p->n_op == QUALIFIER) /* Skip const/volatile */
17321732                         goto next;
<>1733 -                if (p->in.op == CLASS) {
  1733+                if (p->n_op == CLASS) {
17341734                         if (class != 0)
 17351735                                 uerror("too many storage classes");
<>1736 -                        class = p->in.type;
  1736+                        class = p->n_type;
17371737                         goto next;
 17381738                 }
<>1739 -                if (p->in.op != TYPE)
 1740 -                        cerror("typenode got notype %d", p->in.op);
 1741 -                switch (p->in.type) {
  1739+                if (p->n_op != TYPE)
  1740+                        cerror("typenode got notype %d", p->n_op);
  1741+                switch (p->n_type) {
17421742                 case SIGNED:
 17431743                 case UNSIGNED:
 17441744                         if (sign != 0)
 17451745                                 goto bad;
<>1746 -                        sign = p->in.type;
  1746+                        sign = p->n_type;
17471747                         break;
 17481748                 case LONG:
 17491749                         if (adj == LONG) {
     
 !
17541754                 case SHORT:
 17551755                         if (adj != INT)
 17561756                                 goto bad;
<>1757 -                        adj = p->in.type;
  1757+                        adj = p->n_type;
17581758                         break;
 17591759                 case INT:
 17601760                 case CHAR:
 17611761                 case FLOAT:
 17621762                         if (noun != UNDEF)
 17631763                                 goto bad;
<>1764 -                        noun = p->in.type;
  1764+                        noun = p->n_type;
17651765                         break;
 17661766                 default:
 17671767                         goto bad;
 17681768                 }
 17691769         next:
<>1770 -                p->in.op = FREE;
 1771 -                p = p->in.left;
  1770+                p->n_op = FREE;
  1771+                p = p->n_left;
17721772         }
 17731773 
 17741774 #ifdef CHAR_UNSIGNED
     
 !
17921792         p = block(TYPE, NIL, NIL, noun, 0, 0);
 17931793         if (strunem != 0)
 17941794                 class = strunem;
<>1795 -        p->in.su = class;
  1795+        p->n_su = class;
17961796         return p;
 17971797 
 17981798 bad:    uerror("illegal type combination");
     
 !
18061806         unsigned int t;
 18071807         int i;
 18081808 
<>1809 -        if( typ->in.op != TYPE ) cerror( "tymerge: arg 1" );
  1809+        if( typ->n_op != TYPE ) cerror( "tymerge: arg 1" );
18101810         if(idp == NIL ) return( NIL );
 18111811 
 18121812 # ifndef BUG1
 18131813         if( ddebug > 2 ) fwalk( idp, eprint, 0 );
 18141814 # endif
 18151815 
<>1816 -        idp->in.type = typ->in.type;
 1817 -        idp->fn.cdim = curdim;
  1816+        idp->n_type = typ->n_type;
  1817+        idp->n_cdim = curdim;
18181818         tyreduce( idp );
<>1819 -        idp->fn.csiz = typ->fn.csiz;
  1819+        idp->n_csiz = typ->n_csiz;
18201820 
<>1821 -        for( t=typ->in.type, i=typ->fn.cdim; t&TMASK; t = DECREF(t) ){
  1821+        for( t=typ->n_type, i=typ->n_cdim; t&TMASK; t = DECREF(t) ){
18221822                 if( ISARY(t) ) dstash( dimtab[i++] );
 18231823                 }
 18241824 
 18251825         /* now idp is a single node: fix up type */
 18261826 
<>1827 -        idp->in.type = ctype( idp->in.type );
  1827+        idp->n_type = ctype( idp->n_type );
18281828 
<>1829 -        if( (t = BTYPE(idp->in.type)) != STRTY && t != UNIONTY && t != ENUMTY ){
 1830 -                idp->fn.csiz = t/* in case ctype has rewritten things */
  1829+        if( (t = BTYPE(idp->n_type)) != STRTY && t != UNIONTY && t != ENUMTY ){
  1830+                idp->n_csiz = t/* in case ctype has rewritten things */
18311831                 }
 18321832 
 18331833         return( idp );
     
 !
18451845         int o, temp;
 18461846         unsigned int t;
 18471847 
<>1848 -        o = p->in.op;
 1849 -        p->in.op = FREE;
  1848+        o = p->n_op;
  1849+        p->n_op = FREE;
18501850 
 18511851         if (o == NAME)
 18521852                 return;
 18531853 
<>1854 -        t = INCREF(p->in.type);
  1854+        t = INCREF(p->n_type);
18551855         switch (o) {
 18561856         case UNARY CALL:
 18571857                 t += (FTN-PTR);
 18581858                 break;
 18591859         case LB:
 18601860                 t += (ARY-PTR);
<>1861 -                if (p->in.right->in.op != ICON) {
 1862 -                        q = p->in.right;
  1861+                if (p->n_right->n_op != ICON) {
  1862+                        q = p->n_right;
18631863                         o = RB; /* cannot happen */
 18641864                 } else {
<>1865 -                        temp = p->in.right->tn.lval;
 1866 -                        p->in.right->in.op = FREE;
 1867 -                        if (temp == 0 && p->in.left->tn.op == LB)
  1865+                        temp = p->n_right->n_lval;
  1866+                        p->n_right->n_op = FREE;
  1867+                        if (temp == 0 && p->n_left->n_op == LB)
18681868                                 uerror("null dimension");
 18691869                 }
 18701870                 break;
 18711871         }
 18721872 
<>1873 -        p->in.left->in.type = t;
 1874 -        tyreduce(p->in.left);
  1873+        p->n_left->n_type = t;
  1874+        tyreduce(p->n_left);
18751875 
 18761876         if (o == LB)
 18771877                 dstash(temp);
     
 !
18801880                 arrstk[arrstkp++] = q;
 18811881         }
 18821882 
<>1883 -        p->tn.rval = p->in.left->tn.rval;
 1884 -        p->in.type = p->in.left->in.type;
  1883+        p->n_rval = p->n_left->n_rval;
  1884+        p->n_type = p->n_left->n_type;
18851885 }
 18861886 
 18871887 void
     
 !
18911891         int mod1, mod2;
 18921892         /* fix up the types, and check for legality */
 18931893 
<>1894 -        if( (type = p->in.type) == UNDEF ) return;
  1894+        if( (type = p->n_type) == UNDEF ) return;
18951895         if ((mod2 = (type&TMASK))) {
 18961896                 t = DECREF(type);
 18971897                 while( mod1=mod2, mod2 = (t&TMASK) ){
     
 !
19161916         if( class == PARAM || ( class==REGISTER && blevel==1 ) ){
 19171917                 if( type == FLOAT ) type = DOUBLE;
 19181918                 else if( ISARY(type) ){
<>1919 -                        ++p->fn.cdim;
  1919+                        ++p->n_cdim;
19201920                         type += (PTR-ARY);
 19211921                         }
 19221922                 else if( ISFTN(type) ){
     
 !
19301930                 uerror( "function illegal in structure or union" );
 19311931                 type = INCREF(type);
 19321932                 }
<>1933 -        p->in.type = type;
  1933+        p->n_type = type;
<_19341934 }
 19351935 
 19361936 /*
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-23 00:28 +0100