Mercurial > hg > CbC > old > device
diff mc-code-powerpc.c @ 517:d686497e8fd2
cstring array fix.
author | kono |
---|---|
date | Mon, 26 Dec 2005 12:17:23 +0900 |
parents | bfa4c834a3b8 |
children | 9f2d6aea201f |
line wrap: on
line diff
--- a/mc-code-powerpc.c Mon Dec 26 10:55:15 2005 +0900 +++ b/mc-code-powerpc.c Mon Dec 26 12:17:23 2005 +0900 @@ -2925,6 +2925,7 @@ extern void ascii(char *s) { + cstring_mode(); printf("\t.ascii \""); while(*s) { if (*s=='\n') @@ -2968,14 +2969,14 @@ } void -emit_global(NMTBL *n,int t,int e) +emit_global(NMTBL *n,int a,int e) { - if (e && car(e)==STRING) { - cstring_mode(); - } else { - data_mode(n->nm); - align(t); - } + int t = type_value(n->ty); + if (e>0 && car(e)==STRING && t>0 && car(t)==ARRAY && + (type_value(cadr(t))==CHAR||type_value(cadr(t))==UCHAR)) { + cstring_mode(); + } else + data_mode(n->nm); printf("\t.globl\t_%s\n",n->nm); printf("_%s:\n",n->nm); }