]> granicus.if.org Git - icu/commitdiff
ICU-9474 Reduce the exported C++ static variables too.
authorGeorge Rhoten <grhoten@users.noreply.github.com>
Sun, 12 Aug 2012 00:33:34 +0000 (00:33 +0000)
committerGeorge Rhoten <grhoten@users.noreply.github.com>
Sun, 12 Aug 2012 00:33:34 +0000 (00:33 +0000)
X-SVN-Rev: 32159

icu4c/source/i18n/alphaindex.cpp
icu4c/source/i18n/colldata.cpp
icu4c/source/i18n/ucol.cpp
icu4c/source/i18n/unicode/alphaindex.h
icu4c/source/i18n/unicode/colldata.h

index cf51a03fe4e90135fcba16ee3970064456e0c4ec..2178ee25666a435f8e18bfe8b3eb33c60fc6a8e1 100644 (file)
@@ -63,8 +63,19 @@ alphaIndex_deleteRecord(void *obj) {
 }
 
 
-
+typedef const UChar PinyinLookup[24][3];
 static const Normalizer2 *nfkdNormalizer;
+static UBool indexCharactersAreInitialized = FALSE;
+static UnicodeSet *ALPHABETIC;
+static UnicodeSet *HANGUL;
+static UnicodeSet *ETHIOPIC;
+static UnicodeSet *CORE_LATIN;
+static UnicodeSet *IGNORE_SCRIPTS;
+static UnicodeSet *TO_TRY;
+static UnicodeSet *UNIHAN;
+static const UnicodeString *EMPTY_STRING;
+
 
 //
 //  Append the contents of a UnicodeSet to a UVector of UnicodeStrings.
@@ -605,7 +616,6 @@ void AlphabeticIndex::init(UErrorCode &status) {
 }
 
 
-static  UBool  indexCharactersAreInitialized = FALSE;
 
 //  Index Characters Clean up function.  Delete statically allocated constant stuff.
 U_CDECL_BEGIN
@@ -637,15 +647,6 @@ void AlphabeticIndex::staticCleanup() {
 }
 
 
-UnicodeSet *AlphabeticIndex::ALPHABETIC;
-UnicodeSet *AlphabeticIndex::HANGUL;
-UnicodeSet *AlphabeticIndex::ETHIOPIC;
-UnicodeSet *AlphabeticIndex::CORE_LATIN;
-UnicodeSet *AlphabeticIndex::IGNORE_SCRIPTS;
-UnicodeSet *AlphabeticIndex::TO_TRY;
-UnicodeSet *AlphabeticIndex::UNIHAN;
-const UnicodeString *AlphabeticIndex::EMPTY_STRING;
-
 //
 //  staticInit()    One-time initialization of constants.
 //                  Thread safe.  Called from constructors.
