X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstdlib%2Fqsort.c;h=e26ea863cfa9e9f702236538921281ea7c7ab688;hp=30e01331f085775bcb0cd8881695c6d5293ba4ad;hb=d865c4403fc91d1f1ac95ba76febcee9f429bb97;hpb=2040228f27d623585d339dec175c4e779ca9edb5 diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c index 30e0133..e26ea86 100644 --- a/functions/stdlib/qsort.c +++ b/functions/stdlib/qsort.c @@ -33,7 +33,7 @@ static inline void memswp( char * i, char * j, size_t size ) #define PUSH( base, limit ) stackptr[0] = base; stackptr[1] = limit; stackptr += 2 #define POP( base, limit ) stackptr -= 2; base = stackptr[0]; limit = stackptr[1] /* TODO: Stack usage is log2( nmemb ) (minus what T shaves off the worst case). - Worst-case nmemb is platform dependent and should probably be + Worst-case nmemb is platform dependent and should probably be configured through _PDCLIB_config.h. */ #define STACKSIZE 64 @@ -128,7 +128,9 @@ void qsort( void * base, size_t nmemb, size_t size, int (*compar)( const void *, #endif #ifdef TEST + #include "_PDCLIB_test.h" + #include #include