From 6bc7a94c736e9ab73ad4a75e714b11b6527e4757 Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 16 Nov 2016 16:50:33 +0100 Subject: [PATCH] Fix some code in sort_r.h to make cppcheck happy --- include/sort_r.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/sort_r.h b/include/sort_r.h index a80f556b3..638401ccf 100644 --- a/include/sort_r.h +++ b/include/sort_r.h @@ -49,9 +49,9 @@ static _SORT_R_INLINE int sort_r_cmpswap(char *__restrict a, char *__restrict b, void *_arg), void *arg) { - char tmp, *end = a+w; + char *end = a+w; if(compar(a, b, arg) > 0) { - for(; a < end; a++, b++) { tmp = *a; *a = *b; *b = tmp; } + for(; a < end; a++, b++) { char tmp = *a; *a = *b; *b = tmp; } return 1; } return 0; @@ -77,7 +77,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, /* nel > 6; Quicksort */ /* Use median of first, middle and last items as pivot */ - char *x, *y, *xend, ch; + char *x, *y, *xend; char *pl, *pr; char *last = b+w*(nel-1), *tmp; char *l[3]; @@ -93,7 +93,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, /* swap l[id], l[2] to put pivot as last element */ for(x = l[1], y = last, xend = x+w; x