Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed signed/unsigned comparison warnings in Visual Studio
  • Loading branch information
slouken committed Nov 11, 2016
1 parent 801a9ea commit 79f6ba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stdlib/SDL_qsort.c
Expand Up @@ -275,7 +275,7 @@ typedef struct { char * first; char * last; } stack_entry;

/* and so is the pivoting logic (note: last is inclusive): */
#define Pivot(swapper,sz) \
if (last-first>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
if ((size_t)(last-first)>PIVOT_THRESHOLD*sz) mid=pivot_big(first,mid,last,sz,compare);\
else { \
if (compare(first,mid)<0) { \
if (compare(mid,last)>0) { \
Expand Down Expand Up @@ -413,7 +413,7 @@ static void qsort_nonaligned(void *base, size_t nmemb, size_t size,

first=(char*)base; last=first+(nmemb-1)*size;

if (last-first>=trunc) {
if ((size_t)(last-first)>=trunc) {
char *ffirst=first, *llast=last;
while (1) {
/* Select pivot */
Expand Down Expand Up @@ -444,7 +444,7 @@ static void qsort_aligned(void *base, size_t nmemb, size_t size,

first=(char*)base; last=first+(nmemb-1)*size;

if (last-first>=trunc) {
if ((size_t)(last-first)>=trunc) {
char *ffirst=first,*llast=last;
while (1) {
/* Select pivot */
Expand Down

0 comments on commit 79f6ba5

Please sign in to comment.