Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.13
 
1.14
 
MAIN:ragge:20021124175510
 
pftn.c
_>14621462  * assumed to be not functions
 14631463  */
 14641464 void
<>1465 -nidcl(NODE *p)
  1465+nidcl(NODE *p, int class)
14661466 {
<>1467 -        int class;
14681467         int commflag/* flag for labelled common declarations */
 14691468 
 14701469         commflag = 0;
 14711470 
 14721471         /* compute class */
<>1473 -        if( (class=curclass) == SNULL ){
 1474 -                if( blevel > 1 ) class = AUTO;
 1475 -                else if( blevel != 0 || instruct ) cerror( "nidcl error" );
  1472+        if (class == SNULL) {
  1473+                if (blevel > 1)
  1474+                        class = AUTO;
  1475+                else if (blevel != 0 || instruct)
  1476+                        cerror( "nidcl error" );
14761477                 else { /* blevel = 0 */
 14771478                         class = noinit();
<>1478 -                        if( class == EXTERN ) commflag = 1;
 1479 -                        }
  1479+                        if (class == EXTERN)
  1480+                                commflag = 1;
14801481                 }
<> 1482+        }
14811483 #ifdef LCOMM
 14821484         /* hack so stab will come out as LCSYM rather than STSYM */
 14831485         if (class == STATIC) {
     
 !
14861488         }
 14871489 #endif
 14881490 
<>1489 -        defid( p, class );
  1491+        defid(p, class);
14901492 
 14911493         /* if an array is not initialized, no empty dimension */
<>1492 -        if( class!=EXTERN && class!=TYPEDEF &&
 1493 -            ISARY(p->in.type) && dimtab[p->fn.cdim]==0 )
  1494+        if (class != EXTERN && class != TYPEDEF &&
  1495+            ISARY(p->in.type) && dimtab[p->fn.cdim]==0)
14941496                 uerror("null storage definition");
 14951497 
 14961498 #ifndef LCOMM
<>1497 -        if( class==EXTDEF || class==STATIC )
  1499+        if (class==EXTDEF || class==STATIC)
14981500 #else
 14991501         if (class==STATIC) {
 15001502                 struct symtab *s = &stab[p->tn.rval];
     
 !
15081510                         printf("        .lcomm  L%d,%d\n", s->offset, sz);
 15091511                 else
 15101512                         printf("        .lcomm  %s,%d\n", exname(s->sname), sz);
<>1511 -        }else if (class == EXTDEF)
  1513+        } else if (class == EXTDEF)
15121514 #endif
<>1513 -                {
  1515+        {
15141516                 /* simulate initialization by 0 */
 15151517                 beginit(p->tn.rval);
 15161518                 endinit();
<>1517 -                }
 1518 -        if( commflag ) commdec( p->tn.rval );
  1519+        }
  1520+        if (commflag)
  1521+                commdec(p->tn.rval);
15191522 }
 15201523 
<> 1524+/*
  1525+ * Merges a type tree into one type. Returns one type node with merged types
  1526+ * and class stored in the su field. Frees all other nodes.
  1527+ * XXX - classes in typedefs?
  1528+ */
15211529 NODE *
 15221530 typenode(NODE *p)
 15231531 {
     
 !
15271535         noun = UNDEF;   /* INT, CHAR or FLOAT */
 15281536         sign = 0;       /* 0, SIGNED or UNSIGNED */
 15291537 
<>1530 -        if (p->in.op == TYPE && p->in.type == UNDEF && p->in.left == NIL)
 1531 -                return p; /* For void in prototype t(void); */
  1538+        /* Remove initial QUALIFIERs */
  1539+        if (p->in.op == QUALIFIER) {
  1540+                p->in.op = FREE;
  1541+                p = p->in.left;
  1542+        }
15321543 
<> 1544+        /* Handle typedefs special */
  1545+        if (p->in.op == CLASS && p->in.type == TYPEDEF) {
  1546+                class = TYPEDEF;
  1547+                p->in.op = FREE;
  1548+                p = p->in.left;
  1549+        }
  1550+
  1551+        if (p->in.op == TYPE && p->in.left == NIL) {
  1552+                p->in.su = class;
  1553+                return p;
  1554+        }
  1555+
<_15331556         while (p != NIL) {
 15341557                 if (p->in.op == QUALIFIER) /* Skip const/volatile */
 15351558                         goto next;
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-30 18:12 +0200