Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.28
 
1.29
 
MAIN:ragge:20030611144225
 
trees.c
_>132132                         l->n_op = ICON;
 133133                         l->n_type = INT;
 134134                         l->n_sue = MKSUE(INT);
<>135 -                        l->n_dim = NULL;
  135+                        l->n_df = NULL;
136136                         return(l);
 137137                 case UNARY MINUS:
 138138                         if( l->n_op == FCON )
     
 !
292292                 q = (actions&TYPL) ? p->n_left : p->n_right;
 293293 
 294294                 p->n_type = q->n_type;
<>295 -                p->n_dim = q->n_dim;
  295+                p->n_df = q->n_df;
296296                 p->n_sue = q->n_sue;
 297297                 }
 298298 
     
 !
314314                                 /* make p look reasonable */
 315315                                 p->n_type = INT;
 316316                                 p->n_sue = MKSUE(INT);
<>317 -                                p->n_dim = NULL;
  317+                                p->n_df = NULL;
318318                                 p->n_sp = sp;
 319319                                 p->n_lval = 0;
 320320                                 defid(p, SNULL);
 321321                                 break;
 322322                         }
 323323                         p->n_type = sp->stype;
<>324 -                        p->n_dim = sp->sdim;
  324+                        p->n_df = sp->sdf;
325325                         p->n_sue = sp->ssue;
 326326                         p->n_lval = 0;
 327327                         p->n_sp = sp;
 328328                         /* special case: MOETY is really an ICON... */
 329329                         if (p->n_type == MOETY) {
 330330                                 p->n_sp = NULL;
 331331                                 p->n_lval = sp->soffset;
<>332 -                                p->n_dim = NULL;
  332+                                p->n_df = NULL;
333333                                 p->n_type = ENUMTY;
 334334                                 p->n_op = ICON;
 335335                         }
 336336                         break;
 337337 
 338338                 case ICON:
 339339                         p->n_type = INT;
<>340 -                        p->n_dim = NULL;
  340+                        p->n_df = NULL;
341341                         p->n_sue = MKSUE(INT);
 342342                         break;
 343343 
     
 !
358358                         p->n_lval = 0;
 359359                         p->n_rval = 0;
 360360                         p->n_type = FLOAT;
<>361 -                        p->n_dim = NULL;
  361+                        p->n_df = NULL;
362362                         p->n_sue = MKSUE(FLOAT);
 363363                         break;
 364364 
 365365                 case DCON:
 366366                         p->n_lval = 0;
 367367                         p->n_rval = 0;
 368368                         p->n_type = DOUBLE;
<>369 -                        p->n_dim = NULL;
  369+                        p->n_df = NULL;
370370                         p->n_sue = MKSUE(DOUBLE);
 371371                         break;
 372372 
     
 !
403403                                 }
 404404                         if( !ISPTR(l->n_type))uerror("illegal indirection");
 405405                         p->n_type = DECREF(l->n_type);
<>406 -                        p->n_dim = l->n_dim;
  406+                        p->n_df = l->n_df;
407407                         p->n_sue = l->n_sue;
 408408                         break;
 409409 
     
 !
415415                                 p = l->n_left;
 416416                         case NAME:
 417417                                 p->n_type = INCREF( l->n_type );
<>418 -                                p->n_dim = l->n_dim;
  418+                                p->n_df = l->n_df;
419419                                 p->n_sue = l->n_sue;
 420420                                 break;
 421421 
     
 !
