Lines Matching refs:length
42 getWeightTrail(uint32_t weight, int32_t length) { in getWeightTrail() argument
43 return (uint32_t)(weight>>(8*(4-length)))&0xff; in getWeightTrail()
47 setWeightTrail(uint32_t weight, int32_t length, uint32_t trail) { in setWeightTrail() argument
48 length=8*(4-length); in setWeightTrail()
49 return (uint32_t)((weight&(0xffffff00<<length))|(trail<<length)); in setWeightTrail()
82 truncateWeight(uint32_t weight, int32_t length) { in truncateWeight() argument
83 return (uint32_t)(weight&(0xffffffff<<(8*(4-length)))); in truncateWeight()
87 incWeightTrail(uint32_t weight, int32_t length) { in incWeightTrail() argument
88 return (uint32_t)(weight+(1UL<<(8*(4-length)))); in incWeightTrail()
92 decWeightTrail(uint32_t weight, int32_t length) { in decWeightTrail() argument
93 return (uint32_t)(weight-(1UL<<(8*(4-length)))); in decWeightTrail()
152 CollationWeights::incWeight(uint32_t weight, int32_t length) const { in incWeight()
154 uint32_t byte=getWeightByte(weight, length); in incWeight()
155 if(byte<maxBytes[length]) { in incWeight()
156 return setWeightByte(weight, length, byte+1); in incWeight()
159 weight=setWeightByte(weight, length, minBytes[length]); in incWeight()
160 --length; in incWeight()
161 U_ASSERT(length > 0); in incWeight()
167 CollationWeights::incWeightByOffset(uint32_t weight, int32_t length, int32_t offset) const { in incWeightByOffset() argument
169 offset += getWeightByte(weight, length); in incWeightByOffset()
170 if((uint32_t)offset <= maxBytes[length]) { in incWeightByOffset()
171 return setWeightByte(weight, length, offset); in incWeightByOffset()
174 offset -= minBytes[length]; in incWeightByOffset()
175 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length)); in incWeightByOffset()
176 offset /= countBytes(length); in incWeightByOffset()
177 --length; in incWeightByOffset()
178 U_ASSERT(length > 0); in incWeightByOffset()
185 int32_t length=range.length+1; in lengthenRange() local
186 range.start=setWeightTrail(range.start, length, minBytes[length]); in lengthenRange()
187 range.end=setWeightTrail(range.end, length, maxBytes[length]); in lengthenRange()
188 range.count*=countBytes(length); in lengthenRange()
189 range.length=length; in lengthenRange()
262 for(int32_t length=lowerLength; length>middleLength; --length) { in getWeightRanges() local
263 uint32_t trail=getWeightTrail(weight, length); in getWeightRanges()
264 if(trail<maxBytes[length]) { in getWeightRanges()
265 lower[length].start=incWeightTrail(weight, length); in getWeightRanges()
266 lower[length].end=setWeightTrail(weight, length, maxBytes[length]); in getWeightRanges()
267 lower[length].length=length; in getWeightRanges()
268 lower[length].count=maxBytes[length]-trail; in getWeightRanges()
270 weight=truncateWeight(weight, length-1); in getWeightRanges()
281 for(int32_t length=upperLength; length>middleLength; --length) { in getWeightRanges() local
282 uint32_t trail=getWeightTrail(weight, length); in getWeightRanges()
283 if(trail>minBytes[length]) { in getWeightRanges()
284 upper[length].start=setWeightTrail(weight, length, minBytes[length]); in getWeightRanges()
285 upper[length].end=decWeightTrail(weight, length); in getWeightRanges()
286 upper[length].length=length; in getWeightRanges()
287 upper[length].count=trail-minBytes[length]; in getWeightRanges()
289 weight=truncateWeight(weight, length-1); in getWeightRanges()
294 middle.length=middleLength; in getWeightRanges()
299 for(int32_t length=4; length>middleLength; --length) { in getWeightRanges() local
300 if(lower[length].count>0 && upper[length].count>0) { in getWeightRanges()
306 const uint32_t lowerEnd=lower[length].end; in getWeightRanges()
307 const uint32_t upperStart=upper[length].start; in getWeightRanges()
318 U_ASSERT(truncateWeight(lowerEnd, length-1)== in getWeightRanges()
319 truncateWeight(upperStart, length-1)); in getWeightRanges()
321 lower[length].end=upper[length].end; in getWeightRanges()
322 lower[length].count= in getWeightRanges()
323 (int32_t)getWeightTrail(lower[length].end, length)- in getWeightRanges()
324 (int32_t)getWeightTrail(lower[length].start, length)+1; in getWeightRanges()
330 U_ASSERT(minBytes[length]<maxBytes[length]); in getWeightRanges()
332 if(incWeight(lowerEnd, length)==upperStart) { in getWeightRanges()
334 lower[length].end=upper[length].end; in getWeightRanges()
335 lower[length].count+=upper[length].count; // might be >countBytes in getWeightRanges()
342 upper[length].count=0; in getWeightRanges()
343 while(--length>middleLength) { in getWeightRanges()
344 lower[length].count=upper[length].count=0; in getWeightRanges()
354 for(int32_t length=4; length>=2; --length) { in getWeightRanges() local
355 if(lower[length].count>0) { in getWeightRanges()
356 …d] .start=0x%08lx .end=0x%08lx .count=%ld\n", length, lower[length].start, lower[length].end, lowe… in getWeightRanges()
362 for(int32_t length=2; length<=4; ++length) { in getWeightRanges() local
363 if(upper[length].count>0) { in getWeightRanges()
364 …d] .start=0x%08lx .end=0x%08lx .count=%ld\n", length, upper[length].start, upper[length].end, uppe… in getWeightRanges()
375 for(int32_t length=middleLength+1; length<=4; ++length) { in getWeightRanges() local
377 if(upper[length].count>0) { in getWeightRanges()
378 uprv_memcpy(ranges+rangeCount, upper+length, sizeof(WeightRange)); in getWeightRanges()
381 if(lower[length].count>0) { in getWeightRanges()
382 uprv_memcpy(ranges+rangeCount, lower+length, sizeof(WeightRange)); in getWeightRanges()
392 for(int32_t i = 0; i < rangeCount && ranges[i].length <= (minLength + 1); ++i) { in allocWeightsInShortRanges()
395 if(ranges[i].length > minLength) { in allocWeightsInShortRanges()
428 ranges[minLengthRangeCount].length == minLength; in allocWeightsInMinLengthRanges()
481 ranges[1].length = minLength; // +1 when lengthened in allocWeightsInMinLengthRanges()
510 int32_t minLength=ranges[0].length; in allocWeights()
528 for(int32_t i=0; ranges[i].length==minLength; ++i) { in allocWeights()
537 i, ranges[i].start, ranges[i].end, ranges[i].length, ranges[i].count); in allocWeights()
558 range.start = incWeight(weight, range.length); in nextWeight()