Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.22
 
1.23
 
MAIN:ragge:20030111111205
 
pftn.c
_>10081008         }
 10091009 }
 10101010 
<> 1011+static int strarr; /* Current string is written as an array */
  1012+static int instr; /* # of chars written out so far */
  1013+static int lxarg;
  1014+static int strtemp, strlab;
10111015 /*
<>1012 - * decide if the string is external or an initializer,
 1013 - * and get the contents accordingly
  1016+ * First element of a string to write.
10141017  */
<>1015 -NODE *
 1016 -getstr()
  1018+void
  1019+strbeg()
10171020 {
<>1018 -        int l, temp;
 1019 -        NODE *p;
 1020 -
  1021+        strarr = lxarg = 0;
10211022         if ((iclass == EXTDEF || iclass==STATIC) &&
 10221023             (pstk->in_t == CHAR || pstk->in_t == UCHAR) &&
<>1023 -            pstk != instack && ISARY(pstk[-1].in_t)) {
  1024+            pstk != instack && ISARY(pstk[-1].in_t))
  1025+                strarr = 1;
  1026+
  1027+        if (strarr) {
10241028                 /* treat "abc" as { 'a', 'b', 'c', 0 } */
<>1025 -                strflg = 1;
10261029                 ilbrace();  /* simulate { */
 10271030                 inforce(pstk->in_off);
 10281031                 /*
     
 !
10311034                  * unwanted initializers
 10321035                  */
 10331036 
<>1034 -                  /* get the contents */
 1035 -                lxstr((pstk-1) != instack ? dimtab[(pstk-1)->in_d] : 0);
 1036 -                irbrace();  /* simulate } */
 1037 -                return(NIL);
  1037+                lxarg = (pstk-1) != instack ? dimtab[(pstk-1)->in_d] : 0;
10381038         } else {
 10391039                 /* make a label, and get the contents and stash them away */
 10401040                 if (iclass != SNULL) { /* initializing */
 10411041                         /* fill out previous word, to permit pointer */
 10421042                         vfdalign(ALPOINT);
 10431043                 }
 10441044                  /* set up location counter */
<>1045 -                temp = locctr(blevel==0 ? ISTRNG : STRNG);
 1046 -                deflab(l = getlab());
 1047 -                strflg = 0;
 1048 -                lxstr(0); /* get the contents */
 1049 -                (void) locctr(blevel==0 ? ilocctr : temp);
 1050 -                p = buildtree(STRING, NIL, NIL);
 1051 -                p->tn.rval = -l;
 1052 -                return(p);
  1045+                strtemp = locctr(blevel==0 ? ISTRNG : STRNG);
  1046+                deflab(strlab = getlab());
10531047         }
<> 1048+        instr = lxstr(lxarg, strarr, 0);
  1049+
10541050 }
 10551051 
 10561052 /*
<> 1053+ * Write more string elements.
  1054+ */
  1055+void
  1056+strcont()
  1057+{
  1058+        instr = lxstr(lxarg, strarr, instr);
  1059+}
  1060+
  1061+/*
  1062+ * Write last part of string.
  1063+ */
  1064+NODE *
  1065+strend()
  1066+{
  1067+        NODE *p;
  1068+
  1069+        if (strarr) {
  1070+                if (lxarg == 0 || instr < lxarg)
  1071+                        putbyte(0);
  1072+                irbrace();  /* simulate } */
  1073+                return(NIL);
  1074+        }
  1075+        bycode(0, instr++);
  1076+        bycode(-1, instr);
  1077+        dimtab[curdim] = instr; /* in case of later sizeof ... */
  1078+        (void) locctr(blevel==0 ? ilocctr : strtemp);
  1079+        p = buildtree(STRING, NIL, NIL);
  1080+        p->tn.rval = -strlab;
  1081+        return(p);
  1082+}
  1083+
  1084+/*
<_10571085  * simulate byte v appearing in a list of integer values
 10581086  */
 10591087 void
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-02 18:53 +0200