Lines Matching refs:weight

37 /* collation element weight allocation -------------------------------------- */
42 getWeightTrail(uint32_t weight, int32_t length) {
43 return (uint32_t)(weight>>(8*(4-length)))&0xff;
47 setWeightTrail(uint32_t weight, int32_t length, uint32_t trail) {
49 return (uint32_t)((weight&(0xffffff00<<length))|(trail<<length));
53 getWeightByte(uint32_t weight, int32_t idx) {
54 return getWeightTrail(weight, idx); /* same calculation */
58 setWeightByte(uint32_t weight, int32_t idx, uint32_t byte) {
78 return (uint32_t)((weight&mask)|(byte<<idx));
82 truncateWeight(uint32_t weight, int32_t length) {
83 return (uint32_t)(weight&(0xffffffff<<(8*(4-length))));
87 incWeightTrail(uint32_t weight, int32_t length) {
88 return (uint32_t)(weight+(1UL<<(8*(4-length))));
92 decWeightTrail(uint32_t weight, int32_t length) {
93 return (uint32_t)(weight-(1UL<<(8*(4-length))));
152 CollationWeights::incWeight(uint32_t weight, int32_t length) const {
154 uint32_t byte=getWeightByte(weight, length);
156 return setWeightByte(weight, length, byte+1);
159 weight=setWeightByte(weight, length, minBytes[length]);
167 CollationWeights::incWeightByOffset(uint32_t weight, int32_t length, int32_t offset) const {
169 offset += getWeightByte(weight, length);
171 return setWeightByte(weight, length, offset);
175 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length));
192 /* for uprv_sortArray: sort ranges in weight order */
261 uint32_t weight=lowerLimit;
263 uint32_t trail=getWeightTrail(weight, length);
265 lower[length].start=incWeightTrail(weight, length);
266 lower[length].end=setWeightTrail(weight, length, maxBytes[length]);
270 weight=truncateWeight(weight, length-1);
272 if(weight<0xff000000) {
273 middle.start=incWeightTrail(weight, middleLength);
280 weight=upperLimit;
282 uint32_t trail=getWeightTrail(weight, length);
284 upper[length].start=setWeightTrail(weight, length, minBytes[length]);
285 upper[length].end=decWeightTrail(weight, length);
289 weight=truncateWeight(weight, length-1);
291 middle.end=decWeightTrail(weight, middleLength);
382 /* sort the ranges by weight values */
525 /* get the next weight */
527 uint32_t weight = range.start;
532 /* increment the weight for the next value */
533 range.start = incWeight(weight, range.length);
537 return weight;