Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.44
 
1.45
 
MAIN:ragge:20030610080804
 
pftn.c
_>2424         struct  symtab *rsym;
 2525 };
 2626 
<>27 -struct instk {
  27+/*
  28+ * Linked list for parameter declaration.
  29+ */
  30+static struct params {
  31+        struct params *next;
  32+        struct symtab *sym;
  33+} *parampole;
  34+static int nparams;
  35+
  36+/*
  37+ * Struct used in array initialisation.
  38+ */
  39+static struct instk {
2840         struct  instk *in_prev/* linked list */
 2941         int     in_sz;          /* size of array element */
 3042         struct  symtab **in_xp/* member in structure initializations */
     
 !
300312                 p->ssue->suesize = 0;
 301313                 p->ssue->suelem = NULL;
 302314                 p->ssue->suealign = ALSTRUCT;
<>303 -                p->ssue->suesym = p;
304315         } else {
 305316                 switch (BTYPE(type)) {
 306317                 case STRTY:
     
 !
309320                         p->ssue = q->n_sue;
 310321                         break;
 311322                 default:
<>312 -                        p->ssue = (struct suedef *)&dimtab[BTYPE(type)];
  323+                        p->ssue = MKSUE(BTYPE(type));
313324                 }
 314325         }
 315326 
     
 !
420431 void
 421432 dclargs()
 422433 {
<>423 -        int i, j;
 424 -        struct symtab *p;
  434+        struct params *a;
  435+        struct symtab *p, **parr;
425436         NODE *q;
<>426 -        argoff = ARGINIT;
  437+        int i;
427438 
<> 439+        argoff = ARGINIT;
428440 # ifndef BUG1
 429441         if (ddebug > 2)
 430442                 printf("dclargs()\n");
 431443 # endif
<>432 -        for (i = 0; i < paramno; ++i) {
 433 -                if ((j = paramstk[i]) < 0)
 434 -                        continue;
 435 -                p = (struct symtab *)j;
  444+
  445+        parr = tmpalloc(sizeof(struct symtab *) * nparams);
  446+        for (a = parampole, i = nparams; a && i; a = a->next)
  447+                parr[--i] = a->sym;
  448+
  449+        for (i = 0; i < nparams; i++) {
  450+                p = parr[i];
436451 # ifndef BUG1
 437452                 if (ddebug > 2) {
<>438 -                        printf("\t%s (%d) ",p->sname, j);
  453+                        printf("\t%s (%p) ",p->sname, p);
439454                         tprint(p->stype);
 440455                         printf("\n");
 441456                 }
 442457 # endif
 443458                 if (p->stype == FARG) {
<>444 -                        q = block(FREE, NIL, NIL, INT, 0,
 445 -                            (struct suedef *)&dimtab[INT]);
 446 -                        q->n_rval = j;
  459+                        q = block(FREE, NIL, NIL, INT, 0, MKSUE(INT));
  460+                        q->n_sp = p;
447461                         defid(q, PARAM);
 448462                 }
 449463                 FIXARG(p); /* local arg hook, eg. for sym. debugger */
     
 !
454468         (void) locctr(PROG);
 455469         defalign(ALINT);
 456470         ftnno = getlab();
<>457 -        bfcode(paramstk, paramno);
 458 -        paramno = 0;
  471+        bfcode(parr, nparams);
  472+        nparams = 0;
459473 }
 460474 
 461475 /*
     
 !
573587         TWORD temp;
 574588         int high, low;
 575589 
<>576 -        /*
 577 -         * paramstk contains:
 578 -         *      paramstk[oparam] = previous instruct
 579 -         *      paramstk[oparam+1] = previous class
 580 -         *      paramstk[oparam+2] = previous strucoff
 581 -         *      paramstk[oparam+3] = structure name
 582 -         *
 583 -         *      paramstk[oparam+4, ...]  = member stab indices
 584 -         */
 585 -
 586 -
587590         if (r->rsym == NULL) {
 588591                 sue = permalloc(sizeof(struct suedef));
 589592                 sue->suesize = 0;
 590593                 sue->suelem = NULL;
 591594                 sue->suealign = ALSTRUCT;
<>592 -                sue->suesym = NULL; /* XXX -lineno */
593595         } else
 594596                 sue = r->rsym->ssue;
 595597 
     
 !
652654 
 653655         sue->suesize = strucoff;
 654656         sue->suealign = al;
<>655 -        sue->suesym = r->rsym;
656657 
 657658 //      FIXSTRUCT(szindex, oparam); /* local hook, eg. for sym debugger */
 658659 #if 0
     
 !
694695 void
 695696 ftnarg(char *name)
 696697 {
<> 698+        struct params *p;
697699         struct symtab *s = lookup(name, 0);
 698700 
 699701         blevel = 1; /* Always */
     
 !
717719         }
 718720         s->stype = FARG;
 719721         s->sclass = PARAM;
<>720 -        psave((int)s);
  722+
  723+        p = tmpalloc(sizeof(struct params));
  724+        p->next = parampole;
  725+        p->sym = s;
  726+        parampole = p;
  727+        nparams++;
721728 }
 722729 
 723730 /*
     
 !
18451852 
 18461853         /* in case ctype has rewritten things */
 18471854         if ((t = BTYPE(idp->n_type)) != STRTY && t != UNIONTY && t != ENUMTY)
<>1848 -                idp->n_sue = (struct suedef *)&dimtab[t];
  1855+                idp->n_sue = MKSUE(t);
<_18491856 
 18501857         return(idp);
 18511858 }
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 22:16 +0200