From: Amos Jeffries Date: Mon, 31 Aug 2015 13:58:48 +0000 (-0700) Subject: Missing piece of rev.14275 X-Git-Tag: SQUID_4_0_1~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7614b42ba6d594c35492d2848e054476b892b8e;p=thirdparty%2Fsquid.git Missing piece of rev.14275 --- diff --git a/src/ProfStats.cc b/src/ProfStats.cc index 1608034e80..9cafc969cb 100644 --- a/src/ProfStats.cc +++ b/src/ProfStats.cc @@ -62,12 +62,15 @@ xprof_move(xprof_stats_data * head, xprof_stats_data * hist) } static int -xprof_comp(xprof_stats_node ** ii, xprof_stats_node ** jj) +xprof_comp(const void *A, const void *B) { - if ((*ii)->hist.summ < (*jj)->hist.summ) + const xprof_stats_node *ii = *(static_cast(A)); + const xprof_stats_node *jj = *(static_cast(B)); + + if (ii->hist.summ < jj->hist.summ) return (1); - if ((*ii)->hist.summ > (*jj)->hist.summ) + if (ii->hist.summ > jj->hist.summ) return (-1); return (0); @@ -80,7 +83,7 @@ xprof_sorthist(TimersArray * xprof_list) sortlist[i] = xprof_list[i]; } - qsort(&sortlist[XPROF_PROF_UNACCOUNTED+1], XPROF_LAST - XPROF_PROF_UNACCOUNTED+1, sizeof(xprof_stats_node *), (QS *) xprof_comp); + qsort(&sortlist[XPROF_PROF_UNACCOUNTED+1], XPROF_LAST - XPROF_PROF_UNACCOUNTED+1, sizeof(xprof_stats_node *), xprof_comp); } static double time_frame;