File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,26 @@ static rv_hist_t rv_reg_stats[] = {
5151
5252static int cmp_dec (const void * a , const void * b )
5353{
54- return ((rv_hist_t * ) b )-> freq - ((rv_hist_t * ) a )-> freq ;
54+ const size_t a_freq = ((rv_hist_t * ) a )-> freq ;
55+ const size_t b_freq = ((rv_hist_t * ) b )-> freq ;
56+
57+ if (a_freq > b_freq )
58+ return -1 ;
59+ if (a_freq < b_freq )
60+ return 1 ;
61+ return 0 ;
5562}
5663
5764static int cmp_asc (const void * a , const void * b )
5865{
59- return ((rv_hist_t * ) a )-> freq - ((rv_hist_t * ) b )-> freq ;
66+ const size_t a_freq = ((rv_hist_t * ) a )-> freq ;
67+ const size_t b_freq = ((rv_hist_t * ) b )-> freq ;
68+
69+ if (a_freq < b_freq )
70+ return -1 ;
71+ if (a_freq > b_freq )
72+ return 1 ;
73+ return 0 ;
6074}
6175
6276/* used to adjust the length of histogram bar */
You can’t perform that action at this time.
0 commit comments