X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/57a6839dcb3bba09e8228b822b290604668416fe..9f1b115531acc2f3640893f76e8bcf6680033062:/icuSources/i18n/vtzone.cpp diff --git a/icuSources/i18n/vtzone.cpp b/icuSources/i18n/vtzone.cpp index 426810ec..b82327d5 100644 --- a/icuSources/i18n/vtzone.cpp +++ b/icuSources/i18n/vtzone.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* -* Copyright (C) 2007-2013, International Business Machines Corporation and +* Copyright (C) 2007-2016, International Business Machines Corporation and * others. All Rights Reserved. ******************************************************************************* */ @@ -356,7 +358,7 @@ static void millisToOffset(int32_t millis, UnicodeString& str) { /* * Create a default TZNAME from TZID */ -static void getDefaultTZName(const UnicodeString tzid, UBool isDST, UnicodeString& zonename) { +static void getDefaultTZName(const UnicodeString &tzid, UBool isDST, UnicodeString& zonename) { zonename = tzid; if (isDST) { zonename += UNICODE_STRING_SIMPLE("(DST)"); @@ -538,7 +540,7 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff UnicodeString rrule = *((UnicodeString*)dates->elementAt(0)); int32_t month, dayOfWeek, nthDayOfWeek, dayOfMonth = 0; int32_t days[7]; - int32_t daysCount = sizeof(days)/sizeof(days[0]); + int32_t daysCount = UPRV_LENGTHOF(days); UDate until; parseRRULE(rrule, month, dayOfWeek, nthDayOfWeek, days, daysCount, until, status); @@ -615,7 +617,7 @@ static TimeZoneRule* createRuleByRRULE(const UnicodeString& zonename, int rawOff UDate tmp_until; int32_t tmp_month, tmp_dayOfWeek, tmp_nthDayOfWeek; int32_t tmp_days[7]; - int32_t tmp_daysCount = sizeof(tmp_days)/sizeof(tmp_days[0]); + int32_t tmp_daysCount = UPRV_LENGTHOF(tmp_days); parseRRULE(rrule, tmp_month, tmp_dayOfWeek, tmp_nthDayOfWeek, tmp_days, tmp_daysCount, tmp_until, status); if (U_FAILURE(status)) { return NULL;