X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fqsort.c;h=c37760f546fa47a089b913cff22d47e084f7d13f;hb=393020b6e48719d27699dea6b29e53025bbd5123;hp=084cd3ca4cf07675cca839812a5e4526283550da;hpb=f8dfae46eb161173a4460a98075669e810c8bb7b;p=pdclib diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c index 084cd3c..c37760f 100644 --- a/functions/stdlib/qsort.c +++ b/functions/stdlib/qsort.c @@ -41,14 +41,14 @@ void qsort( void * base, size_t nmemb, size_t size, int (*compar)( const void *, { char * i; char * j; - size_t thresh = T * size; - char * base_ = (char *)base; - char * limit = base_ + nmemb * size; + _PDCLIB_size_t thresh = T * size; + char * base_ = (char *)base; + char * limit = base_ + nmemb * size; PREPARE_STACK; for ( ;; ) { - if ( limit - base_ > thresh ) /* QSort for more than T elements. */ + if ( (size_t)( limit - base_ ) > thresh ) /* QSort for more than T elements. */ { /* We work from second to last - first will be pivot element. */ i = base_ + size;