Browse Source

Patched types for the strange version of qsort included in CUDD

Former-commit-id: e9d69d3514
tempestpy_adaptions
PBerger 11 years ago
parent
commit
08a30c6aad
  1. 10
      resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c
  2. 4
      resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h

10
resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c

@ -104,8 +104,8 @@ cudd__qsort(
* (And there are only three places where this is done). * (And there are only three places where this is done).
*/ */
static void
qst(char *base, char *max)
void
qst(void *base, char *max)
{ {
register char c, *i, *j, *jj; register char c, *i, *j, *jj;
register int ii; register int ii;
@ -123,9 +123,9 @@ qst(char *base, char *max)
*/ */
lo = max - base; /* number of elements as chars */ lo = max - base; /* number of elements as chars */
do { do {
mid = i = base + qsz * ((lo / qsz) >> 1);
mid = i = ((char*)base) + qsz * ((lo / qsz) >> 1);
if (lo >= mthresh) { if (lo >= mthresh) {
j = ((*qcmp)((jj = base), i) > 0 ? jj : i);
j = ((*qcmp)((jj = ((char*)base)), i) > 0 ? jj : i);
if ((*qcmp)(j, (tmp = max - qsz)) > 0) { if ((*qcmp)(j, (tmp = max - qsz)) > 0) {
/* switch to first loser */ /* switch to first loser */
j = (j == jj ? i : jj); j = (j == jj ? i : jj);
@ -144,7 +144,7 @@ qst(char *base, char *max)
/* /*
* Semi-standard quicksort partitioning/swapping * Semi-standard quicksort partitioning/swapping
*/ */
for (i = base, j = max - qsz; ; ) {
for (i = ((char*)base), j = max - qsz; ; ) {
while (i < mid && (*qcmp)(i, mid) <= 0) while (i < mid && (*qcmp)(i, mid) <= 0)
i += qsz; i += qsz;
while (j > mid) { while (j > mid) {

4
resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h

@ -13,6 +13,8 @@
extern "C" { extern "C" {
#endif #endif
#include <stddef.h>
typedef int (*QSFP)(const void *, const void *); typedef int (*QSFP)(const void *, const void *);
void cudd__qsort (void* base, int n, int size, QSFP compar); void cudd__qsort (void* base, int n, int size, QSFP compar);
@ -24,7 +26,7 @@ static int qsz; /* size of each record */
static int thresh; /* THRESHold in chars */ static int thresh; /* THRESHold in chars */
static int mthresh; /* MTHRESHold in chars */ static int mthresh; /* MTHRESHold in chars */
static void qst (void *base, char *max);
void qst (void *base, char *max);
#ifdef __cplusplus #ifdef __cplusplus
} }
Loading…
Cancel
Save