src/stdlib/SDL_qsort.c
changeset 10116 418691d83f6a
parent 10085 a8e53dc3c5a1
child 10599 ade40eb390dc
     1.1 --- a/src/stdlib/SDL_qsort.c	Fri Mar 11 22:10:35 2016 +0100
     1.2 +++ b/src/stdlib/SDL_qsort.c	Fri Mar 11 08:30:18 2016 -0800
     1.3 @@ -427,7 +427,7 @@
     1.4        Recurse(trunc)
     1.5      }
     1.6    }
     1.7 -  PreInsertion(SWAP_nonaligned,TRUNC_nonaligned-1,size);
     1.8 +  PreInsertion(SWAP_nonaligned,TRUNC_nonaligned,size);
     1.9    Insertion(SWAP_nonaligned);
    1.10    free(pivot);
    1.11  }
    1.12 @@ -458,7 +458,7 @@
    1.13        Recurse(trunc)
    1.14      }
    1.15    }
    1.16 -  PreInsertion(SWAP_aligned,TRUNC_aligned-1,size);
    1.17 +  PreInsertion(SWAP_aligned,TRUNC_aligned,size);
    1.18    Insertion(SWAP_aligned);
    1.19    free(pivot);
    1.20  }
    1.21 @@ -499,7 +499,7 @@
    1.22        Recurse(TRUNC_words)
    1.23      }
    1.24    }
    1.25 -  PreInsertion(SWAP_words,(TRUNC_words/WORD_BYTES)-1,WORD_BYTES);
    1.26 +  PreInsertion(SWAP_words,(TRUNC_words/WORD_BYTES),WORD_BYTES);
    1.27    /* Now do insertion sort. */
    1.28    last=((char*)base)+nmemb*WORD_BYTES;
    1.29    for (first=((char*)base)+WORD_BYTES;first!=last;first+=WORD_BYTES) {