fix intrinsics appearing in output
[libfirm] / ir / ident / ident.c
index 3a4e38d..bb2e4ea 100644 (file)
@@ -23,9 +23,7 @@
  * @author    Goetz Lindenmaier
  * @version   $Id$
  */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <assert.h>
 #include <ctype.h>
@@ -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);
 }