• Home
  • Raw
  • Download

Lines Matching full:length

44 getWeightTrail(uint32_t weight, int32_t length) {  in getWeightTrail()  argument
45 return (uint32_t)(weight>>(8*(4-length)))&0xff; in getWeightTrail()
49 setWeightTrail(uint32_t weight, int32_t length, uint32_t trail) { in setWeightTrail() argument
50 length=8*(4-length); in setWeightTrail()
51 return (uint32_t)((weight&(0xffffff00<<length))|(trail<<length)); in setWeightTrail()
84 truncateWeight(uint32_t weight, int32_t length) { in truncateWeight() argument
85 return (uint32_t)(weight&(0xffffffff<<(8*(4-length)))); in truncateWeight()
89 incWeightTrail(uint32_t weight, int32_t length) { in incWeightTrail() argument
90 return (uint32_t)(weight+(1UL<<(8*(4-length)))); in incWeightTrail()
94 decWeightTrail(uint32_t weight, int32_t length) { in decWeightTrail() argument
95 return (uint32_t)(weight-(1UL<<(8*(4-length)))); in decWeightTrail()
154 CollationWeights::incWeight(uint32_t weight, int32_t length) const { in incWeight()
156 uint32_t byte=getWeightByte(weight, length); in incWeight()
157 if(byte<maxBytes[length]) { in incWeight()
158 return setWeightByte(weight, length, byte+1); in incWeight()
161 weight=setWeightByte(weight, length, minBytes[length]); in incWeight()
162 --length; in incWeight()
163 U_ASSERT(length > 0); in incWeight()
169 CollationWeights::incWeightByOffset(uint32_t weight, int32_t length, int32_t offset) const { in incWeightByOffset() argument
171 offset += getWeightByte(weight, length); in incWeightByOffset()
172 if((uint32_t)offset <= maxBytes[length]) { in incWeightByOffset()
173 return setWeightByte(weight, length, offset); in incWeightByOffset()
176 offset -= minBytes[length]; in incWeightByOffset()
177 weight = setWeightByte(weight, length, minBytes[length] + offset % countBytes(length)); in incWeightByOffset()
178 offset /= countBytes(length); in incWeightByOffset()
179 --length; in incWeightByOffset()
180 U_ASSERT(length > 0); in incWeightByOffset()
187 int32_t length=range.length+1; in lengthenRange() local
188 range.start=setWeightTrail(range.start, length, minBytes[length]); in lengthenRange()
189 range.end=setWeightTrail(range.end, length, maxBytes[length]); in lengthenRange()
190 range.count*=countBytes(length); in lengthenRange()
191 range.length=length; in lengthenRange()
220 printf("length of lower limit 0x%08lx is %ld\n", lowerLimit, lowerLength); in getWeightRanges()
221 printf("length of upper limit 0x%08lx is %ld\n", upperLimit, upperLength); in getWeightRanges()
251 * range minimum length in getWeightRanges()
264 for(int32_t length=lowerLength; length>middleLength; --length) { in getWeightRanges() local
265 uint32_t trail=getWeightTrail(weight, length); in getWeightRanges()
266 if(trail<maxBytes[length]) { in getWeightRanges()
267 lower[length].start=incWeightTrail(weight, length); in getWeightRanges()
268 lower[length].end=setWeightTrail(weight, length, maxBytes[length]); in getWeightRanges()
269 lower[length].length=length; in getWeightRanges()
270 lower[length].count=maxBytes[length]-trail; in getWeightRanges()
272 weight=truncateWeight(weight, length-1); in getWeightRanges()
283 for(int32_t length=upperLength; length>middleLength; --length) { in getWeightRanges() local
284 uint32_t trail=getWeightTrail(weight, length); in getWeightRanges()
285 if(trail>minBytes[length]) { in getWeightRanges()
286 upper[length].start=setWeightTrail(weight, length, minBytes[length]); in getWeightRanges()
287 upper[length].end=decWeightTrail(weight, length); in getWeightRanges()
288 upper[length].length=length; in getWeightRanges()
289 upper[length].count=trail-minBytes[length]; in getWeightRanges()
291 weight=truncateWeight(weight, length-1); in getWeightRanges()
296 middle.length=middleLength; in getWeightRanges()
301 for(int32_t length=4; length>middleLength; --length) { in getWeightRanges() local
302 if(lower[length].count>0 && upper[length].count>0) { in getWeightRanges()
308 const uint32_t lowerEnd=lower[length].end; in getWeightRanges()
309 const uint32_t upperStart=upper[length].start; in getWeightRanges()
320 U_ASSERT(truncateWeight(lowerEnd, length-1)== in getWeightRanges()
321 truncateWeight(upperStart, length-1)); in getWeightRanges()
323 lower[length].end=upper[length].end; in getWeightRanges()
324 lower[length].count= in getWeightRanges()
325 (int32_t)getWeightTrail(lower[length].end, length)- in getWeightRanges()
326 (int32_t)getWeightTrail(lower[length].start, length)+1; in getWeightRanges()
332 U_ASSERT(minBytes[length]<maxBytes[length]); in getWeightRanges()
334 if(incWeight(lowerEnd, length)==upperStart) { in getWeightRanges()
336 lower[length].end=upper[length].end; in getWeightRanges()
337 lower[length].count+=upper[length].count; // might be >countBytes in getWeightRanges()
344 upper[length].count=0; in getWeightRanges()
345 while(--length>middleLength) { in getWeightRanges()
346 lower[length].count=upper[length].count=0; in getWeightRanges()
356 for(int32_t length=4; length>=2; --length) { in getWeightRanges() local
357 if(lower[length].count>0) { in getWeightRanges()
358 …d] .start=0x%08lx .end=0x%08lx .count=%ld\n", length, lower[length].start, lower[length].end, lowe… in getWeightRanges()
364 for(int32_t length=2; length<=4; ++length) { in getWeightRanges() local
365 if(upper[length].count>0) { in getWeightRanges()
366 …d] .start=0x%08lx .end=0x%08lx .count=%ld\n", length, upper[length].start, upper[length].end, uppe… in getWeightRanges()
377 for(int32_t length=middleLength+1; length<=4; ++length) { in getWeightRanges() local
379 if(upper[length].count>0) { in getWeightRanges()
380 uprv_memcpy(ranges+rangeCount, upper+length, sizeof(WeightRange)); in getWeightRanges()
383 if(lower[length].count>0) { in getWeightRanges()
384 uprv_memcpy(ranges+rangeCount, lower+length, sizeof(WeightRange)); in getWeightRanges()
394 for(int32_t i = 0; i < rangeCount && ranges[i].length <= (minLength + 1); ++i) { in allocWeightsInShortRanges()
397 if(ranges[i].length > minLength) { in allocWeightsInShortRanges()
430 ranges[minLengthRangeCount].length == minLength; in allocWeightsInMinLengthRanges()
483 ranges[1].length = minLength; // +1 when lengthened in allocWeightsInMinLengthRanges()
512 int32_t minLength=ranges[0].length; in allocWeights()
530 for(int32_t i=0; i<rangeCount && ranges[i].length==minLength; ++i) { in allocWeights()
538 printf("ranges[%ld] .start=0x%08lx .end=0x%08lx .length=%ld .count=%ld\n", in allocWeights()
539 i, ranges[i].start, ranges[i].end, ranges[i].length, ranges[i].count); in allocWeights()
560 range.start = incWeight(weight, range.length); in nextWeight()