2002-01-21 H.J. Lu <hjl@gnu.org>
[deliverable/binutils-gdb.git] / libiberty / partition.c
index 52fb128d7bfe9ea887fd9a91af1eaf7a1b5a48e6..07154722079049ee6979cabba9119997646c9d4c 100644 (file)
@@ -1,5 +1,5 @@
-/* List implentation of a partition of consecutive integers.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+/* List implementation of a partition of consecutive integers.
+   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC.
 
    This file is part of GNU CC.
@@ -34,6 +34,8 @@
 #include "libiberty.h"
 #include "partition.h"
 
+static int elem_compare PARAMS ((const void *, const void *));
+
 /* Creates a partition of NUM_ELEMENTS elements.  Initially each
    element is in a class by itself.  */
 
@@ -128,8 +130,8 @@ elem_compare (elem1, elem2)
      const void *elem1;
      const void *elem2;
 {
-  int e1 = * (int *) elem1;
-  int e2 = * (int *) elem2;
+  int e1 = * (const int *) elem1;
+  int e2 = * (const int *) elem2;
   if (e1 < e2)
     return -1;
   else if (e1 > e2)
@@ -175,7 +177,7 @@ partition_print (part, fp)
          c = elements[c].next - elements;
        }
        /* Sort them.  */
-       qsort ((void *) class_elements, count, sizeof (int), &elem_compare);
+       qsort ((void *) class_elements, count, sizeof (int), elem_compare);
        /* Print them.  */
        fputc ('(', fp);
        for (i = 0; i < count; ++i) 
This page took 0.024393 seconds and 4 git commands to generate.