Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.220
 
1.221
 
MAIN:ragge:20080803204925
 
pftn.c
_>220220         changed = 0;
 221221         for (temp = type; temp & TMASK; temp = DECREF(temp)) {
 222222                 if (ISARY(temp)) {
<>223 -                        if (dsym->ddim == 0) {
  223+                        if (dsym->ddim == NOOFFSET) {
224224                                 dsym->ddim = ddef->ddim;
 225225                                 changed = 1;
<>226 -                        } else if (ddef->ddim != 0 && dsym->ddim!=ddef->ddim) {
  226+                        } else if (ddef->ddim != NOOFFSET &&
  227+                            dsym->ddim!=ddef->ddim) {
227228                                 goto mismatch;
 228229                         }
 229230                         ++dsym;
     
 !
860861 soumemb(NODE *n, char *name, int class)
 861862 {
 862863         struct symtab *sp, *lsp;
<>863 -        int sz;
  864+        int incomp;
864865  
 865866         if (rpole == NULL)
 866867                 cerror("soumemb");
     
 !
885886          * "...the last member of a structure with more than one
 886887          *  named member may have incomplete array type;"
 887888          */
<>888 -        sz = tsize(sp->stype, sp->sdf, sp->ssue);
 889 -        if ((rpole->flags & LASTELM) || (rpole->rb == sp && sz == 0))
  889+        if (ISARY(sp->stype) && sp->sdf->ddim == NOOFFSET)
  890+                incomp = 1;
  891+        else
  892+                incomp = 0;
  893+        if ((rpole->flags & LASTELM) || (rpole->rb == sp && incomp == 1))
890894                 uerror("incomplete array in struct");
<>891 -        if (sz == 0)
  895+        if (incomp == 1)
892896                 rpole->flags |= LASTELM;
 893897 
 894898         /*
     
 !
901905 
 902906                 for (lnk = sp->ssue->sylnk; lnk->snext; lnk = lnk->snext)
 903907                         ;
<>904 -                if (tsize(lnk->stype, lnk->sdf, lnk->ssue) == 0)
  908+                if (ISARY(lnk->stype) && lnk->sdf->ddim == NOOFFSET)
905909                         uerror("incomplete struct in struct");
 906910         }
 907911 }
     
 !
10521056                 case PTR:
 10531057                         return( SZPOINT(ty) * mult );
 10541058                 case ARY:
<> 1059+                        if (d->ddim == NOOFFSET)
  1060+                                return 0;
10551061                         mult *= d->ddim;
 10561062                         d++;
 10571063                         continue;
     
 !
12551261         astkp = 0;
 12561262         if (ISARY(t) && blevel == 1) {
 12571263                 /* must take care of side effects of dynamic arg arrays */
<>1258 -                if (p->sdf->ddim < 0) {
  1264+                if (p->sdf->ddim < 0 && p->sdf->ddim != NOOFFSET) {
12591265                         /* first-level array will be indexed correct */
 12601266                         edelay(arrstk[astkp++]);
 12611267                 }
     
 !
12811287                         continue;
 12821288                 if (df->ddim < 0) {
 12831289                         n = arrstk[astkp++];
<>1284 -                        nn = tempnode(0, INT, 0, MKSUE(INT));
 1285 -                        no = regno(nn);
  1290+                        do {
  1291+                                nn = tempnode(0, INT, 0, MKSUE(INT));
  1292+                                no = regno(nn);
  1293+                        } while (no == -NOOFFSET);
12861294                         edelay(buildtree(ASSIGN, nn, n));
 12871295 
 12881296                         df->ddim = -no;
     
 !
14041412 
 14051413         sp = p->n_sp;
 14061414         /* check if forward decl */
<>1407 -        if (ISARY(sp->stype) && sp->sdf->ddim == 0)
  1415+        if (ISARY(sp->stype) && sp->sdf->ddim == NOOFFSET)
14081416                 return;
 14091417 
 14101418         if (sp->sflags & SASG)
     
 !
18521860                         nfree(p->n_right);
 18531861 #ifdef notdef
 18541862         /* XXX - check dimensions at usage time */
<>1855 -                        if (dim.ddim == 0 && p->n_left->n_op == LB)
  1863+                        if (dim.ddim == NOOFFSET && p->n_left->n_op == LB)
18561864                                 uerror("null dimension");
 18571865 #endif
 18581866                 }
     
 !
23322340                 switch (type & TMASK) {
 23332341                 case ARY:
 23342342                         /* may be declared without dimension */
<>2335 -                        if (dsym->ddim == 0)
  2343+                        if (dsym->ddim == NOOFFSET)
23362344                                 dsym->ddim = ddef->ddim;
<>2337 -                        if (ddef->ddim && dsym->ddim != ddef->ddim)
  2345+                        if (ddef->ddim != NOOFFSET && dsym->ddim != ddef->ddim)
<_23382346                                 return 1;
 23392347                         dsym++, ddef++;
 23402348                         break;
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-20 05:56 +0200