X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type_hash.c;h=29535ffcd0e719e834cad1a5948deb263580dc8a;hb=05dbb10d24382cce46842d47c7eab8471a8c8834;hp=312b8cf8b2af1ba2d6b39c63d653a524ad8a9046;hpb=87686a3e9a834c551c74c5391b4859aa8fca8482;p=cparser diff --git a/type_hash.c b/type_hash.c index 312b8cf..29535ff 100644 --- a/type_hash.c +++ b/type_hash.c @@ -97,6 +97,9 @@ unsigned hash_type(const type_t *type) case TYPE_POINTER: hash = hash_pointer_type((const pointer_type_t*) type); break; + case TYPE_BUILTIN: + hash = hash_ptr(((const builtin_type_t*) type)->symbol); + break; } unsigned some_prime = 99991; @@ -172,6 +175,13 @@ int enum_types_equal(const enum_type_t *type1, const enum_type_t *type2) return type1->symbol == type2->symbol; } +static +int builtin_types_equal(const builtin_type_t *type1, + const builtin_type_t *type2) +{ + return type1->symbol == type2->symbol; +} + static int types_equal(const type_t *type1, const type_t *type2) { @@ -201,6 +211,9 @@ int types_equal(const type_t *type1, const type_t *type2) case TYPE_POINTER: return pointer_types_equal((const pointer_type_t*) type1, (const pointer_type_t*) type2); + case TYPE_BUILTIN: + return builtin_types_equal((const builtin_type_t*) type1, + (const builtin_type_t*) type2); } abort();