/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
#define pset_new_ptr(slots) new_pset(pset_default_ptr_cmp, slots)
#define pset_new_ptr_default() pset_new_ptr(64)
-/** The entry of a pset, representing an element pointer in the set and it's meta-information */
+/** The entry of a pset, representing an element pointer in the set and its meta-information */
typedef struct {
unsigned hash;
void *dptr;
* @returns
* created pset
*/
-FIRM_API pset *new_pset(pset_cmp_fun func, int slots);
+FIRM_API pset *new_pset(pset_cmp_fun func, size_t slots);
/**
* Deletes a pset.
* @param pset the pset
*
* @note
- * This does NOT delete the elements of this pset, just it's pointers!
+ * This does NOT delete the elements of this pset, just its pointers!
*/
FIRM_API void del_pset(pset *pset);
*
* @param pset the pset
*/
-FIRM_API int pset_count(pset *pset);
+FIRM_API size_t pset_count(pset *pset);
/**
* Searches an element pointer in a pset.
* @param pset the pset
* @param entry the iterator
*/
-#define foreach_pset(pset, entry) for (entry = pset_first(pset); entry; entry = pset_next(pset))
+#define foreach_pset(pset, type, entry) for (entry = (type)pset_first(pset); entry; entry = (type)pset_next(pset))
/**
* Inserts all elements of the pointer set src into
*/
FIRM_API void pset_insert_pset_ptr(pset *target, pset *src);
-#define new_pset(cmp, slots) (PSET_TRACE (new_pset) ((cmp), (slots)))
+#define new_pset(cmp, slots) ((new_pset) ((cmp), (slots)))
#define pset_find(pset, key, hash) \
_pset_search ((pset), (key), (hash), _pset_find)
#define pset_insert(pset, key, hash) \
FIRM_API void *_pset_search(pset *, const void *, unsigned, _pset_action);
-#if defined(DEBUG) && defined(HAVE_GNU_MALLOC)
-extern const char *pset_tag;
-# ifdef PSET_ID
-# define PSET_TRACE pset_tag = SET_ID,
-# else
-# define PSET_TRACE pset_tag = __FILE__,
-# endif
-#else /* !(DEBUG && HAVE_GNU_MALLOC) */
-# define PSET_TRACE
-#endif /* !(DEBUG && HAVE_GNU_MALLOC) */
-
#include "../end.h"
#endif