ICU-96 include stdlib.h for qsort, do not sort just one range

X-SVN-Rev: 3980
This commit is contained in:
Markus Scherer 2001-03-08 23:38:35 +00:00
parent 746f7b4216
commit 4c2deb23a8

View File

@ -22,6 +22,9 @@
# include <stdio.h>
#endif
/* we are using qsort() */
#include <stdlib.h>
#include "unicode/utypes.h"
#include "cmemory.h"
#include "ucol_wgt.h"
@ -434,8 +437,10 @@ ucol_allocWeights(uint32_t lowerLimit, uint32_t upperLimit, uint32_t n, WeightRa
}
}
/* sort the ranges by weight values */
qsort(ranges, rangeCount, sizeof(WeightRange), compareRanges);
if(rangeCount>1) {
/* sort the ranges by weight values */
qsort(ranges, rangeCount, sizeof(WeightRange), compareRanges);
}
#ifdef UCOL_DEBUG
puts("final ranges:");