From faec7727aef40a97ba8b4cb60396008daa3670ef Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 30 Apr 2002 21:03:00 +0000 Subject: [PATCH] ICU-900 Fixed some compiler warnings. X-SVN-Rev: 8545 --- icu4c/source/common/udata.c | 8 ++++---- icu4c/source/i18n/bocsu.c | 2 +- icu4c/source/i18n/nfrs.cpp | 2 +- icu4c/source/i18n/ucoleitr.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/icu4c/source/common/udata.c b/icu4c/source/common/udata.c index a6493323cb..a073b3ce1e 100644 --- a/icu4c/source/common/udata.c +++ b/icu4c/source/common/udata.c @@ -177,7 +177,7 @@ strcpy_returnEnd(char *dest, const char *src) { char * uprv_computeDirPath(const char *path, char *pathBuffer) { char *finalSlash; /* Ptr to last dir separator in input path, or null if none. */ - int pathLen; /* Length of the returned directory path */ + int32_t pathLen; /* Length of the returned directory path */ finalSlash = 0; if (path != 0) { @@ -200,7 +200,7 @@ uprv_computeDirPath(const char *path, char *pathBuffer) { /* User supplied path did contain a directory portion. * Copy it to the output path buffer */ - pathLen = finalSlash - path + 1; + pathLen = (int32_t)(finalSlash - path + 1); uprv_memcpy(pathBuffer, path, pathLen); *(pathBuffer+pathLen) = 0; return pathBuffer+pathLen; @@ -296,7 +296,7 @@ static UDataMemory *udata_findCachedData(const char *path) static UDataMemory *udata_cacheDataItem(const char *path, UDataMemory *item, UErrorCode *pErr) { DataCacheElement *newElement; const char *baseName; - int nameLen; + int32_t nameLen; UHashtable *htable; UDataMemory *oldValue = NULL; @@ -319,7 +319,7 @@ static UDataMemory *udata_cacheDataItem(const char *path, UDataMemory *item, UEr UDatamemory_assign(newElement->item, item); baseName = findBasename(path); - nameLen = uprv_strlen(baseName); + nameLen = (int32_t)uprv_strlen(baseName); newElement->name = uprv_malloc(nameLen+1); if (newElement->name == NULL) { *pErr = U_MEMORY_ALLOCATION_ERROR; diff --git a/icu4c/source/i18n/bocsu.c b/icu4c/source/i18n/bocsu.c index 9c09deacca..da75ff6d2a 100644 --- a/icu4c/source/i18n/bocsu.c +++ b/icu4c/source/i18n/bocsu.c @@ -137,7 +137,7 @@ u_writeIdenticalLevelRun(const UChar *s, int32_t length, uint8_t *p) { p=u_writeDiff(c-prev, p); prev=c; } - return p-p0; + return (int32_t)(p-p0); } /* How many bytes would writeIdenticalLevelRun() write? */ diff --git a/icu4c/source/i18n/nfrs.cpp b/icu4c/source/i18n/nfrs.cpp index 5608663504..5f18836174 100644 --- a/icu4c/source/i18n/nfrs.cpp +++ b/icu4c/source/i18n/nfrs.cpp @@ -888,7 +888,7 @@ uint32_t util64_tou(int64_t w, UChar* buf, uint32_t len, uint32_t radix, UBool r *p = 0; // null terminate if room for caller convenience } - len = p - buf; + len = (uint32_t)(p - buf); if (*buf == kUMinus) { ++buf; } diff --git a/icu4c/source/i18n/ucoleitr.cpp b/icu4c/source/i18n/ucoleitr.cpp index 5ba9bfc177..116c2f22a6 100644 --- a/icu4c/source/i18n/ucoleitr.cpp +++ b/icu4c/source/i18n/ucoleitr.cpp @@ -205,10 +205,10 @@ ucol_getOffset(const UCollationElements *elems) if (ci->fcdPosition == NULL) { return 0; } - return ci->fcdPosition - ci->string; + return (int32_t)(ci->fcdPosition - ci->string); } else { - return ci->pos - ci->string; + return (int32_t)(ci->pos - ci->string); } }