ICU-5261 Solaris 10 doesn't like U_MAX_PTR.

X-SVN-Rev: 19833
This commit is contained in:
George Rhoten 2006-07-13 07:21:15 +00:00
parent 31f8cf39d7
commit 2366cc93f2

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
*
* Copyright (C) 1999-2004, International Business Machines
* Copyright (C) 1999-2006, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@ -171,7 +171,8 @@ UnicodeString::extract(int32_t start,
int32_t
UnicodeString::extract(char *dest, int32_t destCapacity,
UConverter *cnv,
UErrorCode &errorCode) const {
UErrorCode &errorCode) const
{
if(U_FAILURE(errorCode)) {
return 0;
}
@ -214,7 +215,8 @@ int32_t
UnicodeString::doExtract(int32_t start, int32_t length,
char *dest, int32_t destCapacity,
UConverter *cnv,
UErrorCode &errorCode) const {
UErrorCode &errorCode) const
{
if(U_FAILURE(errorCode)) {
if(destCapacity!=0) {
*dest=0;
@ -228,12 +230,12 @@ UnicodeString::doExtract(int32_t start, int32_t length,
if(destCapacity==0) {
destLimit=dest=0;
} else if(destCapacity==-1) {
// Pin the limit to U_MAX_PTR if the "magic" destCapacity is used.
destLimit=(char*)U_MAX_PTR(dest);
// for NUL-termination, translate into highest int32_t
destCapacity=0x7fffffff;
} else {
if(destCapacity==-1) {
// Pin the limit to the max bytes per UChar if the "magic" destCapacity is used.
// +2 for the NULL and ending shifts.
destCapacity=ucnv_getMaxCharSize(cnv)*(length+2);
}
destLimit=dest+destCapacity;
}
@ -317,7 +319,8 @@ void
UnicodeString::doCodepageCreate(const char *codepageData,
int32_t dataLength,
UConverter *converter,
UErrorCode &status) {
UErrorCode &status)
{
if(U_FAILURE(status)) {
return;
}