X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fident%2Fident.c;h=bb2e4ea427823d18b492fefc047955a7f38a38b8;hb=bf9be89cbbf5d6ca1b80fd5736b80f47c1a14e90;hp=3a4e38dd20f933d41018822ba3394518f7d92fae;hpb=c8aeb8f4758d38f1663292e77cc9c55be87439fa;p=libfirm diff --git a/ir/ident/ident.c b/ir/ident/ident.c index 3a4e38dd2..bb2e4ea42 100644 --- a/ir/ident/ident.c +++ b/ir/ident/ident.c @@ -23,9 +23,7 @@ * @author Goetz Lindenmaier * @version $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include #include @@ -62,8 +60,6 @@ static ident *set_new_id_from_chars(void *handle, const char *str, int len) { set *id_set = handle; - /* GL: Who added this assert? And why? */ - //assert(len > 0); return (ident *)set_hinsert0(id_set, str, len, ID_HASH(unsigned char, str, len)); } @@ -78,7 +74,7 @@ static ident *set_new_id_from_chars(void *handle, const char *str, int len) static ident *set_new_id_from_str(void *handle, const char *str) { assert(str); - return (ident *)set_new_id_from_chars(handle, str, strlen(str)); + return set_new_id_from_chars(handle, str, strlen(str)); } /** @@ -116,7 +112,8 @@ static int set_get_id_strlen(void *handle, ident *id) /** * Default implementation using libfirm sets. */ -void set_finish_ident(void *handle) { +void set_finish_ident(void *handle) +{ set *id_set = handle; del_set(id_set); @@ -162,13 +159,12 @@ void init_ident(ident_if_t *id_if, int initial_n_idents) ident *new_id_from_str(const char *str) { - assert(str); + assert(str != NULL); return impl.new_id_from_str(impl.handle, str); } ident *new_id_from_chars(const char *str, int len) { - assert(len > 0); return impl.new_id_from_chars(impl.handle, str, len); } @@ -182,7 +178,8 @@ int get_id_strlen(ident *id) return impl.get_id_strlen(impl.handle, id); } -void finish_ident(void) { +void finish_ident(void) +{ if (impl.finish_ident) impl.finish_ident(impl.handle); }