diff options
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/event.c | 5 | ||||
| -rw-r--r-- | mps/code/eventcnv.c | 6 | ||||
| -rw-r--r-- | mps/code/eventcom.h | 11 | ||||
| -rw-r--r-- | mps/code/eventpro.c | 7 | ||||
| -rw-r--r-- | mps/code/misc.h | 2 |
5 files changed, 10 insertions, 21 deletions
diff --git a/mps/code/event.c b/mps/code/event.c index c83d99205a0..b3ef71fec2e 100644 --- a/mps/code/event.c +++ b/mps/code/event.c | |||
| @@ -155,9 +155,10 @@ Res EventInit(void) | |||
| 155 | AVER(Event##name##Code == code); \ | 155 | AVER(Event##name##Code == code); \ |
| 156 | AVER(0 <= code && code <= EventCodeMAX); \ | 156 | AVER(0 <= code && code <= EventCodeMAX); \ |
| 157 | AVER(sizeof(#name) - 1 <= EventNameMAX); \ | 157 | AVER(sizeof(#name) - 1 <= EventNameMAX); \ |
| 158 | AVER(Event##name##Always == always); \ | 158 | AVER((Bool)Event##name##Always == always); \ |
| 159 | AVERT(Bool, always); \ | 159 | AVERT(Bool, always); \ |
| 160 | AVER(0 <= Event##name##Kind && Event##name##Kind < EventKindLIMIT); \ | 160 | AVER(0 <= Event##name##Kind); \ |
| 161 | AVER((EventKind)Event##name##Kind < EventKindLIMIT); \ | ||
| 161 | EVENT_##name##_PARAMS(EVENT_PARAM_CHECK, name) | 162 | EVENT_##name##_PARAMS(EVENT_PARAM_CHECK, name) |
| 162 | 163 | ||
| 163 | EVENT_LIST(EVENT_CHECK, X) | 164 | EVENT_LIST(EVENT_CHECK, X) |
diff --git a/mps/code/eventcnv.c b/mps/code/eventcnv.c index bd8be9701a4..f52ab854641 100644 --- a/mps/code/eventcnv.c +++ b/mps/code/eventcnv.c | |||
| @@ -422,7 +422,6 @@ static void readLog(EventProc proc) | |||
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | while (TRUE) { /* loop for each event */ | 424 | while (TRUE) { /* loop for each event */ |
| 425 | char *eventFormat; | ||
| 426 | Event event; | 425 | Event event; |
| 427 | EventCode code; | 426 | EventCode code; |
| 428 | Res res; | 427 | Res res; |
| @@ -449,11 +448,6 @@ static void readLog(EventProc proc) | |||
| 449 | 448 | ||
| 450 | /* Output event. */ | 449 | /* Output event. */ |
| 451 | if (verbose) { | 450 | if (verbose) { |
| 452 | size_t argCount; | ||
| 453 | eventFormat = EventCode2Format(code); | ||
| 454 | argCount = strlen(eventFormat); | ||
| 455 | if (eventFormat[0] == '0') argCount = 0; | ||
| 456 | |||
| 457 | if (style == 'L') putchar('('); | 451 | if (style == 'L') putchar('('); |
| 458 | 452 | ||
| 459 | switch (style) { | 453 | switch (style) { |
diff --git a/mps/code/eventcom.h b/mps/code/eventcom.h index 47c5fd1cdc0..d92d22d610f 100644 --- a/mps/code/eventcom.h +++ b/mps/code/eventcom.h | |||
| @@ -109,7 +109,7 @@ typedef mps_clock_t EventClock; | |||
| 109 | * They are small enough to be able to be used as members of a bit set. | 109 | * They are small enough to be able to be used as members of a bit set. |
| 110 | */ | 110 | */ |
| 111 | 111 | ||
| 112 | enum { | 112 | enum EventKindEnum { |
| 113 | EventKindArena, /* Per space or arena */ | 113 | EventKindArena, /* Per space or arena */ |
| 114 | EventKindPool, /* Per pool */ | 114 | EventKindPool, /* Per pool */ |
| 115 | EventKindTrace, /* Per trace or scan */ | 115 | EventKindTrace, /* Per trace or scan */ |
| @@ -129,13 +129,14 @@ enum { | |||
| 129 | 129 | ||
| 130 | /* Note that enum values can be up to fifteen bits long portably. */ | 130 | /* Note that enum values can be up to fifteen bits long portably. */ |
| 131 | #define EVENT_ENUM(X, name, code, always, kind) \ | 131 | #define EVENT_ENUM(X, name, code, always, kind) \ |
| 132 | enum { \ | ||
| 133 | Event##name##Code = code, \ | 132 | Event##name##Code = code, \ |
| 134 | Event##name##Always = always, \ | 133 | Event##name##Always = always, \ |
| 135 | Event##name##Kind = EventKind##kind \ | 134 | Event##name##Kind = EventKind##kind, |
| 136 | }; | ||
| 137 | 135 | ||
| 138 | EVENT_LIST(EVENT_ENUM, X) | 136 | enum EventDefinitionsEnum { |
| 137 | EVENT_LIST(EVENT_ENUM, X) | ||
| 138 | EventEnumWarningSuppressor | ||
| 139 | }; | ||
| 139 | 140 | ||
| 140 | 141 | ||
| 141 | /* Event*Struct -- Event Structures | 142 | /* Event*Struct -- Event Structures |
diff --git a/mps/code/eventpro.c b/mps/code/eventpro.c index 21523825854..0fce7d44633 100644 --- a/mps/code/eventpro.c +++ b/mps/code/eventpro.c | |||
| @@ -234,20 +234,14 @@ char *LabelText(EventProc proc, Word id) | |||
| 234 | 234 | ||
| 235 | Res EventRead(Event *eventReturn, EventProc proc) | 235 | Res EventRead(Event *eventReturn, EventProc proc) |
| 236 | { | 236 | { |
| 237 | size_t eventIndex; | ||
| 238 | Res res; | 237 | Res res; |
| 239 | EventAnyStruct anyStruct; | 238 | EventAnyStruct anyStruct; |
| 240 | Event event; | 239 | Event event; |
| 241 | void *restOfEvent; | ||
| 242 | 240 | ||
| 243 | res = proc->reader(proc->readerP, &anyStruct, sizeof(anyStruct)); | 241 | res = proc->reader(proc->readerP, &anyStruct, sizeof(anyStruct)); |
| 244 | if (res != ResOK) | 242 | if (res != ResOK) |
| 245 | return res; | 243 | return res; |
| 246 | 244 | ||
| 247 | eventIndex = eventCode2Index(anyStruct.code, TRUE); | ||
| 248 | assert(anyStruct.code == EventInternCode || | ||
| 249 | anyStruct.size == eventTypes[eventIndex].size); | ||
| 250 | |||
| 251 | if (proc->cachedEvent != NULL) { | 245 | if (proc->cachedEvent != NULL) { |
| 252 | event = proc->cachedEvent; | 246 | event = proc->cachedEvent; |
| 253 | proc->cachedEvent = NULL; | 247 | proc->cachedEvent = NULL; |
| @@ -259,7 +253,6 @@ Res EventRead(Event *eventReturn, EventProc proc) | |||
| 259 | } | 253 | } |
| 260 | 254 | ||
| 261 | event->any = anyStruct; | 255 | event->any = anyStruct; |
| 262 | restOfEvent = PointerAdd(event, sizeof(anyStruct)); | ||
| 263 | res = proc->reader(proc->readerP, | 256 | res = proc->reader(proc->readerP, |
| 264 | PointerAdd(event, sizeof(anyStruct)), | 257 | PointerAdd(event, sizeof(anyStruct)), |
| 265 | anyStruct.size - sizeof(anyStruct)); | 258 | anyStruct.size - sizeof(anyStruct)); |
diff --git a/mps/code/misc.h b/mps/code/misc.h index 68f7a33da9e..0557c9af6fc 100644 --- a/mps/code/misc.h +++ b/mps/code/misc.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | typedef int Bool; /* <design/type/#bool> */ | 19 | typedef int Bool; /* <design/type/#bool> */ |
| 20 | enum { | 20 | enum BoolEnum { |
| 21 | FALSE = 0, | 21 | FALSE = 0, |
| 22 | TRUE = 1 | 22 | TRUE = 1 |
| 23 | }; | 23 | }; |