Mercurial > hg > CbC > old > device
changeset 921:35b339b36c88
fix
author | kono |
---|---|
date | Fri, 11 Apr 2014 14:04:11 +0900 |
parents | 485f13206916 |
children | 3cdc3c1d83bd |
files | mc-code-arm.c mc-code-ia32.c mc-code-mips.c mc-code-powerpc.c mc-code-spu.c |
diffstat | 5 files changed, 37 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-arm.c Fri Apr 11 14:01:03 2014 +0900 +++ b/mc-code-arm.c Fri Apr 11 14:04:11 2014 +0900 @@ -3646,10 +3646,13 @@ } } -static void +extern void ascii(char *s,int len) { - printf("\t.ascii \""); + if (s[len-1]==0) + printf("\t.string \""); + else + printf("\t.ascii \""); while(len-->0) { if (*s=='\n') printf("%cn",92); @@ -3659,12 +3662,13 @@ printf("\\\\"); else if (*s==34) printf("%c%c",92,34); - else + else printf("%c",*s); s++; } - printf("\\0%c\n",34); -} + printf("%c\n",34); +} + int emit_string_label() {
--- a/mc-code-ia32.c Fri Apr 11 14:01:03 2014 +0900 +++ b/mc-code-ia32.c Fri Apr 11 14:04:11 2014 +0900 @@ -2715,11 +2715,10 @@ extern void ascii(char *s,int len) { -#ifdef __APPLE__ - printf("\t.ascii \""); -#else - printf("\t.string \""); -#endif + if (s[len-1]==0) + printf("\t.string \""); + else + printf("\t.ascii \""); while(len-->0) { if (*s=='\n') printf("%cn",92); @@ -2733,11 +2732,7 @@ printf("%c",*s); s++; } -#ifdef __APPLE__ - printf("\\0%c\n",34); -#else printf("%c\n",34); -#endif } extern int
--- a/mc-code-mips.c Fri Apr 11 14:01:03 2014 +0900 +++ b/mc-code-mips.c Fri Apr 11 14:04:11 2014 +0900 @@ -3316,10 +3316,13 @@ } } -void +extern void ascii(char *s,int len) { - printf("\t.ascii \""); + if (s[len-1]==0) + printf("\t.string \""); + else + printf("\t.ascii \""); while(len-->0) { if (*s=='\n') printf("%cn",92); @@ -3329,11 +3332,11 @@ printf("\\\\"); else if (*s==34) printf("%c%c",92,34); - else + else printf("%c",*s); s++; } - printf("\\0%c\n\t.align 2\n",34); + printf("%c\n",34); } extern int
--- a/mc-code-powerpc.c Fri Apr 11 14:01:03 2014 +0900 +++ b/mc-code-powerpc.c Fri Apr 11 14:04:11 2014 +0900 @@ -3854,11 +3854,10 @@ ascii(char *s,int len) { cstring_mode(); -#ifdef __APPLE__ - printf("\t.ascii \""); -#else - printf("\t.string \""); -#endif + if (s[len-1]==0) + printf("\t.string \""); + else + printf("\t.ascii \""); while(len-->0) { if (*s=='\n') printf("%cn",92); @@ -3868,12 +3867,13 @@ printf("\\\\"); else if (*s==34) printf("%c%c",92,34); - else + else printf("%c",*s); s++; } - printf("\\0%c\n\t.align 2\n",34); -} + printf("%c\n\t.align 2\n",34); +} + extern int emit_string_label() {
--- a/mc-code-spu.c Fri Apr 11 14:01:03 2014 +0900 +++ b/mc-code-spu.c Fri Apr 11 14:04:11 2014 +0900 @@ -2639,10 +2639,13 @@ } } -static void +extern void ascii(char *s,int len) { - printf("\t.string \""); + if (s[len-1]==0) + printf("\t.string \""); + else + printf("\t.ascii \""); while(len-->0) { if (*s=='\n') printf("%cn",92); @@ -2652,12 +2655,13 @@ printf("\\\\"); else if (*s==34) printf("%c%c",92,34); - else + else printf("%c",*s); s++; } - printf("\\0%c\n",34); -} + printf("%c\n",34); +} + int emit_string_label() {