fix
[libfirm] / ir / ana2 / lset.c
index 8ed89a2..12569b0 100644 (file)
@@ -1,20 +1,33 @@
 /* -*- c -*- */
 
 /*
- * Project:     libFIRM
- * File name:   ir/ana2/lset.c
- * Purpose:     Lists, err, Sets
- * Author:      Florian
- * Modified by:
- * Created:     Mon 18 Oct 2004
- * CVS-ID:      $Id$
- * Copyright:   (c) 1999-2004 Universität Karlsruhe
- * Licence:     This file is protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
  */
 
-
+/**
+ * @file
+ * @brief    Lists, err, Sets
+ * @author   Florian
+ * @date     Mon 18 Oct 2004
+ * @version  $Id$
+ */
 # ifdef HAVE_CONFIG_H
-#  include <config.h>
+#  include "config.h"
 # endif
 
 # include "lset.h"
 # endif /* not defined TRUE */
 
 # include <assert.h>
+
+#ifdef HAVE_STRING_H
 # include <string.h>             /* need memset */
+#endif
 
 /*
   Lists, err, Sets
@@ -36,6 +52,7 @@
 lset_t *lset_create (void)
 {
   lset_t *lset = xmalloc (sizeof (lset_t));
+  memset (lset, 0x00, sizeof (lset_t));
 
   return (lset);
 }
@@ -69,6 +86,7 @@ void lset_insert (lset_t *lset, void *data)
 {
   if (! lset_contains (lset, data)) {
     lset_entry_t *entry = xmalloc (sizeof (lset_entry_t));
+
     entry->data = data;
     entry->next = lset->first;
     lset->first = entry;
@@ -191,6 +209,15 @@ void lset_destroy (lset_t *lset)
 \f
 /*
   $Log$
+  Revision 1.4  2005/01/14 13:36:10  liekweg
+  fix malloc, fix "initialisation"
+
+  Revision 1.3  2004/12/22 14:43:14  beck
+  made allocations C-like
+
+  Revision 1.2  2004/12/02 16:17:51  beck
+  fixed config.h include
+
   Revision 1.1  2004/10/21 11:09:37  liekweg
   Moved memwalk stuf into irmemwalk
   Moved lset stuff into lset