diff --git a/icu4c/source/common/uidna.cpp b/icu4c/source/common/uidna.cpp index bb18fbf5856..bd52cb5a27f 100644 --- a/icu4c/source/common/uidna.cpp +++ b/icu4c/source/common/uidna.cpp @@ -145,10 +145,9 @@ static inline UBool isLabelSeparator(UChar ch){ // if *limit == separator then the length returned does not include // the separtor. static inline int32_t -getNextSeparator(UChar *src,int32_t srcLength,UStringPrepProfile* nameprep, +getNextSeparator(UChar *src,int32_t srcLength, UChar **limit, - UBool *done, - UErrorCode *status){ + UBool *done){ if(srcLength == -1){ int32_t i; for(i=0 ; ;i++){ @@ -658,7 +657,7 @@ uidna_IDNToASCII( const UChar *src, int32_t srcLength, for(;;){ - labelLen = getNextSeparator(labelStart,remainingLen, nameprep, &delimiter,&done, status); + labelLen = getNextSeparator(labelStart,remainingLen, &delimiter,&done); labelReqLength = _internal_toASCII( labelStart, labelLen, currentDest, remainingDestCapacity, @@ -743,7 +742,7 @@ uidna_IDNToUnicode( const UChar* src, int32_t srcLength, for(;;){ - labelLen = getNextSeparator(labelStart,remainingLen, nameprep, &delimiter,&done, status); + labelLen = getNextSeparator(labelStart,remainingLen, &delimiter,&done); labelReqLength = _internal_toUnicode(labelStart, labelLen, currentDest, remainingDestCapacity, diff --git a/icu4c/source/common/usprep.cpp b/icu4c/source/common/usprep.cpp index 01293d2d4b0..e773584db4b 100644 --- a/icu4c/source/common/usprep.cpp +++ b/icu4c/source/common/usprep.cpp @@ -99,7 +99,7 @@ compareEntries(const UHashTok p1, const UHashTok p2) { U_CDECL_END U_CFUNC void -usprep_init(UErrorCode *status) { +usprep_init() { umtx_init(&usprepMutex); } @@ -304,11 +304,8 @@ usprep_open(const char* path, if(status == NULL || U_FAILURE(*status)){ return NULL; } - - usprep_init(status); - if (U_FAILURE(*status)) { - return NULL; - } + /* initialize the mutex */ + usprep_init(); /* initialize the profile struct members */ return usprep_getProfile(path,name,status);; @@ -385,11 +382,12 @@ usprep_internal_flushCache(UBool noRefCount){ return deletedNum; } -/* Works just like ucnv_flushCache() */ +/* Works just like ucnv_flushCache() static int32_t usprep_flushCache(){ return usprep_internal_flushCache(FALSE); } +*/ U_CFUNC UBool usprep_cleanup(void){ @@ -500,7 +498,7 @@ usprep_map( const UStringPrepProfile* profile, UStringPrepType type; int16_t value; UBool isIndex; - int32_t* indexes = (int32_t*)profile->indexes; + const int32_t* indexes = profile->indexes; // no error checking the caller check for error and arguments // no string length check the caller finds out the string length @@ -660,7 +658,6 @@ usprep_prepare( const UStringPrepProfile* profile, UCharDirection direction=U_CHAR_DIRECTION_COUNT, firstCharDir=U_CHAR_DIRECTION_COUNT; UBool leftToRight=FALSE, rightToLeft=FALSE; int32_t rtlPos =-1, ltrPos =-1; - const int32_t *indexes = profile->indexes; //get the string length if(srcLength == -1){ diff --git a/icu4c/source/tools/genrb/parse.c b/icu4c/source/tools/genrb/parse.c index cde3bc098c4..135ecf77efd 100644 --- a/icu4c/source/tools/genrb/parse.c +++ b/icu4c/source/tools/genrb/parse.c @@ -444,7 +444,7 @@ parseUCARules(char *tag, uint32_t startline, UErrorCode *status) { c = ucbuf_getc(ucbuf, status); if(c == QUOTE) { - quoted = !quoted; + quoted = (UBool)!quoted; } /* weiv (06/26/2002): adding the following: * - preserving spaces in commands [...] diff --git a/icu4c/source/tools/genrb/prscmnts.cpp b/icu4c/source/tools/genrb/prscmnts.cpp index 0d997631dcf..1f34417f99f 100644 --- a/icu4c/source/tools/genrb/prscmnts.cpp +++ b/icu4c/source/tools/genrb/prscmnts.cpp @@ -80,7 +80,7 @@ getText(const UChar* source, int32_t srcLen, UnicodeString stringArray[MAX_SPLIT_STRINGS]; RegexPattern *pattern = RegexPattern::compile("@", 0, *status); - UnicodeString src = source; + UnicodeString src (source,srcLen); if (U_FAILURE(*status)) { return 0; @@ -115,7 +115,7 @@ getDescription( const UChar* source, int32_t srcLen, UnicodeString stringArray[MAX_SPLIT_STRINGS]; RegexPattern *pattern = RegexPattern::compile("@", UREGEX_MULTILINE, *status); - UnicodeString src = source; + UnicodeString src(source, srcLen); if (U_FAILURE(*status)) { return 0; @@ -139,7 +139,7 @@ getCount(const UChar* source, int32_t srcLen, UnicodeString stringArray[MAX_SPLIT_STRINGS]; RegexPattern *pattern = RegexPattern::compile("@", UREGEX_MULTILINE, *status); - UnicodeString src = source; + UnicodeString src (source, srcLen); if (U_FAILURE(*status)) { @@ -152,7 +152,7 @@ getCount(const UChar* source, int32_t srcLen, return 0; } int32_t count = 0; - for(int32_t i=0; i