Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.199
 
1.200
 
MAIN:ragge:20080402193849
 
pftn.c
_>572572 }
 573573 
 574574 /*
<> 575+ * Struct/union/enum symtab construction.
  576+ */
  577+static void
  578+defstr(struct symtab *sp, int class)
  579+{
  580+        sp->ssue = permalloc(sizeof(struct suedef));
  581+        sp->ssue->suesize = 0;
  582+        sp->ssue->sylnk = NULL;
  583+        sp->ssue->suealign = 0;
  584+        sp->sclass = class;
  585+        if (class == STNAME)
  586+                sp->stype = STRTY;
  587+        else if (class == UNAME)
  588+                sp->stype = UNIONTY;
  589+}
  590+
  591+/*
575592  * Declare a struct/union/enum tag.
 576593  * If not found, create a new tag with UNDEF type.
 577594  */
     
 !
582599 
 583600         if ((sp = lookup(name, STAGNAME))->ssue == NULL) {
 584601                 /* New tag */
<>585 -                sp->ssue = permalloc(sizeof(struct suedef));
 586 -                sp->ssue->suesize = 0;
 587 -                sp->ssue->sylnk = NULL;
 588 -                sp->ssue->suealign = 0;
 589 -                sp->sclass = class;
 590 -                if (class == STNAME)
 591 -                        sp->stype = STRTY;
 592 -                else if (class == UNAME)
 593 -                        sp->stype = UNIONTY;
 594 -        } else if (sp->sclass != class) {
 595 -                /* redeclaration of tag */
  602+                defstr(sp, class);
  603+        } else if (sp->sclass != class)
596604                 uerror("tag %s redeclared", name);
<>597 -        }
598605         return sp;
 599606 }
 600607 
     
 !
651658                 return NULL;
 652659 
 653660         sp = deftag(name, ENAME);
<>654 -        if (sp->stype != UNDEF) /* enum type already declared */
 655 -                uerror("%s redeclared", name);
  661+        if (sp->stype != UNDEF) {
  662+                if (sp->slevel == blevel)
  663+                        uerror("%s redeclared", name);
  664+                sp = hide(sp);
  665+                defstr(sp, ENAME);
  666+        }
656667         return sp;
 657668 }
 658669 
     
 !
713724 
 714725         if (name != NULL) {
 715726                 sp = deftag(name, soru);
<>716 -                if (sp->ssue->suealign != 0)
 717 -                        uerror("%s redeclared", name);
  727+                if (sp->ssue->suealign != 0) {
  728+                        if (sp->slevel < blevel) {
  729+                                sp = hide(sp);
  730+                                defstr(sp, soru);
  731+                        } else
  732+                                uerror("%s redeclared", name);
  733+                }
<_718734                 sp->ssue->suealign = ALSTRUCT;
 719735         } else
 720736                 sp = NULL;
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:36 +0200