@@ -951,7 +952,7 @@ static const UChar PINYIN_LOWER_BOUNDS_SHORT[] = {      // "\u0101bcd\u0113fghjk
 
 // Pinyin lookup tables copied, pasted (and reformatted) from the ICU4J code.
 
-AlphabeticIndex::PinyinLookup AlphabeticIndex::HACK_PINYIN_LOOKUP_SHORT = {
+static const PinyinLookup HACK_PINYIN_LOOKUP_SHORT = {
         {(UChar)0,      (UChar)0, (UChar)0}, // A 
         {(UChar)0x516B, (UChar)0, (UChar)0}, // B 
         {(UChar)0x5693, (UChar)0, (UChar)0}, // C 
@@ -982,7 +983,7 @@ static const UChar PINYIN_LOWER_BOUNDS_LONG[] = {   // "\u0101bcd\u0113fghjkl\u1
             0x0101, 0x62, 0x63, 0x64, 0x0113, 0x66, 0x67, 0x68, 0x6A, 0x6B, /*l*/0x6C, 0x1E3F, 0x0144, 0x014D,
             /*p*/0x70, 0x71, 0x72, 0x73, 0x74, /*w*/0x77, 0x78, 0x79, 0x7A};
 
-AlphabeticIndex::PinyinLookup AlphabeticIndex::HACK_PINYIN_LOOKUP_LONG = {
+static const PinyinLookup HACK_PINYIN_LOOKUP_LONG = {
         {(UChar)0,      (UChar)0,      (UChar)0}, // A
         {(UChar)0x516B, (UChar)0,      (UChar)0}, // b 
         {(UChar)0xD863, (UChar)0xDEAD, (UChar)0}, // c 
@@ -1022,8 +1023,8 @@ AlphabeticIndex::PinyinLookup AlphabeticIndex::HACK_PINYIN_LOOKUP_LONG = {
 //
 //  This whole arrangement is temporary.
 //
-AlphabeticIndex::PinyinLookup *AlphabeticIndex::HACK_PINYIN_LOOKUP  = NULL;
-const UChar  *AlphabeticIndex::PINYIN_LOWER_BOUNDS = NULL;
+static const PinyinLookup *HACK_PINYIN_LOOKUP  = NULL;
+static const UChar  *PINYIN_LOWER_BOUNDS = NULL;
 
 void AlphabeticIndex::initPinyinBounds(const Collator *col, UErrorCode &status) {
     {
index a488ea07726a8b048f898ee67addd5af6a2fcf98..c03b733d00fd7edc060bf0288305c6520697337d 100644 (file)
@@ -1038,7 +1038,7 @@ void CollData::close(CollData *collData)
     cache->unref(collData);
 }
 
-CollDataCache *CollData::collDataCache = NULL;
+static CollDataCache *collDataCache = NULL;
 
 CollDataCache *CollData::getCollDataCache()
 {
index 882a38737927e4a4f5283597df507645265038d9..c3d05c0cbfc7f40b8b301e1681f8434f48aa4284 100644 (file)
@@ -4272,6 +4272,8 @@ ucol_mergeSortkeys(const uint8_t *src1, int32_t src1Length,
 
 U_NAMESPACE_BEGIN
 
+static uint8_t lastResortByte_ = 0;
+
 class SortKeyByteSink : public ByteSink {
 public:
     static const uint32_t FILL_ORIGINAL_BUFFER = 1;
@@ -4343,8 +4345,6 @@ private:
         capacity_ = 0;
     }
 
-    static uint8_t lastResortByte_;  // last-resort return value from LastByte()
-
     char *ownedBuffer_;
     char *buffer_;
     int32_t capacity_;
@@ -4353,8 +4353,6 @@ private:
     UBool grow_;
 };
 
-uint8_t SortKeyByteSink::lastResortByte_ = 0;
-
 SortKeyByteSink::~SortKeyByteSink() {
     uprv_free(ownedBuffer_);
 }
index 7b7d18c356fd21c00b32dbc98e0d79876827f265..473a241da415f684b7c20c759aee8ca03efe7d5e 100644 (file)
@@ -695,30 +695,8 @@ private:
      ELangType      langType_;        // The language type, simplified Chinese, Traditional Chinese,
                                       //  or not Chinese (Normal).  Part of the Pinyin support
 
-     typedef const UChar PinyinLookup[24][3];
-     static PinyinLookup   HACK_PINYIN_LOOKUP_SHORT;
-     static PinyinLookup   HACK_PINYIN_LOOKUP_LONG;
-     
-     // These will be lazily set to the short or long tables based on which
-     //   Chinese collation has been configured into the ICU library.
-     static PinyinLookup   *HACK_PINYIN_LOOKUP;
-     static const UChar    *PINYIN_LOWER_BOUNDS;
-
-
-
      int32_t    recordCounter_;         // Counts Records created.  For minting record serial numbers.
 
-// Constants.  Lazily initialized the first time an AlphabeticIndex object is created.
-
-     static UnicodeSet *ALPHABETIC;
-     static UnicodeSet *CORE_LATIN;
-     static UnicodeSet *ETHIOPIC;
-     static UnicodeSet *HANGUL;
-     static UnicodeSet *IGNORE_SCRIPTS;
-     static UnicodeSet *TO_TRY;
-     static UnicodeSet *UNIHAN;
-     static const UnicodeString *EMPTY_STRING;
-
 };
 
 U_NAMESPACE_END
index efdb15968c5758fa88393ef7080e0fb4c95c501c..c8e3433bb6f427bb87517f9614e981c89c5978e2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ******************************************************************************
- *   Copyright (C) 1996-2011, International Business Machines                 *
+ *   Copyright (C) 1996-2012, International Business Machines                 *
  *   Corporation and others.  All Rights Reserved.                            *
  ******************************************************************************
  */
@@ -441,8 +441,6 @@ private:
     char keyBuffer[KEY_BUFFER_SIZE];
     char *key;
 
-    static CollDataCache *collDataCache;
-
     uint32_t minHan;
     uint32_t maxHan;