aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2012-08-31 20:17:16 +0100
committerRichard Brooksby2012-08-31 20:17:16 +0100
commit880d79ba0e4e38e700a500560557d843095f6b04 (patch)
tree279c9902d2a1fe45eab8a4bcb5f1050e6bb88c9a /mps/code
parent03b25f13a52d6a9dc7b1e6532952c99e31c5d030 (diff)
downloademacs-880d79ba0e4e38e700a500560557d843095f6b04.tar.gz
emacs-880d79ba0e4e38e700a500560557d843095f6b04.zip
Missing changes from changelist 179142. oops.
Copied from Perforce Change: 179144 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/eventcnv.c19
-rw-r--r--mps/code/eventpro.h2
2 files changed, 11 insertions, 10 deletions
diff --git a/mps/code/eventcnv.c b/mps/code/eventcnv.c
index ffdad909ad6..7a0b226b520 100644
--- a/mps/code/eventcnv.c
+++ b/mps/code/eventcnv.c
@@ -209,14 +209,13 @@ static void processEvent(EventProc proc, Event event, Word etime)
209 209
210/* printStr -- print an EventString */ 210/* printStr -- print an EventString */
211 211
212static void printStr(EventString str, Bool quotes) 212static void printStr(const char *str, Bool quotes)
213{ 213{
214 size_t i, len; 214 size_t i;
215 215
216 if (quotes) putchar('"'); 216 if (quotes) putchar('"');
217 len = str->len; 217 for (i = 0; str[i] != '\0'; ++i) {
218 for (i = 0; i < len; ++ i) { 218 char c = str[i];
219 char c = str->str[i];
220 if (quotes && (c == '"' || c == '\\')) putchar('\\'); 219 if (quotes && (c == '"' || c == '\\')) putchar('\\');
221 putchar(c); 220 putchar(c);
222 } 221 }
@@ -233,7 +232,7 @@ static void printAddr(EventProc proc, Addr addr)
233 label = AddrLabel(proc, addr); 232 label = AddrLabel(proc, addr);
234 if (label != 0 && addr != 0) { 233 if (label != 0 && addr != 0) {
235 /* We assume labelling zero is meant to record a point in time */ 234 /* We assume labelling zero is meant to record a point in time */
236 EventString sym = LabelText(proc, label); 235 const char *sym = LabelText(proc, label);
237 if (sym != NULL) { 236 if (sym != NULL) {
238 putchar(' '); 237 putchar(' ');
239 printStr(sym, (style == 'C')); 238 printStr(sym, (style == 'C'));
@@ -358,6 +357,7 @@ static void printParamW(EventProc proc, char *styleConv, Word w)
358static void printParamD(EventProc proc, char *styleConv, double d) 357static void printParamD(EventProc proc, char *styleConv, double d)
359{ 358{
360 UNUSED(proc); 359 UNUSED(proc);
360 UNUSED(styleConv);
361 switch (style) { 361 switch (style) {
362 case '\0': 362 case '\0':
363 printf(" %#8.3g", d); break; 363 printf(" %#8.3g", d); break;
@@ -368,12 +368,13 @@ static void printParamD(EventProc proc, char *styleConv, double d)
368 } 368 }
369} 369}
370 370
371static void printParamS(EventProc proc, char *styleConv, EventStringStruct s) 371static void printParamS(EventProc proc, char *styleConv, const char *s)
372{ 372{
373 UNUSED(proc); 373 UNUSED(proc);
374 UNUSED(styleConv);
374 if (style == 'C') putchar(','); 375 if (style == 'C') putchar(',');
375 putchar(' '); 376 putchar(' ');
376 printStr(&s, (style == 'C' || style == 'L')); 377 printStr(s, (style == 'C' || style == 'L'));
377} 378}
378 379
379static void printParamB(EventProc proc, char *styleConv, Bool b) 380static void printParamB(EventProc proc, char *styleConv, Bool b)
@@ -479,7 +480,7 @@ static void readLog(EventProc proc)
479 switch (style) { 480 switch (style) {
480 case '\0': case 'C': 481 case '\0': case 'C':
481 { 482 {
482 EventString sym = LabelText(proc, event->Label.f1); 483 const char *sym = LabelText(proc, event->Label.f1);
483 printf(style == '\0' ? 484 printf(style == '\0' ?
484 " %08"PRIXLONGEST" " : 485 " %08"PRIXLONGEST" " :
485 ", %"PRIuLONGEST", ", 486 ", %"PRIuLONGEST", ",
diff --git a/mps/code/eventpro.h b/mps/code/eventpro.h
index bd6cbebfc76..d9074d8638f 100644
--- a/mps/code/eventpro.h
+++ b/mps/code/eventpro.h
@@ -25,7 +25,7 @@ extern char *EventCode2Format(EventCode code);
25extern Bool EventCodeIsValid(EventCode code); 25extern Bool EventCodeIsValid(EventCode code);
26 26
27extern Word AddrLabel(EventProc proc, Addr addr); 27extern Word AddrLabel(EventProc proc, Addr addr);
28extern EventString LabelText(EventProc proc, Word label); 28extern char *LabelText(EventProc proc, Word label);
29 29
30extern Res EventRead(Event *eventReturn, EventProc proc); 30extern Res EventRead(Event *eventReturn, EventProc proc);
31extern void EventDestroy(EventProc proc, Event event); 31extern void EventDestroy(EventProc proc, Event event);