ICU-2495 incorporate review changes

X-SVN-Rev: 12089
This commit is contained in:
Alan Liu 2003-05-23 20:32:33 +00:00
parent 243753a42c
commit 95ab039646

View File

@ -161,13 +161,16 @@ static Hashtable* CASE_EQUIV_HASH = NULL; // for closeOver(USET_CASE)
static CompactByteArray* CASE_EQUIV_CBA = NULL; // for closeOver(USET_CASE)
/**
* Keep code points in range.
* Modify the given UChar32 variable so that it is in range, by
* pinning values < UNICODESET_LOW to UNICODESET_LOW, and
* pinning values > UNICODESET_HIGH-1 to UNICODESET_HIGH-1.
* It modifies its argument in-place and also returns it.
*/
inline UChar32 pinCodePoint(UChar32& c) {
if (c < 0) {
c = 0;
} else if (c > 0x10FFFF) {
c = 0x10FFFF;
if (c < UNICODESET_LOW) {
c = UNICODESET_LOW;
} else if (c > (UNICODESET_HIGH-1)) {
c = (UNICODESET_HIGH-1);
}
return c;
}