From 08a30c6aada61d07f01566413729940c96323cb0 Mon Sep 17 00:00:00 2001 From: PBerger Date: Sat, 21 Sep 2013 01:51:25 +0200 Subject: [PATCH] Patched types for the strange version of qsort included in CUDD Former-commit-id: e9d69d3514af0059965e6d83534b2556e1a0775e --- resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c | 10 +++++----- resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c b/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c index ce8f0ab96..c3d23efd3 100644 --- a/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.c +++ b/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). */ -static void -qst(char *base, char *max) +void +qst(void *base, char *max) { register char c, *i, *j, *jj; register int ii; @@ -123,9 +123,9 @@ qst(char *base, char *max) */ lo = max - base; /* number of elements as chars */ do { - mid = i = base + qsz * ((lo / qsz) >> 1); + mid = i = ((char*)base) + qsz * ((lo / qsz) >> 1); 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) { /* switch to first loser */ j = (j == jj ? i : jj); @@ -144,7 +144,7 @@ qst(char *base, char *max) /* * 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) i += qsz; while (j > mid) { diff --git a/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h b/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h index 7890efc78..1f6d012c8 100644 --- a/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h +++ b/resources/3rdparty/cudd-2.5.0/src/nanotrav/ucbqsort.h @@ -13,6 +13,8 @@ extern "C" { #endif +#include + typedef int (*QSFP)(const void *, const void *); 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 mthresh; /* MTHRESHold in chars */ -static void qst (void *base, char *max); +void qst (void *base, char *max); #ifdef __cplusplus }