477477                         {
 478478                                 struct suedef *sue;
 479479                                 TWORD t;
<>480 -                                int *d;
  480+                                union dimfun *d;
481481 
 482482                                 if (l->n_sue != r->n_sue)
 483483                                         uerror("assignment of different structures");
 484484 
 485485                                 r = buildtree(UNARY AND, r, NIL);
 486486                                 t = r->n_type;
<>487 -                                d = r->n_dim;
  487+                                d = r->n_df;
488488                                 sue = r->n_sue;
 489489 
 490490                                 l = block(STASG, l, r, t, d, sue);
     
 !
516516                         if (!ISFTN(p->n_type))
 517517                                 uerror("illegal function");
 518518                         p->n_type = DECREF(p->n_type);
<>519 -                        p->n_dim = l->n_dim;
  519+                        p->n_df = l->n_df;
520520                         p->n_sue = l->n_sue;
 521521                         if (l->n_op == UNARY AND && l->n_left->n_op == NAME &&
 522522                             l->n_left->n_sp != NULL && l->n_left->n_sp != NULL &&
     
 !
591591                 }
 592592 
 593593         if( p->n_type == STRTY || p->n_type == UNIONTY ){
<>594 -                p = block(STARG, p, NIL, p->n_type, p->n_dim, p->n_sue);
  594+                p = block(STARG, p, NIL, p->n_type, p->n_df, p->n_sue);
595595                 p->n_left = buildtree( UNARY AND, p->n_left, NIL );
 596596                 p = clocal(p);
 597597                 }
     
 !
737737 void
 738738 chkpun(NODE *p)
 739739 {
<> 740+        union dimfun *d1, *d2;
740741         NODE *q;
<>741 -        int t1, t2, *d1, *d2, ref1, ref2;
  742+        int t1, t2, ref1, ref2;
742743 
 743744         t1 = p->n_left->n_type;
 744745         t2 = p->n_right->n_type;
     
 !
777778                                 werror("illegal structure pointer combination");
 778779                                 return;
 779780                         }
<>780 -                        d1 = p->n_left->n_dim;
 781 -                        d2 = p->n_right->n_dim;
  781+                        d1 = p->n_left->n_df;
  782+                        d2 = p->n_right->n_df;
782783                         for (;;) {
 783784                                 if (ISARY(t1)) {
<>784 -                                        if (*d1 != *d2) {
  785+                                        if (d1->ddim != d2->ddim) {
785786                                                 werror("illegal array "
 786787                                                     "size combination");
 787788                                                 return;
 788789                                         }
 789790                                         ++d1;
 790791                                         ++d2;
<> 792+                                } else if (ISFTN(t1)) {
  793+                                        if (d1->dfun != d2->dfun) {
  794+                                                werror("illegal function"
  795+                                                    "combination");
  796+                                                return;
  797+                                        }
  798+                                        ++d1;
  799+                                        ++d2;
791800                                 } else
 792801                                         if (!ISPTR(t1))
 793802                                                 break;
     
 !
802811 stref(NODE *p)
 803812 {
 804813         struct suedef *sue;
<> 814+        union dimfun *d;
805815         TWORD t;
<>806 -        int *d, dsc, align;
  816+        int dsc, align;
807817         OFFSZ off;
 808818         register struct symtab *q;
 809819 
     
 !
821831                 p->n_type = PTR+UNIONTY;
 822832 
 823833         t = INCREF(q->stype);
<>824 -        d = q->sdim;
  834+        d = q->sdf;
825835         sue = q->ssue;
 826836 
 827837         p = makety(p, t, d, sue);
     
 !
899909 NODE *
 900910 bpsize(NODE *p)
 901911 {
<>902 -        return(offcon(psize(p), p->n_type, p->n_dim, p->n_sue));
  912+        return(offcon(psize(p), p->n_type, p->n_df, p->n_sue));
903913 }
 904914 
 905915 /*
     
 !
915925                 return(SZINT);
 916926         }
 917927         /* note: no pointers to fields */
<>918 -        return(tsize(DECREF(p->n_type), p->n_dim, p->n_sue));
  928+        return(tsize(DECREF(p->n_type), p->n_df, p->n_sue));
919929 }
 920930 
 921931 /*
     
 !
982992 
 983993         if( ISARY( p->n_type) ){
 984994                 p->n_type = DECREF( p->n_type );
<>985 -                ++p->n_dim;
  995+                ++p->n_df;
986996                 return( buildtree( UNARY AND, p, NIL ) );
 987997         }
 988998         if( ISFTN( p->n_type) )
     
 !
10251035         /* with COLON, the types must be the same */
 10261036 
 10271037         struct suedef *sue, *sue2;
<> 1038+        union dimfun *d, *d2;
10281039         TWORD t1, t2, t;
<>1029 -        int o, *d2, *d;
  1040+        int o;
10301041 
 10311042         o = p->n_op;
 10321043         t = t1 = p->n_left->n_type;
 10331044         t2 = p->n_right->n_type;
<>1034 -        d = p->n_left->n_dim;
 1035 -        d2 = p->n_right->n_dim;
  1045+        d = p->n_left->n_df;
  1046+        d2 = p->n_right->n_df;
10361047         sue = p->n_left->n_sue;
 10371048         sue2 = p->n_right->n_sue;
 10381049 
     
 !
10891100         if( o!=MINUS && !logop(o) ){
 10901101 
 10911102                 p->n_type = t;
<>1092 -                p->n_dim = d;
  1103+                p->n_df = d;
10931104                 p->n_sue = sue;
 10941105                 }
 10951106 
     
 !
11691180                 if ( tu == ENUMTY ) {/* always asgop */
 11701181                         p->n_right = makety( p->n_right, INT, 0, MKSUE(INT));
 11711182                         p->n_right->n_type = tu;
<>1172 -                        p->n_right->n_dim = p->n_left->n_dim;
  1183+                        p->n_right->n_df = p->n_left->n_df;
11731184                         p->n_right->n_sue = p->n_left->n_sue;
 11741185                         }
 11751186                 else
     
 !
11781189 
 11791190         if( asgop(o) ){
 11801191                 p->n_type = p->n_left->n_type;
<>1181 -                p->n_dim = p->n_left->n_dim;
  1192+                p->n_df = p->n_left->n_df;
11821193                 p->n_sue = p->n_left->n_sue;
 11831194                 }
 11841195         else if( !logop(o) ){
 11851196                 p->n_type = tu;
<>1186 -                p->n_dim = NULL;
  1197+                p->n_df = NULL;
11871198                 p->n_sue = MKSUE(t);
 11881199                 }
 11891200 
     
 !
11961207         }
 11971208 
 11981209 NODE *
<>1199 -makety(NODE *p, TWORD t, int *d, struct suedef *sue)
  1210+makety(NODE *p, TWORD t, union dimfun *d, struct suedef *sue)
12001211 {
 12011212         /* make p into type t by inserting a conversion */
 12021213 
 12031214         if( p->n_type == ENUMTY && p->n_op == ICON ) econvert(p);
 12041215         if( t == p->n_type ){
<>1205 -                p->n_dim = d;
  1216+                p->n_df = d;
12061217                 p->n_sue = sue;
 12071218                 return(p);
 12081219         }
     
 !
12661277         }
 12671278 
 12681279 NODE *
<>1269 -block(int o, NODE *l, NODE *r, TWORD t, int *d, struct suedef *sue)
  1280+block(int o, NODE *l, NODE *r, TWORD t, union dimfun *d, struct suedef *sue)
12701281 {
 12711282         register NODE *p;
 12721283 
     
 !
12781289         p->n_right = r;
 12791290         p->n_type = t;
 12801291         p->n_su = 0;
<>1281 -        p->n_dim = d;
  1292+        p->n_df = d;
12821293         p->n_sue = sue;
 12831294         return(p);
 12841295         }
     
 !
15601571 {
 15611572         int i;
 15621573 
<>1563 -        i = tsize( p->n_type, p->n_dim, p->n_sue )/SZCHAR;
  1574+        i = tsize( p->n_type, p->n_df, p->n_sue )/SZCHAR;
15641575 
 15651576         tfree(p);
 15661577         if (i <= 0)
     
 !
15881599                 printf( ", %d, ", p->n_rval );
 15891600                 }
 15901601         tprint( p->n_type );
<>1591 -        printf( ", %p, %p\n", p->n_dim, p->n_sue );
  1602+        printf( ", %p, %p\n", p->n_df, p->n_sue );
15921603         return 0;
 15931604 }
 15941605 # endif
     
 !
16711682         case STCALL:
 16721683         case UNARY STCALL:
 16731684                 /* set up size parameters */
<>1674 -                p->n_stsize = (tsize(STRTY,p->n_left->n_dim,p->n_left->n_sue)+SZCHAR-1)/SZCHAR;
  1685+                p->n_stsize = (tsize(STRTY,p->n_left->n_df,p->n_left->n_sue)+SZCHAR-1)/SZCHAR;
<_16751686                 p->n_stalign = talign(STRTY,p->n_left->n_sue)/SZCHAR;
 16761687                 break;
 16771688 
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-08-20 08:53 +0200