]> granicus.if.org Git - icu/commitdiff
ICU-13029 Mark unmodified static data as const
authorGeorge Rhoten <grhoten@users.noreply.github.com>
Wed, 19 Apr 2017 18:55:46 +0000 (18:55 +0000)
committerGeorge Rhoten <grhoten@users.noreply.github.com>
Wed, 19 Apr 2017 18:55:46 +0000 (18:55 +0000)
X-SVN-Rev: 40065

icu4c/source/common/listformatter.cpp
icu4c/source/common/loclikely.cpp
icu4c/source/common/unifiedcache.cpp
icu4c/source/i18n/affixpatternparser.cpp
icu4c/source/i18n/decfmtst.cpp
icu4c/source/i18n/reldatefmt.cpp
icu4c/source/i18n/rematch.cpp
icu4c/source/i18n/tznames_impl.cpp

index d105654755fd1e5a96fa7c157270baeb71ec7402..33a8ac28671fc66158383d3106fbe6e4e7fdad7b 100644 (file)
@@ -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() {
index cdd6f78cf7b41d8552d5a2b35512c0592fd3a93e..60192a3fd31b638b2e6492e498e1ff16d947447c 100644 (file)
@@ -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().
index fd2d107a6c8d397cc3f6a8644fe99c46d378bdcd..d0238825d1190e77a276e45d7ff87f322a8ec004 100644 (file)
@@ -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
index fcc6f226eb2f5a65a42e31ec53c8aa4fda5f7215..75a4decb31dee7ec3463352a736151a13f982002 100644 (file)
 #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)))
 
index 07cdd794c8ac2a520ca8f10efcc8afb14a433bbf..e939ab474ade37ce79ed36b68164a748bcc76350 100644 (file)
@@ -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,
index 38bfe96284f4da76f344b762205626817b0ee32b..45ac5436aaa1423eb67c9692fa5a4941084ec120 100644 (file)
@@ -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
 };
 
index 53c801e40da179bface6669e084f64bfffbac6d9..d01117f057b1016dc687901593a27f08082cf866 100644 (file)
@@ -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);
                     }
                 }
index 1b263186ae06076da0a648ea9f8639a478a47d8c..6817a88af8f06b359732edc6ba242cdaeee8ac6c 100644 (file)
@@ -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) {