Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.165
 
1.166
 
MAIN:ragge:20070819192451
 
pftn.c
_>10291029 {
 10301030 
 10311031         int i;
<>1032 -        OFFSZ mult;
  1032+        OFFSZ mult, sz;
10331033 
 10341034         mult = 1;
 10351035 
     
 !
10521052 
 10531053         if (sue == NULL)
 10541054                 cerror("bad tsize sue");
<> 1055+        sz = sue->suesize;
  1056+#ifdef GCC_COMPAT
  1057+        if (ty == VOID)
  1058+                sz = SZCHAR;
  1059+#endif
10551060         if (ty != STRTY && ty != UNIONTY) {
<>1056 -                if (sue->suesize == 0) {
  1061+                if (sz == 0) {
10571062                         uerror("unknown size");
 10581063                         return(SZINT);
 10591064                 }
     
 !
10621067                         uerror("unknown structure/union/enum");
 10631068         }
 10641069 
<>1065 -        return((unsigned int)sue->suesize * mult);
  1070+        return((unsigned int)sz * mult);
10661071 }
 10671072 
<>1068 -int idebug;
  1073+/*
  1074+ * Write last part of wide string.
  1075+ * Do not bother to save wide strings.
  1076+ */
  1077+NODE *
  1078+wstrend(char *str)
  1079+{
  1080+        struct symtab *sp = getsymtab(str, SSTRING|STEMP);
  1081+        struct strsched *sc = tmpalloc(sizeof(struct strsched));
  1082+        NODE *p = block(NAME, NIL, NIL, WCHAR_TYPE+ARY,
  1083+            tmpalloc(sizeof(union dimfun)), MKSUE(WCHAR_TYPE));
  1084+        int i;
  1085+        char *c;
10691086 
<> 1087+        sp->sclass = ILABEL;
  1088+        sp->soffset = getlab();
  1089+        sp->stype = WCHAR_TYPE+ARY;
  1090+
  1091+        sc = tmpalloc(sizeof(struct strsched));
  1092+        sc->locctr = STRNG;
  1093+        sc->sym = sp;
  1094+        sc->next = strpole;
  1095+        strpole = sc;
  1096+
  1097+        /* length calculation, used only for sizeof */
  1098+        for (i = 0, c = str; *c; ) {
  1099+                if (*c++ == '\\')
  1100+                        (void)esccon(&c);
  1101+                i++;
  1102+        }
  1103+        p->n_df->ddim = (i+1) * ((MKSUE(WCHAR_TYPE))->suesize/SZCHAR);
  1104+        p->n_sp = sp;
  1105+        return(p);
  1106+}
  1107+
10701108 /*
 10711109  * Write last part of string.
 10721110  */
     
 !
11221160 strprint()
 11231161 {
 11241162         char *wr;
<>1125 -        int i, val;
  1163+        int i, val, isw;
  1164+        NODE *p = bcon(0);
11261165 
 11271166         while (strpole != NULL) {
 11281167                 setloc1(STRNG);
 11291168                 deflab1(strpole->sym->soffset);
<> 1169+                isw = strpole->sym->stype == WCHAR_TYPE+ARY;
11301170 
 11311171                 i = 0;
 11321172                 wr = strpole->sym->sname;
     
 !
11351175                                 val = esccon(&wr);
 11361176                         else
 11371177                                 val = (unsigned char)wr[-1];
<>1138 -                        bycode(val, i);
  1178+                        if (isw) {
  1179+                                p->n_lval = val;
  1180+                                p->n_type = WCHAR_TYPE;
  1181+                                ninval(i*(WCHAR_TYPE/SZCHAR),
  1182+                                    (MKSUE(WCHAR_TYPE))->suesize, p);
  1183+                        } else
  1184+                                bycode(val, i);
11391185                         i++;
 11401186                 }
<>1141 -                bycode(0, i++);
 1142 -                bycode(-1, i);
  1187+                if (isw) {
  1188+                        p->n_lval = 0;
  1189+                        ninval(i*(WCHAR_TYPE/SZCHAR),
  1190+                            (MKSUE(WCHAR_TYPE))->suesize, p);
  1191+                } else {
  1192+                        bycode(0, i++);
  1193+                        bycode(-1, i);
  1194+                }
11431195                 strpole = strpole->next;
 11441196         }
<> 1197+        nfree(p);
<_11451198 }
 11461199 
 11471200 #if 0
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-10-31 21:03 +0100