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) AVER(Event##name##Code == code); \ AVER(0 <= code && code <= EventCodeMAX); \ AVER(sizeof(#name) - 1 <= EventNameMAX); \ - AVER(Event##name##Always == always); \ + AVER((Bool)Event##name##Always == always); \ AVERT(Bool, always); \ - AVER(0 <= Event##name##Kind && Event##name##Kind < EventKindLIMIT); \ + AVER(0 <= Event##name##Kind); \ + AVER((EventKind)Event##name##Kind < EventKindLIMIT); \ EVENT_##name##_PARAMS(EVENT_PARAM_CHECK, name) 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) } while (TRUE) { /* loop for each event */ - char *eventFormat; Event event; EventCode code; Res res; @@ -449,11 +448,6 @@ static void readLog(EventProc proc) /* Output event. */ if (verbose) { - size_t argCount; - eventFormat = EventCode2Format(code); - argCount = strlen(eventFormat); - if (eventFormat[0] == '0') argCount = 0; - if (style == 'L') putchar('('); 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; * They are small enough to be able to be used as members of a bit set. */ -enum { +enum EventKindEnum { EventKindArena, /* Per space or arena */ EventKindPool, /* Per pool */ EventKindTrace, /* Per trace or scan */ @@ -129,13 +129,14 @@ enum { /* Note that enum values can be up to fifteen bits long portably. */ #define EVENT_ENUM(X, name, code, always, kind) \ - enum { \ Event##name##Code = code, \ Event##name##Always = always, \ - Event##name##Kind = EventKind##kind \ - }; + Event##name##Kind = EventKind##kind, -EVENT_LIST(EVENT_ENUM, X) +enum EventDefinitionsEnum { + EVENT_LIST(EVENT_ENUM, X) + EventEnumWarningSuppressor +}; /* 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) Res EventRead(Event *eventReturn, EventProc proc) { - size_t eventIndex; Res res; EventAnyStruct anyStruct; Event event; - void *restOfEvent; res = proc->reader(proc->readerP, &anyStruct, sizeof(anyStruct)); if (res != ResOK) return res; - eventIndex = eventCode2Index(anyStruct.code, TRUE); - assert(anyStruct.code == EventInternCode || - anyStruct.size == eventTypes[eventIndex].size); - if (proc->cachedEvent != NULL) { event = proc->cachedEvent; proc->cachedEvent = NULL; @@ -259,7 +253,6 @@ Res EventRead(Event *eventReturn, EventProc proc) } event->any = anyStruct; - restOfEvent = PointerAdd(event, sizeof(anyStruct)); res = proc->reader(proc->readerP, PointerAdd(event, sizeof(anyStruct)), 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 @@ typedef int Bool; /* */ -enum { +enum BoolEnum { FALSE = 0, TRUE = 1 };