eolian: do not check alias/struct/enum base for builtin types
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Tue, 12 May 2015 16:23:42 +0000 (17:23 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Tue, 12 May 2015 16:24:17 +0000 (17:24 +0100)
src/lib/eolian/database_type_api.c

index 28ed9e59cfc12dc0f36e520c6bb96015a6158139..5c301f2c29ffe2cf2ee8b5a776905d482d7a8f0a 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <Eina.h>
 #include "eolian_database.h"
+#include "eo_lexer.h"
 
 EAPI const Eolian_Type *
 eolian_type_alias_get_by_name(const char *name)
@@ -233,15 +234,20 @@ eolian_type_base_type_get(const Eolian_Type *tp)
      {
         /* for regular types, try looking up if it belongs to a struct,
          * enum or an alias... otherwise return NULL
+         * but first check for builtins
          */
-       Eolian_Type *rtp;
-       rtp = eina_hash_find(_aliases, tp->full_name);
-       if (rtp) return rtp;
-       rtp = eina_hash_find(_structs, tp->full_name);
-       if (rtp) return rtp;
-       rtp = eina_hash_find(_enums, tp->full_name);
-       if (rtp) return rtp;
-       return NULL;
+        int  kw = eo_lexer_keyword_str_to_id(tp->full_name);
+        if (!kw || kw < KW_byte || kw > KW_list)
+          {
+             Eolian_Type *rtp;
+             rtp = eina_hash_find(_aliases, tp->full_name);
+             if (rtp) return rtp;
+             rtp = eina_hash_find(_structs, tp->full_name);
+             if (rtp) return rtp;
+             rtp = eina_hash_find(_enums, tp->full_name);
+             if (rtp) return rtp;
+          }
+        return NULL;
      }
    return tp->base_type;
 }