//String[] finalResult = new String[result.size()];
UnicodeString *finalResult = NULL;
int32_t resultCount;
- if((resultCount = result.count())) {
+ if((resultCount = result.count()) != 0) {
finalResult = new UnicodeString[resultCount];
if (finalResult == 0) {
status = U_MEMORY_ALLOCATION_ERROR;
}
if (pPosixID) {
- int32_t resLen = uprv_strlen(pPosixID);
+ int32_t resLen = static_cast<int32_t>(uprv_strlen(pPosixID));
int32_t copyLen = resLen <= posixIDCapacity ? resLen : posixIDCapacity;
uprv_memcpy(posixID, pPosixID, copyLen);
if (resLen < posixIDCapacity) {
char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
// this will change it from de_DE@collation=phonebook to de-DE-u-co-phonebk form
- int32_t bcp47Len = uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &myStatus);
+ (void)uloc_toLanguageTag(mylocaleID, asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &myStatus);
if (U_SUCCESS(myStatus))
{
hr = timezone->GetTimeZone(timezoneString.GetAddressOf());
if (SUCCEEDED(hr))
{
- int32_t length = wcslen(timezoneString.GetRawBuffer(NULL));
+ int32_t length = static_cast<int32_t>(wcslen(timezoneString.GetRawBuffer(NULL)));
char* asciiId = (char*)uprv_calloc(length + 1, sizeof(char));
if (asciiId != nullptr)
{
U_CAPI const char* U_EXPORT2
uprv_tzname(int n)
{
+ n; // Avoid unreferenced parameter warning.
const char *tzid = NULL;
#if U_PLATFORM_USES_ONLY_WIN32_API
#if U_PLATFORM_HAS_WINUWP_API > 0
#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
{
char *p;
- while(p = uprv_strchr(newDataDir, U_FILE_ALT_SEP_CHAR)) {
+ while((p = uprv_strchr(newDataDir, U_FILE_ALT_SEP_CHAR)) != NULL) {
*p = U_FILE_SEP_CHAR;
}
}
gTimeZoneFilesDirectory->append(path, status);
#if (U_FILE_SEP_CHAR != U_FILE_ALT_SEP_CHAR)
char *p = gTimeZoneFilesDirectory->data();
- while (p = uprv_strchr(p, U_FILE_ALT_SEP_CHAR)) {
+ while ((p = uprv_strchr(p, U_FILE_ALT_SEP_CHAR)) != NULL) {
*p = U_FILE_SEP_CHAR;
}
#endif
}
/* add the start code point of each same-value range of the properties vectors trie */
- if(propsVectorsColumns>0) {
- /* if propsVectorsColumns==0 then the properties vectors trie may not be there at all */
- utrie2_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa);
- }
+ utrie2_enum(&propsVectorsTrie, NULL, _enumPropertyStartsRange, sa);
}
0xe30000,0xa00b1596,0x7c00300,0xe30000,0xa040af86,0x6800400,0x962540};
static const int32_t countPropsVectors=6375;
-static const int32_t propsVectorsColumns=3;
+static const int32_t propsVectorsColumns=3; /* The code assumes that this value is > 0*/
static const uint16_t scriptExtensions[198]={
0x800e,0x8019,8,0x8059,8,2,8,0x8038,8,6,8,0x8019,3,0x800c,2,0x22,
0x8025,2,0xe,2,0x22,0x54,0x79,0x7b,0x80a7,2,0x8022,2,0x8025,2,0x1b,4,
currentState = tmpState;
}
- sourceOffset = uprv_strlen((char*)escSeqCompoundText[currentState]) - args->converter->toULength;
+ sourceOffset = static_cast<int32_t>(uprv_strlen((char*)escSeqCompoundText[currentState]) - args->converter->toULength);
mySource += sourceOffset;
if(extraInfo->localeConverterIndex < ULMBCS_DOUBLEOPTGROUP_START)
{
- bytes_written = LMBCSConversionWorker (extraInfo,
+ bytes_written = (int32_t)LMBCSConversionWorker (extraInfo,
ULMBCS_GRP_L1, pLMBCS, &uniChar,
&lastConverterIndex, groups_tried);
if(!bytes_written)
{
- bytes_written = LMBCSConversionWorker (extraInfo,
+ bytes_written = (int32_t)LMBCSConversionWorker (extraInfo,
ULMBCS_GRP_EXCEPT, pLMBCS, &uniChar,
&lastConverterIndex, groups_tried);
}
if(!bytes_written)
{
- bytes_written = LMBCSConversionWorker (extraInfo,
+ bytes_written = (int32_t)LMBCSConversionWorker (extraInfo,
extraInfo->localeConverterIndex, pLMBCS, &uniChar,
&lastConverterIndex, groups_tried);
}
}
else
{
- bytes_written = LMBCSConversionWorker (extraInfo,
+ bytes_written = (int32_t)LMBCSConversionWorker (extraInfo,
extraInfo->localeConverterIndex, pLMBCS, &uniChar,
&lastConverterIndex, groups_tried);
}
uint8_t b, t1, t2;
uint32_t asciiRoundtrips;
- uint16_t value, minValue;
+ uint16_t value, minValue = 0;
UBool hasSupplementary;
/* set up the local pointers */
uint32_t stage2Entry;
uint32_t asciiRoundtrips;
- uint16_t value;
+ uint16_t value = 0;
UBool hasSupplementary;
/* set up the local pointers */
return didUpdate;
}
+#if U_PLATFORM_HAS_WINUWP_API == 0
+
static UBool
setCommonICUDataPointer(const void *pData, UBool /*warn*/, UErrorCode *pErrorCode) {
UDataMemory tData;
return setCommonICUData(&tData, FALSE, pErrorCode);
}
+#endif
+
static const char *
findBasename(const char *path) {
const char *basename=uprv_strrchr(path, U_FILE_SEP_CHAR);
/* init path iterator for individual files */
UDataPathIterator iter(dataPath, pkgName, path, tocEntryPathSuffix, FALSE, pErrorCode);
- while((pathBuffer = iter.next(pErrorCode)))
+ while((pathBuffer = iter.next(pErrorCode)) != NULL)
{
#ifdef UDATA_DEBUG
fprintf(stderr, "UDATA: trying individual file %s\n", pathBuffer);
if(uprv_strchr(path,U_FILE_ALT_SEP_CHAR) != NULL) {
altSepPath.append(path, *pErrorCode);
char *p;
- while((p=uprv_strchr(altSepPath.data(), U_FILE_ALT_SEP_CHAR))) {
+ while ((p = uprv_strchr(altSepPath.data(), U_FILE_ALT_SEP_CHAR)) != NULL) {
*p = U_FILE_SEP_CHAR;
}
#if defined (UDATA_DEBUG)
U_CAPI int32_t U_EXPORT2
uhash_hashChars(const UHashTok key) {
const char *s = (const char *)key.pointer;
- return s == NULL ? 0 : ustr_hashCharsN(s, uprv_strlen(s));
+ return s == NULL ? 0 : static_cast<int32_t>(ustr_hashCharsN(s, uprv_strlen(s)));
}
U_CAPI int32_t U_EXPORT2
uint8_t *orig_dst = dst;
if(n==-1) {
- n = uprv_strlen((const char*)src)+1; /* copy NUL */
+ n = static_cast<int32_t>(uprv_strlen((const char*)src)+1); /* copy NUL */
}
/* copy non-null */
while(*src && n>0) {
uint8_t *orig_dst = dst;
if(n==-1) {
- n = uprv_strlen((const char*)src)+1; /* copy NUL */
+ n = static_cast<int32_t>(uprv_strlen((const char*)src)+1); /* copy NUL */
}
/* copy non-null */
while(*src && n>0) {
s = (const char *)ulist_getNext((UList *)(en->context));
if (s != NULL && resultLength != NULL) {
- *resultLength = uprv_strlen(s);
+ *resultLength = static_cast<int32_t>(uprv_strlen(s));
}
return s;
}
}
/* Gets the size of the shortest subtag in the given localeID. */
static int32_t getShortestSubtagLength(const char *localeID) {
- int32_t localeIDLength = uprv_strlen(localeID);
+ int32_t localeIDLength = static_cast<int32_t>(uprv_strlen(localeID));
int32_t length = localeIDLength;
int32_t tmpLength = 0;
int32_t i;
#if defined(ULOC_DEBUG)
fprintf(stderr,"%02d: %s\n", i, acceptList[i]);
#endif
- while((l=uenum_next(availableLocales, NULL, status))) {
+ while((l=uenum_next(availableLocales, NULL, status)) != NULL) {
#if defined(ULOC_DEBUG)
fprintf(stderr," %s\n", l);
#endif
#if defined(ULOC_DEBUG)
fprintf(stderr,"Try: [%s]", fallbackList[i]);
#endif
- while((l=uenum_next(availableLocales, NULL, status))) {
+ while((l=uenum_next(availableLocales, NULL, status)) != NULL) {
#if defined(ULOC_DEBUG)
fprintf(stderr," %s\n", l);
#endif
no known mapping. This implementation normalizes the
the value to lower case
*/
- int32_t bcpValueLen = uprv_strlen(bcpValue);
+ int32_t bcpValueLen = static_cast<int32_t>(uprv_strlen(bcpValue));
if (bcpValueLen < extBufCapacity) {
uprv_strcpy(pExtBuf, bcpValue);
T_CString_toLowerCase(pExtBuf);
bufIdx++;
}
- len = uprv_strlen(attr->attribute);
+ len = static_cast<int32_t>(uprv_strlen(attr->attribute));
uprv_memcpy(buf + bufIdx, attr->attribute, len);
bufIdx += len;
int32_t newTagLength;
grandfatheredLen = tagLen; /* back up for output parsedLen */
- newTagLength = uprv_strlen(GRANDFATHERED[i+1]);
+ newTagLength = static_cast<int32_t>(uprv_strlen(GRANDFATHERED[i+1]));
if (tagLen < newTagLength) {
uprv_free(tagBuf);
tagBuf = (char*)uprv_malloc(newTagLength + 1);
{
HANDLE map;
HANDLE file;
- SECURITY_ATTRIBUTES mappingAttributes;
- SECURITY_ATTRIBUTES *mappingAttributesPtr = NULL;
- SECURITY_DESCRIPTOR securityDesc;
-
+
UDataMemory_init(pData); /* Clear the output struct. */
/* open the input file */
This is required for multiuser systems on Windows 2000 SP4 and beyond */
// TODO: UWP does not have this function and I do not think it is required?
#if U_PLATFORM_HAS_WINUWP_API == 0
+
+ SECURITY_ATTRIBUTES mappingAttributes;
+ SECURITY_ATTRIBUTES *mappingAttributesPtr = NULL;
+ SECURITY_DESCRIPTOR securityDesc;
+
if (InitializeSecurityDescriptor(&securityDesc, SECURITY_DESCRIPTOR_REVISION)) {
/* give the security descriptor a Null Dacl done using the "TRUE, (PACL)NULL" here */
if (SetSecurityDescriptorDacl(&securityDesc, TRUE, (PACL)NULL, FALSE)) {
}
U_CAPI void U_EXPORT2
-umtx_condSignal(UConditionVar *condition) {
+umtx_condSignal(UConditionVar * /* condition */) {
// Function not implemented. There is no immediate requirement from ICU to have it.
// Once ICU drops support for Windows XP and Server 2003, ICU Condition Variables will be
// changed to be thin wrappers on native Windows CONDITION_VARIABLEs, and this function
*/
virtual int32_t hashCode() const {
const char *s = typeid(T).name();
- return ustr_hashCharsN(s, uprv_strlen(s));
+ return ustr_hashCharsN(s, static_cast<int32_t>(uprv_strlen(s)));
}
/**
u_terminateUChars(dest, destCapacity, reqLength, pErrorCode);
return dest;
}
- srcLength = uprv_strlen((const char *)pSrc);
+ srcLength = static_cast<int32_t>(uprv_strlen((const char *)pSrc));
}
/* Faster loop without ongoing checking for pSrcLimit and pDestLimit. */
if(!checkArgs(label, length, dest, capacity, pInfo, pErrorCode)) {
return 0;
}
- StringPiece src(label, length<0 ? uprv_strlen(label) : length);
+ StringPiece src(label, length<0 ? static_cast<int32_t>(uprv_strlen(label)) : length);
CheckedArrayByteSink sink(dest, capacity);
IDNAInfo info;
reinterpret_cast<const IDNA *>(idna)->labelToASCII_UTF8(src, sink, info, *pErrorCode);
if(!checkArgs(label, length, dest, capacity, pInfo, pErrorCode)) {
return 0;
}
- StringPiece src(label, length<0 ? uprv_strlen(label) : length);
+ StringPiece src(label, length<0 ? static_cast<int32_t>(uprv_strlen(label)) : length);
CheckedArrayByteSink sink(dest, capacity);
IDNAInfo info;
reinterpret_cast<const IDNA *>(idna)->labelToUnicodeUTF8(src, sink, info, *pErrorCode);
if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) {
return 0;
}
- StringPiece src(name, length<0 ? uprv_strlen(name) : length);
+ StringPiece src(name, length<0 ? static_cast<int32_t>(uprv_strlen(name)) : length);
CheckedArrayByteSink sink(dest, capacity);
IDNAInfo info;
reinterpret_cast<const IDNA *>(idna)->nameToASCII_UTF8(src, sink, info, *pErrorCode);
if(!checkArgs(name, length, dest, capacity, pInfo, pErrorCode)) {
return 0;
}
- StringPiece src(name, length<0 ? uprv_strlen(name) : length);
+ StringPiece src(name, length<0 ? static_cast<int32_t>(uprv_strlen(name)) : length);
CheckedArrayByteSink sink(dest, capacity);
IDNAInfo info;
reinterpret_cast<const IDNA *>(idna)->nameToUnicodeUTF8(src, sink, info, *pErrorCode);
}
const char *result = ures_getKey(fRes);
if (resultLength != NULL) {
- *resultLength = uprv_strlen(result);
+ *resultLength = static_cast<int32_t>(uprv_strlen(result));
}
return result;
}
}
const char* region = fLocale.getCountry();
- int32_t regionLen = uprv_strlen(region);
+ int32_t regionLen = static_cast<int32_t>(uprv_strlen(region));
if (regionLen == 0) {
char loc[ULOC_FULLNAME_CAPACITY];
uloc_addLikelySubtags(fLocale.getName(), loc, sizeof(loc), &status);
// but it should be parsed as 00:10:20.
int32_t tmpLen = 0;
int32_t tmpSign = 1;
- int32_t tmpH, tmpM, tmpS;
+ int32_t tmpH = 0;
+ int32_t tmpM = 0;
+ int32_t tmpS = 0;
for (int32_t patidx = 0; PARSE_GMT_OFFSET_TYPES[patidx] >= 0; patidx++) {
int32_t gmtPatType = PARSE_GMT_OFFSET_TYPES[patidx];
}
StringEnumeration *tzenum = TimeZone::createEnumeration();
const UnicodeString *id;
- while ((id = tzenum->snext(status))) {
+ while ((id = tzenum->snext(status)) != NULL) {
const UChar* uid = ZoneMeta::findTimeZoneID(*id);
if (uid) {
gZoneIdTrie->put(uid, const_cast<UChar *>(uid), status);
status = U_MEMORY_ALLOCATION_ERROR;
} else {
const UnicodeString *id;
- while ((id = tzenum->snext(status))) {
+ while ((id = tzenum->snext(status)) != NULL) {
const UChar* uID = ZoneMeta::findTimeZoneID(*id);
const UChar* shortID = ZoneMeta::getShortID(*id);
if (shortID && uID) {
};
StringEnumeration *mzIDs = fTimeZoneNames->getAvailableMetaZoneIDs(tzCanonicalID, status);
- while ((mzID = mzIDs->snext(status))) {
+ while ((mzID = mzIDs->snext(status)) != NULL) {
if (U_FAILURE(status)) {
break;
}
StringEnumeration *tzIDs = TimeZone::createTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL, NULL, NULL, status);
if (U_SUCCESS(status)) {
const UnicodeString *tzID;
- while ((tzID = tzIDs->snext(status))) {
+ while ((tzID = tzIDs->snext(status)) != NULL) {
if (U_FAILURE(status)) {
break;
}
const UHashElement* elem;
double now = (double)uprv_getUTCtime();
- while ((elem = uhash_nextElement(gTZGNCoreCache, &pos))) {
+ while ((elem = uhash_nextElement(gTZGNCoreCache, &pos)) != NULL) {
TZGNCoreRef *entry = (TZGNCoreRef *)elem->value.pointer;
if (entry->refCount <= 0 && (now - entry->lastAccess) > CACHE_EXPIRATION) {
// delete this entry
U_ASSERT(!mzIDs.isNull());
const UnicodeString *mzID;
- while ((mzID = mzIDs->snext(status)) && U_SUCCESS(status)) {
+ while (((mzID = mzIDs->snext(status)) != NULL) && U_SUCCESS(status)) {
loadMetaZoneNames(*mzID, status);
}
}
StringEnumeration *tzIDs = TimeZone::createTimeZoneIDEnumeration(
UCAL_ZONE_TYPE_CANONICAL, NULL, NULL, status);
if (U_SUCCESS(status)) {
- while ((id = tzIDs->snext(status))) {
+ while ((id = tzIDs->snext(status)) != NULL) {
if (U_FAILURE(status)) {
break;
}
U_ASSERT(collationType != NULL && *collationType != 0);
// Copy the type for lowercasing.
char type[16];
- int32_t typeLength = uprv_strlen(collationType);
+ int32_t typeLength = static_cast<int32_t>(uprv_strlen(collationType));
if(typeLength >= UPRV_LENGTHOF(type)) {
errorCode = U_ILLEGAL_ARGUMENT_ERROR;
return;
// Load the collations/type tailoring, with type fallback.
LocalUResourceBundlePointer localData(
ures_getByKeyWithFallback(collations, type, NULL, &errorCode));
- int32_t typeLength = uprv_strlen(type);
+ int32_t typeLength = static_cast<int32_t>(uprv_strlen(type));
if(errorCode == U_MISSING_RESOURCE_ERROR) {
errorCode = U_USING_DEFAULT_WARNING;
typeFallback = TRUE;
}
if (length < 0) {
- length = uprv_strlen(number);
+ length = static_cast<int32_t>(uprv_strlen(number));
}
StringPiece numSP(number, length);
Formattable numFmtbl(numSP, *status);
if (U_FAILURE(*status)) {
return 0;
}
- UnicodeString idStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : uprv_strlen(id)));
+ UnicodeString idStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : static_cast<int32_t>(uprv_strlen(id))));
int32_t result = uspoof_check2UnicodeString(sc, idStr, checkResult, status);
return result;
}
*status = U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
- UnicodeString id1Str = UnicodeString::fromUTF8(StringPiece(id1, length1>=0? length1 : uprv_strlen(id1)));
- UnicodeString id2Str = UnicodeString::fromUTF8(StringPiece(id2, length2>=0? length2 : uprv_strlen(id2)));
+ UnicodeString id1Str = UnicodeString::fromUTF8(StringPiece(id1, length1>=0? length1 : static_cast<int32_t>(uprv_strlen(id1))));
+ UnicodeString id2Str = UnicodeString::fromUTF8(StringPiece(id2, length2>=0? length2 : static_cast<int32_t>(uprv_strlen(id2))));
int32_t results = uspoof_areConfusableUnicodeString(sc, id1Str, id2Str, status);
return results;
}
return 0;
}
- UnicodeString srcStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : uprv_strlen(id)));
+ UnicodeString srcStr = UnicodeString::fromUTF8(StringPiece(id, length>=0 ? length : static_cast<int32_t>(uprv_strlen(id))));
UnicodeString destStr;
uspoof_getSkeletonUnicodeString(sc, type, srcStr, destStr, status);
if (U_FAILURE(*status)) {
char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
// Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk".
- int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
+ (void)uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
if (U_SUCCESS(status))
{
}
// TODO: Is just ignoring pos the right thing?
-UnicodeString &Win32DateFormat::format(Calendar &cal, UnicodeString &appendTo, FieldPosition &pos) const
+UnicodeString &Win32DateFormat::format(Calendar &cal, UnicodeString &appendTo, FieldPosition & /* pos */) const
{
FILETIME ft;
SYSTEMTIME st_gmt;
return appendTo;
}
-void Win32DateFormat::parse(const UnicodeString& text, Calendar& cal, ParsePosition& pos) const
+void Win32DateFormat::parse(const UnicodeString& /* text */, Calendar& /* cal */, ParsePosition& pos) const
{
pos.setErrorIndex(pos.getIndex());
}
char asciiBCP47Tag[LOCALE_NAME_MAX_LENGTH] = {};
// Convert from names like "en_CA" and "de_DE@collation=phonebook" to "en-CA" and "de-DE-u-co-phonebk".
- int32_t length = uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
+ (void) uloc_toLanguageTag(locale.getName(), asciiBCP47Tag, UPRV_LENGTHOF(asciiBCP47Tag), FALSE, &status);
if (U_SUCCESS(status))
{
return new Win32NumberFormat(*this);
}
-UnicodeString& Win32NumberFormat::format(double number, UnicodeString& appendTo, FieldPosition& pos) const
+UnicodeString& Win32NumberFormat::format(double number, UnicodeString& appendTo, FieldPosition& /* pos */) const
{
return format(getMaximumFractionDigits(), appendTo, L"%.16f", number);
}
-UnicodeString& Win32NumberFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const
+UnicodeString& Win32NumberFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& /* pos */) const
{
return format(getMinimumFractionDigits(), appendTo, L"%I32d", number);
}
-UnicodeString& Win32NumberFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const
+UnicodeString& Win32NumberFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& /* pos */) const
{
return format(getMinimumFractionDigits(), appendTo, L"%I64d", number);
}
// Always use DOW type rule
int32_t hour, min, sec, mil;
standardDate.wYear = 0;
- standardDate.wMonth = std->getRule()->getRuleMonth() + 1;
- standardDate.wDay = std->getRule()->getRuleWeekInMonth();
+ standardDate.wMonth = static_cast<WORD>(std->getRule()->getRuleMonth()) + 1;
+ standardDate.wDay = static_cast<WORD>(std->getRule()->getRuleWeekInMonth());
if (standardDate.wDay < 0) {
standardDate.wDay = 5;
}
- standardDate.wDayOfWeek = std->getRule()->getRuleDayOfWeek() - 1;
+ standardDate.wDayOfWeek = static_cast<WORD>(std->getRule()->getRuleDayOfWeek()) - 1;
mil = std->getRule()->getRuleMillisInDay();
hour = mil/3600000;
sec = mil/1000;
mil %= 1000;
- standardDate.wHour = hour;
- standardDate.wMinute = min;
- standardDate.wSecond = sec;
- standardDate.wMilliseconds = mil;
+ standardDate.wHour = static_cast<WORD>(hour);
+ standardDate.wMinute = static_cast<WORD>(min);
+ standardDate.wSecond = static_cast<WORD>(sec);
+ standardDate.wMilliseconds = static_cast<WORD>(mil);
daylightDate.wYear = 0;
- daylightDate.wMonth = dst->getRule()->getRuleMonth() + 1;
- daylightDate.wDay = dst->getRule()->getRuleWeekInMonth();
+ daylightDate.wMonth = static_cast<WORD>(dst->getRule()->getRuleMonth()) + 1;
+ daylightDate.wDay = static_cast<WORD>(dst->getRule()->getRuleWeekInMonth());
if (daylightDate.wDay < 0) {
daylightDate.wDay = 5;
}
- daylightDate.wDayOfWeek = dst->getRule()->getRuleDayOfWeek() - 1;
+ daylightDate.wDayOfWeek = static_cast<WORD>(dst->getRule()->getRuleDayOfWeek()) - 1;
mil = dst->getRule()->getRuleMillisInDay();
hour = mil/3600000;
sec = mil/1000;
mil %= 1000;
- daylightDate.wHour = hour;
- daylightDate.wMinute = min;
- daylightDate.wSecond = sec;
- daylightDate.wMilliseconds = mil;
+ daylightDate.wHour = static_cast<WORD>(hour);
+ daylightDate.wMinute = static_cast<WORD>(min);
+ daylightDate.wSecond = static_cast<WORD>(sec);
+ daylightDate.wMilliseconds = static_cast<WORD>(mil);
}
} else {
result = FALSE;
break;
}
const char *mzID = ures_getKey(&res);
- int32_t len = uprv_strlen(mzID);
+ int32_t len = static_cast<int32_t>(uprv_strlen(mzID));
UChar *uMzID = (UChar*)uprv_malloc(sizeof(UChar) * (len + 1));
if (uMzID == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;