Correct InitEvent, initialize also the event type
authorJan Pospíšil <honik@ntc.zcu.cz>
Fri, 29 Oct 2004 06:55:30 +0000 (06:55 +0000)
committerJan Pospíšil <honik@ntc.zcu.cz>
Fri, 29 Oct 2004 06:55:30 +0000 (06:55 +0000)
org.glite.lb.common/src/events.c.T
org.glite.lb.common/src/events_parse.c.T
org.glite.lb.common/test/parse.cpp.T

index 24a8c69..3d0861a 100644 (file)
@@ -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";
index 71e3e99..36f2d83 100644 (file)
@@ -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 
index ad37a40..face531 100644 (file)
@@ -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_';