From 5bdb108e47fb2ff9449e0d0241b66b680798649d Mon Sep 17 00:00:00 2001 From: erikb Date: Thu, 27 Mar 1986 11:01:12 +0000 Subject: [PATCH] modified the string-constant printing routines; bts2str() is invoked --- lang/cem/cemcom/Makefile.erik | 2 +- lang/cem/cemcom/dumpidf.c | 12 ++++++++++-- lang/cem/cemcom/main.c | 9 ++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lang/cem/cemcom/Makefile.erik b/lang/cem/cemcom/Makefile.erik index 3fe901821..8acb5b6e9 100644 --- a/lang/cem/cemcom/Makefile.erik +++ b/lang/cem/cemcom/Makefile.erik @@ -185,7 +185,7 @@ sim: cfiles $(SIM) $(SIMFLAGS) `sources $(COBJ)` $(GSRC) $(LSRC) #AUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTOAUTO -main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h +main.o: LLlex.h Lpars.h alloc.h arith.h debug.h declar.h idf.h input.h inputtype.h level.h maxincl.h myalloc.h nobitfield.h nopp.h spec_arith.h specials.h target_sizes.h tokenname.h type.h use_tmp.h ssize.h idf.o: LLlex.h Lpars.h align.h alloc.h arith.h assert.h botch_free.h debug.h declar.h decspecs.h def.h idf.h idfsize.h label.h level.h nobitfield.h nopp.h sizes.h spec_arith.h specials.h stack.h storage.h struct.h type.h declarator.o: Lpars.h alloc.h arith.h botch_free.h declar.h expr.h idf.h label.h nobitfield.h nopp.h sizes.h spec_arith.h storage.h type.h decspecs.o: Lpars.h arith.h decspecs.h def.h level.h nobitfield.h spec_arith.h type.h diff --git a/lang/cem/cemcom/dumpidf.c b/lang/cem/cemcom/dumpidf.c index b2732bfd5..867b73174 100644 --- a/lang/cem/cemcom/dumpidf.c +++ b/lang/cem/cemcom/dumpidf.c @@ -284,7 +284,8 @@ type2str(tp) } char * /* the ultimate transient buffer supplier */ -next_transient() { +next_transient() +{ static int bnum; static char buf[MAXTRANS][300]; @@ -340,8 +341,15 @@ p1_expr(lvl, expr) v->vl_value); break; case String: - printf("%s\n", expr->SG_VALUE); + { + char bts2str(); + + printf( + "%s\n", + bts2str(expr->SG_VALUE, expr->SG_LEN, next_transient()) + ); break; + } case Float: printf("%s\n", expr->FL_VALUE); break; diff --git a/lang/cem/cemcom/main.c b/lang/cem/cemcom/main.c index 276b11f01..685f7830f 100644 --- a/lang/cem/cemcom/main.c +++ b/lang/cem/cemcom/main.c @@ -21,6 +21,7 @@ #include "LLlex.h" #include "alloc.h" #include "specials.h" +#include "ssize.h" extern struct tokenname tkidf[], tkother[]; extern char *symbol2str(); @@ -328,8 +329,14 @@ preprocess() printf(" "); break; case STRING: - printf("\"%s\" ", dot.tk_bts); + { + char sbuf[SSIZE]; + char *bts2str(); + + printf("\"%s\" ", + bts2str(dot.tk_bts, dot.tk_len, sbuf)); break; + } case INTEGER: printf("%ld ", dot.tk_ival); break;