fix
[libfirm] / ir / ana2 / lset.c
index 0e762d7..12569b0 100644 (file)
@@ -1,18 +1,31 @@
 /* -*- 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"
 # endif
@@ -38,7 +51,8 @@
 /* create a new lset */
 lset_t *lset_create (void)
 {
-  lset_t *lset = xmalloc(sizeof(*lset));
+  lset_t *lset = xmalloc (sizeof (lset_t));
+  memset (lset, 0x00, sizeof (lset_t));
 
   return (lset);
 }
@@ -71,7 +85,8 @@ int lset_empty (lset_t *lset)
 void lset_insert (lset_t *lset, void *data)
 {
   if (! lset_contains (lset, data)) {
-    lset_entry_t *entry = xmalloc(sizeof(*entry));
+    lset_entry_t *entry = xmalloc (sizeof (lset_entry_t));
+
     entry->data = data;
     entry->next = lset->first;
     lset->first = entry;
@@ -194,6 +209,9 @@ 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