Fix typos in comments: s/it's/its/ and related corrections.
[libfirm] / include / libfirm / adt / pset.h
index debe986..851daa4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
  *
@@ -64,7 +64,7 @@ typedef struct pset pset;
 #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;
@@ -91,7 +91,7 @@ typedef int (*pset_cmp_fun) (const void *elt, const void *key);
  * @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.
@@ -99,7 +99,7 @@ FIRM_API pset *new_pset(pset_cmp_fun func, int slots);
  * @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);
 
@@ -108,7 +108,7 @@ 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.
@@ -207,7 +207,7 @@ FIRM_API void pset_break(pset *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
@@ -218,7 +218,7 @@ FIRM_API void pset_break(pset *pset);
  */
 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) \
@@ -260,17 +260,6 @@ typedef enum { _pset_find, _pset_insert, _pset_hinsert } _pset_action;
 
 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