Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.47
 
1.48
 
MAIN:ragge:20030610120813
 
pftn.c
_>10251025         }
 10261026 }
 10271027 
<>1028 -#define MAXNSTRING      1000
 1029 -static char *strarray[MAXNSTRING];
 1030 -static int labarray[MAXNSTRING];
 1031 -static int nstring;
 1032 -
10331028 /*
 10341029  * Write last part of string.
 10351030  */
 10361031 NODE *
 10371032 strend(char *str)
 10381033 {
<> 1034+        struct symtab *s;
10391035         int lxarg, i, val, strtemp, strlab;
 10401036         char *wr = str;
 10411037         NODE *p;
     
 !
10831079                 goto inl;
 10841080 
 10851081         /* If an identical string is already emitted, just forget this one */
<>1086 -        str = addstring(str); /* enter string in string table */
 1087 -        for (i = 0; i < nstring; i++) {
 1088 -                if (strarray[i] == str)
 1089 -                        break;
 1090 -        }
 1091 -        if (i == nstring) { /* No string */
 1092 -                if (nstring == MAXNSTRING) {
 1093 -                        cerror("out of string space");
 1094 -                        nstring = 0;
 1095 -                }
  1082+        str = addstring(str);           /* enter string in string table */
  1083+        s = lookup(str, SSTRING);       /* check for existance */
  1084+
  1085+        if (s->soffset == 0) { /* No string */
  1086+                s->sclass = ILABEL;
  1087+
10961088                  /* set up location counter */
 10971089 inl:            strtemp = locctr(blevel==0 ? ISTRNG : STRNG);
 10981090                 deflab(strlab = getlab());
<>1099 -                if (isinlining == 0) {
 1100 -                        strarray[nstring] = str;
 1101 -                        labarray[nstring] = strlab;
 1102 -                }
  1091+                if (isinlining == 0)
  1092+                        s->soffset = strlab;
  1093+
11031094                 i = 0;
 11041095                 while (*wr != 0) {
 11051096                         if (*wr++ == '\\')
     
 !
11121103                 bycode(0, i++);
 11131104                 bycode(-1, i);
 11141105                 (void) locctr(blevel==0 ? ilocctr : strtemp);
<>1115 -                if (isinlining == 0)
 1116 -                        nstring++;
11171106         } else {
<>1118 -                strlab = labarray[i];
 1119 -                i = strlen(strarray[i]);
  1107+                strlab = s->soffset;
  1108+                i = strlen(str)+1;
11201109         }
 11211110 
 11221111         dimtab[curdim] = i; /* in case of later sizeof ... */
 11231112         p = buildtree(STRING, NIL, NIL);
<>1124 -        p->n_sp = permalloc(sizeof(struct symtab_hdr));
 1125 -        p->n_sp->sclass = ILABEL;
 1126 -        p->n_sp->soffset = strlab;
  1113+        if (isinlining) {
  1114+                p->n_sp = permalloc(sizeof(struct symtab_hdr));
  1115+                p->n_sp->sclass = ILABEL;
  1116+                p->n_sp->soffset = strlab;
  1117+        } else
  1118+                p->n_sp = s;
  1119+
11271120         return(p);
 11281121 }
 11291122 
     
 !
18991892                 t += (ARY-PTR);
 19001893                 if (p->n_right->n_op != ICON) {
 19011894                         q = p->n_right;
<>1902 -                        o = RB; /* cannot happen */
  1895+                        o = RB;
<_19031896                 } else {
 19041897                         temp = p->n_right->n_lval;
 19051898                         p->n_right->n_op = FREE;
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:57 +0200