summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-20 15:14:02 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-21 10:33:56 +0100
commitab30ff3f9bd8b82c5df9c97e0092d18221f0b7dc (patch)
treead3ebde3e842d129cce6b4e557a10011f2203cd5
parent13327b4fee9aeb352b4d22d368ce5bf370f51822 (diff)
eolian: enable event redef checking by default
Reviewed-by: Daniel Kolesa <daniel@octaforge.org> Differential Revision: https://phab.enlightenment.org/D8425
-rw-r--r--src/lib/eolian/database_validate.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index a6ae461079..a0aa0af45c 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -12,7 +12,6 @@ typedef struct _Validate_State
12{ 12{
13 Eina_Bool warned; 13 Eina_Bool warned;
14 Eina_Bool stable; 14 Eina_Bool stable;
15 Eina_Bool event_redef;
16 Eina_Bool unimplemented; 15 Eina_Bool unimplemented;
17} Validate_State; 16} Validate_State;
18 17
@@ -505,22 +504,18 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
505{ 504{
506 const Eolian_Object *oobj = NULL; 505 const Eolian_Object *oobj = NULL;
507 506
508 if (vals->event_redef) 507 oobj = eina_hash_find(nhash, &event->base.name);
508 if (EINA_UNLIKELY(!!oobj))
509 { 509 {
510 oobj = eina_hash_find(nhash, &event->base.name); 510 _eo_parser_log(&event->base,
511 if (EINA_UNLIKELY(!!oobj)) 511 "event '%s' conflicts with another event (at %s:%d:%d)",
512 { 512 event->base.name, oobj->file, oobj->line, oobj->column);
513 _eo_parser_log(&event->base, 513 vals->warned = EINA_TRUE;
514 "event '%s' conflicts with another event (at %s:%d:%d)",
515 event->base.name, oobj->file, oobj->line, oobj->column);
516 vals->warned = EINA_TRUE;
517 }
518 } 514 }
519 515
520 if (event->base.validated) 516 if (event->base.validated)
521 { 517 {
522 if (vals->event_redef && !oobj) 518 eina_hash_set(nhash, &event->base.name, &event->base);
523 eina_hash_add(nhash, &event->base.name, &event->base);
524 return EINA_TRUE; 519 return EINA_TRUE;
525 } 520 }
526 521
@@ -532,8 +527,7 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
532 if (!_validate_doc(event->doc)) 527 if (!_validate_doc(event->doc))
533 return _reset_stable(vals, was_stable, EINA_FALSE); 528 return _reset_stable(vals, was_stable, EINA_FALSE);
534 529
535 if (vals->event_redef && !oobj) 530 eina_hash_set(nhash, &event->base.name, &event->base);
536 eina_hash_add(nhash, &event->base.name, &event->base);
537 531
538 _reset_stable(vals, was_stable, EINA_TRUE); 532 _reset_stable(vals, was_stable, EINA_TRUE);
539 return _validate(&event->base); 533 return _validate(&event->base);
@@ -1353,7 +1347,6 @@ database_validate(const Eolian_Unit *src)
1353 Validate_State vals = { 1347 Validate_State vals = {
1354 EINA_FALSE, 1348 EINA_FALSE,
1355 EINA_TRUE, 1349 EINA_TRUE,
1356 !!getenv("EOLIAN_EVENT_REDEF_WARN"),
1357 !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"), 1350 !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"),
1358 }; 1351 };
1359 1352