Revert "eolian: strict validation for EFL (errors by default)"
authorCedric BAIL <cedric@osg.samsung.com>
Wed, 17 Feb 2016 22:34:20 +0000 (14:34 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 17 Feb 2016 22:37:42 +0000 (14:37 -0800)
This reverts commit 21a2a8007dc53e11842526191abab9f393b3d777.

Please run make check from time to time.

src/Makefile_Eolian_Helper.am
src/lib/eolian/database_validate.c

index 9159cf8..22b09d6 100644 (file)
@@ -15,21 +15,21 @@ SUFFIXES = .eo .eo.c .eo.h .eo.legacy.h .eot .eot.h
 %.eo.c: %.eo ${_EOLIAN_GEN_DEP}
        $(AM_V_EOL) \
        $(MKDIR_P) $(dir $@); \
-       EOLIAN_VALIDATE_STRICT=1 $(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gc -o $@ $<
+       $(EOLIAN_GEN) --legacy --silent-types $(EOLIAN_FLAGS) --gc -o $@ $<
 
 %.eo.h: %.eo ${_EOLIAN_GEN_DEP}
        $(AM_V_EOL) \
        $(MKDIR_P) $(dir $@); \
-       EOLIAN_VALIDATE_STRICT=1 $(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o $@ $<
+       EOLIAN_VERBOSE_TYPES=1 $(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o $@ $<
 
 %.eot.h: %.eot ${_EOLIAN_GEN_DEP}
        $(AM_V_EOL) \
        $(MKDIR_P) $(dir $@); \
-       EOLIAN_VALIDATE_STRICT=1 $(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o $@ $<
+       EOLIAN_VERBOSE_TYPES=1 $(EOLIAN_GEN) $(EOLIAN_FLAGS) --gh -o $@ $<
 
 %.eo.legacy.h: %.eo ${_EOLIAN_GEN_DEP}
        $(AM_V_EOL) \
        $(MKDIR_P) $(dir $@); \
-       EOLIAN_VALIDATE_STRICT=1 $(EOLIAN_GEN) --legacy $(EOLIAN_FLAGS) --gh -o $@ $<
+       $(EOLIAN_GEN) --legacy --silent-types $(EOLIAN_FLAGS) --gh -o $@ $<
 
 CLEANFILES += $(BUILT_SOURCES)
index 2a44a3d..381564d 100644 (file)
@@ -174,10 +174,9 @@ _ef_map_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED,
 static Eina_Bool
 _type_error(const Validator *vs, const Eolian_Type *tp, const char *msg)
 {
-   Eina_Bool weak = !getenv("EOLIAN_VALIDATE_STRICT");
    if (vs->silent_types)
-     return weak;
-   if (!weak)
+     return EINA_FALSE;
+   if (getenv("EOLIAN_VERBOSE_TYPES"))
      {
         fprintf(stderr, "eolian:%s:%d:%d: %s\n", tp->base.file, tp->base.line,
                 tp->base.column, msg);
@@ -185,7 +184,7 @@ _type_error(const Validator *vs, const Eolian_Type *tp, const char *msg)
      }
    eina_log_print(_eolian_log_dom, EINA_LOG_LEVEL_WARN, tp->base.file, "",
                   tp->base.line, "%s at column %d", msg, tp->base.column);
-   return EINA_TRUE;
+   return EINA_FALSE;
 }
 
 static Eina_Bool
@@ -213,7 +212,8 @@ _validate_type(const Validator *vs, const Eolian_Type *tp)
              {
                 char buf[256];
                 snprintf(buf, sizeof(buf), "undefined type %s", tp->full_name);
-                return _type_error(vs, tp, buf);
+                _type_error(vs, tp, buf);
+                return EINA_TRUE; /* for now only warn */
              }
            return _validate_type(vs, tpp);
         }
@@ -246,7 +246,7 @@ _validate_type(const Validator *vs, const Eolian_Type *tp)
                 char buf[256];
                 snprintf(buf, sizeof(buf), "undefined class %s "
                          "(likely wrong namespacing)", tp->full_name);
-                return _type_error(vs, tp, buf);
+                _type_error(vs, tp, buf);
              }
            return EINA_TRUE;
         }