mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-09 07:22:11 +00:00
ICU-4703 BEAM fixes
X-SVN-Rev: 18435
This commit is contained in:
parent
9e6d818ac3
commit
5bd9b6f420
4 changed files with 16 additions and 14 deletions
|
@ -604,7 +604,7 @@ Locale& Locale::init(const char* localeID, UBool canonicalize)
|
|||
|
||||
// successful end of init()
|
||||
return *this;
|
||||
} while(0);
|
||||
} while(0); /*loop doesn't iterate*/
|
||||
|
||||
// when an error occurs, then set this object to "bogus" (there is no UErrorCode here)
|
||||
setToBogus();
|
||||
|
@ -1107,13 +1107,13 @@ const Locale &
|
|||
Locale::getLocale(int locid)
|
||||
{
|
||||
Locale *localeCache = getLocaleCache();
|
||||
U_ASSERT(locid < eMAX_LOCALES);
|
||||
U_ASSERT((locid < eMAX_LOCALES)&&(locid>=0));
|
||||
if (localeCache == NULL) {
|
||||
// Failure allocating the locale cache.
|
||||
// The best we can do is return a NULL reference.
|
||||
locid = 0;
|
||||
}
|
||||
return localeCache[locid];
|
||||
return localeCache[locid]; /*operating on NULL*/
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -211,7 +211,9 @@ LocaleUtility::getAvailableLocaleNames(const UnicodeString& bundleID)
|
|||
ucln_common_registerCleanup(UCLN_COMMON_SERVICE, service_cleanup);
|
||||
}
|
||||
umtx_unlock(NULL);
|
||||
delete cache;
|
||||
if(cache != NULL) {
|
||||
delete cache;
|
||||
}
|
||||
cache = h;
|
||||
}
|
||||
|
||||
|
|
|
@ -2978,11 +2978,11 @@ uloc_acceptLanguage(char *result, int32_t resultAvailable,
|
|||
if(len>0) {
|
||||
uprv_strncpy(result, l, uprv_min(len, resultAvailable));
|
||||
}
|
||||
for(i=0;i<acceptListCount;i++) {
|
||||
uprv_free(fallbackList[i]);
|
||||
for(j=0;j<acceptListCount;j++) {
|
||||
uprv_free(fallbackList[j]);
|
||||
}
|
||||
uprv_free(fallbackList);
|
||||
return u_terminateChars(result, resultAvailable, len, status);
|
||||
return u_terminateChars(result, resultAvailable, len, status);
|
||||
}
|
||||
}
|
||||
uenum_reset(availableLocales, status);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************
|
||||
* Copyright (C) 1996-2004, International Business Machines Corporation *
|
||||
* Copyright (C) 1996-2005, International Business Machines Corporation *
|
||||
* and others. All Rights Reserved. *
|
||||
************************************************************************
|
||||
* 2003-nov-07 srl Port from Java
|
||||
|
@ -1488,13 +1488,14 @@ UnicodeString CalendarAstronomer::Horizon::toString() const
|
|||
|
||||
void CalendarCache::createCache(CalendarCache** cache, UErrorCode& status) {
|
||||
ucln_i18n_registerCleanup(UCLN_I18N_ASTRO_CALENDAR, calendar_astro_cleanup);
|
||||
*cache = new CalendarCache(32, status);
|
||||
if(cache == NULL) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
if(U_FAILURE(status)) {
|
||||
delete *cache;
|
||||
*cache = NULL;
|
||||
} else {
|
||||
*cache = new CalendarCache(32, status);
|
||||
if(U_FAILURE(status)) {
|
||||
delete *cache;
|
||||
*cache = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1522,7 +1523,6 @@ int32_t CalendarCache::get(CalendarCache** cache, int32_t key, UErrorCode &statu
|
|||
}
|
||||
|
||||
void CalendarCache::put(CalendarCache** cache, int32_t key, int32_t value, UErrorCode &status) {
|
||||
|
||||
if(U_FAILURE(status)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue