- fixed warnings
[libfirm] / ir / adt / pset_new.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   implementation of pset_new
23  * @author  Matthias Braun
24  * @version $Id$
25  */
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #include "pset_new.h"
31
32 /** probing method: quadratic probing */
33 #define DO_REHASH
34 #define HashSet                    pset_new_t
35 #define HashSetIterator            pset_new_iterator_t
36 #define ValueType                  void*
37 #define NullValue                  NULL
38 #define DeletedValue               ((void*)-1)
39 #define KeysEqual(this,key1,key2)  1
40 #define SetRangeEmpty(ptr,size)    memset(ptr, 0, (size) * sizeof(HashSetEntry))
41
42 #define hashset_init            pset_new_init
43 #define hashset_init_size       pset_new_init_size
44 #define hashset_destroy         pset_new_destroy
45 #define hashset_insert          pset_new_insert
46 #define hashset_remove          pset_new_remove
47 #define hashset_find            pset_new_find
48 #define hashset_size            pset_new_size
49 #define hashset_iterator_init   pset_new_iterator_init
50 #define hashset_iterator_next   pset_new_iterator_next
51 #define hashset_remove_iterator pset_new_remove_iterator
52
53 #include "hashset.c"
54
55 int pset_new_contains(const pset_new_t *pset_new, const ValueType val)
56 {
57         return pset_new_find(pset_new, val);
58 }