From df5e1dced56908a5756baea430ffe2addb4ba732 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Fri, 29 Oct 2004 06:55:30 +0000 Subject: [PATCH] Correct InitEvent, initialize also the event type --- org.glite.lb.common/src/events.c.T | 1 + org.glite.lb.common/src/events_parse.c.T | 2 -- org.glite.lb.common/test/parse.cpp.T | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/org.glite.lb.common/src/events.c.T b/org.glite.lb.common/src/events.c.T index 24a8c69..3d0861a 100644 --- a/org.glite.lb.common/src/events.c.T +++ b/org.glite.lb.common/src/events.c.T @@ -257,6 +257,7 @@ edg_wll_Event *event; /* allocate memory for 'event' (edg_wll_Event); use calloc to also clean it */ /* FIXME: what if calloc fails? should be checked somehow -> nomem etc. */ event = (edg_wll_Event *) calloc(1,sizeof(edg_wll_Event)); + event->type = eventcode; /* initialize common fields */ @@@{ $indent = "\t"; diff --git a/org.glite.lb.common/src/events_parse.c.T b/org.glite.lb.common/src/events_parse.c.T index 71e3e99..36f2d83 100644 --- a/org.glite.lb.common/src/events_parse.c.T +++ b/org.glite.lb.common/src/events_parse.c.T @@ -92,7 +92,6 @@ if ( eventcode == EDG_WLL_EVENT_UNDEF ) { /* allocate memory for 'this' (edg_wll_Event) */ // XXX: this = (edg_wll_Event *) calloc(1,sizeof(edg_wll_Event)); this = edg_wll_InitEvent(eventcode); -this->any.type = eventcode; /* go through all fields and fill in the edg_wll_Event union * in each step check for key duplicity and key name misuse @@ -578,7 +577,6 @@ if ( edg_wll_ULMProcessParseTable(table) != 0 ) { /* allocate memory for 'this' (edg_wll_Event) */ this = edg_wll_InitEvent(eventcode); -this->any.type = eventcode; /* go through all fields and fill in the edg_wll_Event union * in each step check for key duplicity and key name misuse diff --git a/org.glite.lb.common/test/parse.cpp.T b/org.glite.lb.common/test/parse.cpp.T index ad37a40..face531 100644 --- a/org.glite.lb.common/test/parse.cpp.T +++ b/org.glite.lb.common/test/parse.cpp.T @@ -46,7 +46,6 @@ void EventParseTest::regJob() edg_wll_InitContext(&ctx); e1 = edg_wll_InitEvent(EDG_WLL_EVENT_REGJOB); - e1->any.type = EDG_WLL_EVENT_REGJOB; e1->regJob.jdl = strdup("very long job = \"blabla\" \\\\ \n hugh\t;"); e1->regJob.ns = strdup("ns address"); @@ -97,7 +96,6 @@ void EventParseTest::$l(){ edg_wll_InitContext(&ctx); e1 = edg_wll_InitEvent(EDG_WLL_EVENT_$u); - e1->any.type = EDG_WLL_EVENT_$u; "; selectType $event '_common_'; -- 1.8.2.3