]> pd.if.org Git - pdclib.old/blobdiff - functions/stdlib/qsort.c
Merged branch stdio_rewrite back into trunk.
[pdclib.old] / functions / stdlib / qsort.c
index 6bb636f5631d5c50a51f9052c9b947f61507fb49..c37760f546fa47a089b913cff22d47e084f7d13f 100644 (file)
@@ -41,14 +41,14 @@ void qsort( void * base, size_t nmemb, size_t size, int (*compar)( const void *,
 {
     char * i;
     char * j;
-    _PDCLIB_ptrdiff_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;