/* -*- c -*- */
/*
- * Time-stamp: <05.12.2004 21:39:34h liekweg>
+ * Time-stamp: <17.12.2004 20:26:51h liekweg>
* Project: libFIRM
* File name: ir/ana2/qset.c
* Purpose: yet another set implementation
* Copyright: (c) 1999-2004 Universität Karlsruhe
* Licence: This file is protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
# include <string.h>
-# include <sys/time.h>
-# include <obstack.h>
+# include "obst.h"
# include "timing.h"
# include "qset.h"
static void q_sort (sortable_t*, const int);
/* Compare funktion, meant to be qsort(3)-compatible */
-static __inline__ int sortable_compare (const void *pa, const void *pb)
+static INLINE int sortable_compare (const void *pa, const void *pb)
{
const int a = * (unsigned int*) pa;
const int b = * (unsigned int*) pb;
}
/*
- Test wether the given qset contains the given value.
+ Test whether the given qset contains the given value.
*/
int qset_contains (qset_t *qset, sortable_t val)
{
qset_resize (qset, qset->n_elems+1);
+ /* qset_print (qset, stdout); */
+ /* fprintf (stdout, "%s: must insert 0x%08x\n", __FUNCTION__, (void*) val); */
+
qset->values [qset->n_elems++] = val;
qset->is_sorted = FALSE;
*/
sortable_t *qset_start (qset_t *qset)
{
+ sortable_t *start;
+
qset->cursor = 0;
- sortable_t *start = qset_next (qset);
+ start = qset_next (qset);
return (start); /* works for empty sets, too */
}
/*
$Log$
+ Revision 1.11 2005/06/22 09:34:11 beck
+ typo fixed
+
+ Revision 1.10 2004/12/21 15:37:31 beck
+ added config.h include
+ removed unused sys/times.h
+ removed C99 constructs
+
+ Revision 1.9 2004/12/20 17:34:35 liekweg
+ fix recursion handling
+
Revision 1.8 2004/12/06 12:49:26 liekweg
virtually no change