~pac72/ubuntu/lucid/ddd/devel

« back to all changes in this revision

Viewing changes to libiberty/partition.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2004-07-22 03:49:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040722034937-cysl08t1jvba4jrx
Tags: 1:3.3.9-3
USERINFO has been renamed to USERINFO.txt; adjust debian/rules code
to match, to get correct information on the About DDD dialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* List implentation of a partition of consecutive integers.
2
 
   Copyright (C) 2000 Free Software Foundation, Inc.
 
1
/* List implementation of a partition of consecutive integers.
 
2
   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
3
3
   Contributed by CodeSourcery, LLC.
4
4
 
5
5
   This file is part of GNU CC.
27
27
#include <stdlib.h>
28
28
#endif
29
29
 
 
30
#ifdef HAVE_STRING_H
 
31
#include <string.h>
 
32
#endif
 
33
 
30
34
#include "libiberty.h"
31
35
#include "partition.h"
32
36
 
 
37
static int elem_compare PARAMS ((const void *, const void *));
 
38
 
33
39
/* Creates a partition of NUM_ELEMENTS elements.  Initially each
34
40
   element is in a class by itself.  */
35
41
 
124
130
     const void *elem1;
125
131
     const void *elem2;
126
132
{
127
 
  int e1 = * (int *) elem1;
128
 
  int e2 = * (int *) elem2;
 
133
  int e1 = * (const int *) elem1;
 
134
  int e2 = * (const int *) elem2;
129
135
  if (e1 < e2)
130
136
    return -1;
131
137
  else if (e1 > e2)
171
177
          c = elements[c].next - elements;
172
178
        }
173
179
        /* Sort them.  */
174
 
        qsort ((void *) class_elements, count, sizeof (int), &elem_compare);
 
180
        qsort ((void *) class_elements, count, sizeof (int), elem_compare);
175
181
        /* Print them.  */
176
182
        fputc ('(', fp);
177
183
        for (i = 0; i < count; ++i)