ICU-900 Fixed some compiler warnings.

X-SVN-Rev: 8539
This commit is contained in:
George Rhoten 2002-04-30 17:22:11 +00:00
parent ce01292bc0
commit 7f87b5724e
5 changed files with 17 additions and 17 deletions

View file

@ -101,7 +101,7 @@ void locale_set_default_internal(const char *id)
#ifdef ICU_LOCID_USE_DEPRECATES
Locale::fgDefaultLocale.init(id);
#else
if (gLocaleCache == NULL) {
if (gLocaleCache == NULL) {
Locale::initLocaleCache();
}
@ -423,13 +423,13 @@ Locale& Locale::init(const char* localeID)
/* preset all fields to empty */
language[0] = country[0] = 0;
variantBegin = uprv_strlen(fullName);
variantBegin = (int32_t)uprv_strlen(fullName);
/* after uloc_getName() we know that only '_' are separators */
separator = uprv_strchr(fullName, SEP_CHAR);
if(separator != 0) {
/* there is a country field */
length = separator - fullName;
length = (int32_t)(separator - fullName);
if(length > 0) {
if(length >= (int32_t)sizeof(language)) {
break;
@ -442,7 +442,7 @@ Locale& Locale::init(const char* localeID)
separator = uprv_strchr(prev, SEP_CHAR);
if(separator != 0) {
/* there is a variant field */
length = separator - prev;
length = (int32_t)(separator - prev);
if(length > 0) {
if(length >= (int32_t)sizeof(country)) {
break;
@ -451,7 +451,7 @@ Locale& Locale::init(const char* localeID)
}
country[length] = 0;
variantBegin = (separator + 1) - fullName;
variantBegin = (int32_t)((separator + 1) - fullName);
} else {
/* variantBegin==strlen(fullName), length==strlen(language)==prev-1-fullName */
if((variantBegin - length - 1) >= (int32_t)sizeof(country)) {

View file

@ -111,7 +111,7 @@ uprv_defaultCodePageForLocale(const char *locale)
{
return NULL;
}
locale_len = uprv_strlen(locale);
locale_len = (int32_t)uprv_strlen(locale);
if(locale_len < 2)
{
@ -124,7 +124,7 @@ uprv_defaultCodePageForLocale(const char *locale)
{
if(uprv_strncmp(locale, _localeToDefaultCharmapTable[i].loc,
uprv_min(locale_len,
uprv_strlen(_localeToDefaultCharmapTable[i].loc)))
(int32_t)uprv_strlen(_localeToDefaultCharmapTable[i].loc)))
== 0)
{
return _localeToDefaultCharmapTable[i].charmap;

View file

@ -445,7 +445,7 @@ uhash_tokp(void* p) {
int32_t hash = 0; \
const TYPE *p = (const TYPE*) STR; \
if (p != NULL) { \
int32_t len = STRLEN; \
int32_t len = (int32_t)(STRLEN); \
int32_t inc = ((len - 32) / 32) + 1; \
const TYPE *limit = p + len; \
while (p<limit) { \

View file

@ -427,10 +427,10 @@ _copyCount(char *dest, int32_t destCapacity, const char *src) {
anchor=src;
for(;;) {
if((c=*src)==0) {
return src-anchor;
return (int32_t)(src-anchor);
}
if(destCapacity<=0) {
return (src-anchor)+uprv_strlen(src);
return (int32_t)((src-anchor)+uprv_strlen(src));
}
++src;
*dest++=c;
@ -1030,7 +1030,7 @@ _getStringOrCopyKey(const char *path, const char *locale,
/* no string from a resource bundle: convert the substitute */
if(length==-1) {
length=uprv_strlen(substitute);
length=(int32_t)uprv_strlen(substitute);
u_charsToUChars(substitute, dest, uprv_min(length, destCapacity));
*pErrorCode=U_ZERO_ERROR;
}

View file

@ -852,7 +852,7 @@ UnicodeString::doIndexOf(UChar c,
do {
if(*begin == c) {
return begin - getArrayStart();
return (int32_t)(begin - getArrayStart());
}
} while(++begin < limit);
@ -874,7 +874,7 @@ UnicodeString::doIndexOf(UChar32 c,
// surrogate code point
const UChar *t = uprv_strFindSurrogate(fArray + start, length, (UChar)c);
if(t != 0) {
return t - fArray;
return (int32_t)(t - fArray);
} else {
return -1;
}
@ -958,7 +958,7 @@ UnicodeString::doLastIndexOf(UChar c,
do {
if(*--limit == c) {
return limit - getArrayStart();
return (int32_t)(limit - getArrayStart());
}
} while(limit > begin);
@ -980,7 +980,7 @@ UnicodeString::doLastIndexOf(UChar32 c,
// surrogate code point
const UChar *t = uprv_strFindLastSurrogate(fArray + start, length, (UChar)c);
if(t != 0) {
return t - fArray;
return (int32_t)(t - fArray);
} else {
return -1;
}
@ -1751,7 +1751,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
&mySource, mySourceEnd, 0, TRUE, &status);
// update the conversion parameters
fLength = myTarget - fArray;
fLength = (int32_t)(myTarget - fArray);
// allocate more space and copy data, if needed
if(status == U_BUFFER_OVERFLOW_ERROR) {
@ -1763,7 +1763,7 @@ UnicodeString::doCodepageCreate(const char *codepageData,
// estimate the new size needed, larger than before
// try 2 UChar's per remaining source byte
arraySize = fLength + 2 * (mySourceEnd - mySource);
arraySize = (int32_t)(fLength + 2 * (mySourceEnd - mySource));
} else {
break;
}