From a82e70e5b10cf8b465c7108057ddab0ffb682b58 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 19 Apr 2017 18:55:46 +0000 Subject: [PATCH] ICU-13029 Mark unmodified static data as const X-SVN-Rev: 40065 --- icu4c/source/common/listformatter.cpp | 2 +- icu4c/source/common/loclikely.cpp | 2 +- icu4c/source/common/unifiedcache.cpp | 4 ++-- icu4c/source/i18n/affixpatternparser.cpp | 10 +++++----- icu4c/source/i18n/decfmtst.cpp | 4 ++-- icu4c/source/i18n/reldatefmt.cpp | 2 +- icu4c/source/i18n/rematch.cpp | 2 +- icu4c/source/i18n/tznames_impl.cpp | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/icu4c/source/common/listformatter.cpp b/icu4c/source/common/listformatter.cpp index d105654755f..33a8ac28671 100644 --- a/icu4c/source/common/listformatter.cpp +++ b/icu4c/source/common/listformatter.cpp @@ -63,7 +63,7 @@ ListFormatInternal(const ListFormatInternal &other) : static Hashtable* listPatternHash = NULL; static UMutex listFormatterMutex = U_MUTEX_INITIALIZER; -static const char *STANDARD_STYLE = "standard"; +static const char STANDARD_STYLE[] = "standard"; U_CDECL_BEGIN static UBool U_CALLCONV uprv_listformatter_cleanup() { diff --git a/icu4c/source/common/loclikely.cpp b/icu4c/source/common/loclikely.cpp index cdd6f78cf7b..60192a3fd31 100644 --- a/icu4c/source/common/loclikely.cpp +++ b/icu4c/source/common/loclikely.cpp @@ -1281,7 +1281,7 @@ uloc_minimizeSubtags(const char* localeID, // Pairs of (language subtag, + or -) for finding out fast if common languages // are LTR (minus) or RTL (plus). -static const char* LANG_DIR_STRING = +static const char LANG_DIR_STRING[] = "root-en-es-pt-zh-ja-ko-de-fr-it-ar+he+fa+ru-nl-pl-th-tr-"; // Implemented here because this calls uloc_addLikelySubtags(). diff --git a/icu4c/source/common/unifiedcache.cpp b/icu4c/source/common/unifiedcache.cpp index fd2d107a6c8..d0238825d11 100644 --- a/icu4c/source/common/unifiedcache.cpp +++ b/icu4c/source/common/unifiedcache.cpp @@ -24,8 +24,8 @@ static UConditionVar gInProgressValueAddedCond = U_CONDITION_INITIALIZER; static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER; static const int32_t MAX_EVICT_ITERATIONS = 10; -static int32_t DEFAULT_MAX_UNUSED = 1000; -static int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100; +static const int32_t DEFAULT_MAX_UNUSED = 1000; +static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100; U_CDECL_BEGIN diff --git a/icu4c/source/i18n/affixpatternparser.cpp b/icu4c/source/i18n/affixpatternparser.cpp index fcc6f226eb2..75a4decb31d 100644 --- a/icu4c/source/i18n/affixpatternparser.cpp +++ b/icu4c/source/i18n/affixpatternparser.cpp @@ -22,12 +22,12 @@ #include "uassert.h" #include "unistrappender.h" - static UChar gDefaultSymbols[] = {0xa4, 0xa4, 0xa4}; +static const UChar gDefaultSymbols[] = {0xa4, 0xa4, 0xa4}; -static UChar gPercent = 0x25; -static UChar gPerMill = 0x2030; -static UChar gNegative = 0x2D; -static UChar gPositive = 0x2B; +static const UChar gPercent = 0x25; +static const UChar gPerMill = 0x2030; +static const UChar gNegative = 0x2D; +static const UChar gPositive = 0x2B; #define PACK_TOKEN_AND_LENGTH(t, l) ((UChar) (((t) << 8) | (l & 0xFF))) diff --git a/icu4c/source/i18n/decfmtst.cpp b/icu4c/source/i18n/decfmtst.cpp index 07cdd794c8a..e939ab474ad 100644 --- a/icu4c/source/i18n/decfmtst.cpp +++ b/icu4c/source/i18n/decfmtst.cpp @@ -71,7 +71,7 @@ static const UChar gStrictDashEquivalentsPattern[] = { // [ \ - MINUS ] 0x005B, 0x005C, 0x002D, 0x2212, 0x005D, 0x0000}; -static UChar32 gMinusSigns[] = { +static const UChar32 gMinusSigns[] = { 0x002D, 0x207B, 0x208B, @@ -80,7 +80,7 @@ static UChar32 gMinusSigns[] = { 0xFE63, 0xFF0D}; -static UChar32 gPlusSigns[] = { +static const UChar32 gPlusSigns[] = { 0x002B, 0x207A, 0x208A, diff --git a/icu4c/source/i18n/reldatefmt.cpp b/icu4c/source/i18n/reldatefmt.cpp index 38bfe96284f..45ac5436aaa 100644 --- a/icu4c/source/i18n/reldatefmt.cpp +++ b/icu4c/source/i18n/reldatefmt.cpp @@ -560,7 +560,7 @@ struct RelDateTimeFmtDataSink : public ResourceSink { RelDateTimeFmtDataSink::~RelDateTimeFmtDataSink() {} } // namespace -DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { +static const DateFormatSymbols::DtWidthType styleToDateFormatSymbolWidth[UDAT_STYLE_COUNT] = { DateFormatSymbols::WIDE, DateFormatSymbols::SHORT, DateFormatSymbols::NARROW }; diff --git a/icu4c/source/i18n/rematch.cpp b/icu4c/source/i18n/rematch.cpp index 53c801e40da..d01117f057b 100644 --- a/icu4c/source/i18n/rematch.cpp +++ b/icu4c/source/i18n/rematch.cpp @@ -2200,7 +2200,7 @@ int32_t RegexMatcher::split(UText *input, if (dest[i] == NULL) { dest[i] = utext_openUChars(NULL, NULL, 0, &status); } else { - static UChar emptyString[] = {(UChar)0}; + static const UChar emptyString[] = {(UChar)0}; utext_replace(dest[i], 0, utext_nativeLength(dest[i]), emptyString, 0, &status); } } diff --git a/icu4c/source/i18n/tznames_impl.cpp b/icu4c/source/i18n/tznames_impl.cpp index 1b263186ae0..6817a88af8f 100644 --- a/icu4c/source/i18n/tznames_impl.cpp +++ b/icu4c/source/i18n/tznames_impl.cpp @@ -69,7 +69,7 @@ enum UTimeZoneNameTypeIndex { UTZNM_INDEX_SHORT_DAYLIGHT, UTZNM_INDEX_COUNT }; -static const UChar* EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0}; +static const UChar* const EMPTY_NAMES[UTZNM_INDEX_COUNT] = {0,0,0,0,0,0,0}; U_CDECL_BEGIN static UBool U_CALLCONV tzdbTimeZoneNames_cleanup(void) { -- 2.40.0