]> granicus.if.org Git - icu/commitdiff
ICU-13192 gCorrectedPOSIXLocaleis changed to const char*
authorJungshik Shin <jshin@chromium.org>
Mon, 23 Oct 2017 23:01:58 +0000 (23:01 +0000)
committerJungshik Shin <jshin@chromium.org>
Mon, 23 Oct 2017 23:01:58 +0000 (23:01 +0000)
X-SVN-Rev: 40627

icu4c/source/common/putil.cpp
icu4c/source/i18n/csdetect.cpp
icu4c/source/i18n/csrucode.cpp
icu4c/source/i18n/csrucode.h

index f15f7c41deffd22e0e577f4f312e887fe437daff..ca93f64e8fb475b1ba86e4363f7095be71230da7 100644 (file)
@@ -1235,7 +1235,7 @@ UInitOnce gTimeZoneFilesInitOnce = U_INITONCE_INITIALIZER;
 static CharString *gTimeZoneFilesDirectory = NULL;
 
 #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API
- static char *gCorrectedPOSIXLocale = NULL; /* Sometimes heap allocated */
+ static const char *gCorrectedPOSIXLocale = NULL; /* Sometimes heap allocated */
  static bool gCorrectedPOSIXLocaleHeapAllocated = false;
 #endif
 
@@ -1258,7 +1258,7 @@ static UBool U_CALLCONV putil_cleanup(void)
 
 #if U_POSIX_LOCALE || U_PLATFORM_USES_ONLY_WIN32_API
     if (gCorrectedPOSIXLocale && gCorrectedPOSIXLocaleHeapAllocated) {
-        uprv_free(gCorrectedPOSIXLocale);
+        uprv_free(const_cast<char *>(gCorrectedPOSIXLocale));
         gCorrectedPOSIXLocale = NULL;
         gCorrectedPOSIXLocaleHeapAllocated = false;
     }
index 36552c4b76227caac4286a450cf5c54739c5e222..079dc6da8c60bb1f47547469ad80e992f46fe779 100644 (file)
@@ -87,10 +87,14 @@ static void U_CALLCONV initRecognizers(UErrorCode &status) {
     CSRecognizerInfo *tempArray[] = {
         new CSRecognizerInfo(new CharsetRecog_UTF8(), TRUE),
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
         new CSRecognizerInfo(new CharsetRecog_UTF_16_BE(), TRUE),
+#endif
         new CSRecognizerInfo(new CharsetRecog_UTF_16_LE(), TRUE),
+#if !UCONFIG_ONLY_HTML_CONVERSION
         new CSRecognizerInfo(new CharsetRecog_UTF_32_BE(), TRUE),
         new CSRecognizerInfo(new CharsetRecog_UTF_32_LE(), TRUE),
+#endif
 
         new CSRecognizerInfo(new CharsetRecog_8859_1(), TRUE),
         new CSRecognizerInfo(new CharsetRecog_8859_2(), TRUE),
index 59f2dbe284c0f5f27021e54b4fd6e56d64335320..27384163b56090fb95fb161134eb31abdaddd224 100644 (file)
@@ -21,6 +21,7 @@ CharsetRecog_Unicode::~CharsetRecog_Unicode()
     // nothing to do
 }
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
 CharsetRecog_UTF_16_BE::~CharsetRecog_UTF_16_BE()
 {
     // nothing to do
@@ -30,6 +31,7 @@ const char *CharsetRecog_UTF_16_BE::getName() const
 {
     return "UTF-16BE";
 }
+#endif
 
 // UTF-16 confidence calculation. Very simple minded, but better than nothing.
 //   Any 8 bit non-control characters bump the confidence up. These have a zero high byte,
@@ -52,6 +54,7 @@ static int32_t adjustConfidence(UChar codeUnit, int32_t confidence) {
 }
 
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
 UBool CharsetRecog_UTF_16_BE::match(InputText* textIn, CharsetMatch *results) const
 {
     const uint8_t *input = textIn->fRawInput;
@@ -76,6 +79,7 @@ UBool CharsetRecog_UTF_16_BE::match(InputText* textIn, CharsetMatch *results) co
     results->set(textIn, this, confidence);
     return (confidence > 0);
 }
+#endif
 
 CharsetRecog_UTF_16_LE::~CharsetRecog_UTF_16_LE()
 {
@@ -115,6 +119,7 @@ UBool CharsetRecog_UTF_16_LE::match(InputText* textIn, CharsetMatch *results) co
     return (confidence > 0);
 }
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
 CharsetRecog_UTF_32::~CharsetRecog_UTF_32()
 {
     // nothing to do
@@ -194,6 +199,7 @@ int32_t CharsetRecog_UTF_32_LE::getChar(const uint8_t *input, int32_t index) con
     return input[index + 3] << 24 | input[index + 2] << 16 |
            input[index + 1] <<  8 | input[index + 0];
 }
+#endif
 
 U_NAMESPACE_END
 #endif
index cef35447fb750b5d1b5d63f9059c50f195e6ae5c..4d67e6042cc640ef90afc6a6037d5392d64a8481 100644 (file)
@@ -42,6 +42,7 @@ public:
 };
 
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
 class CharsetRecog_UTF_16_BE : public CharsetRecog_Unicode
 {
 public:
@@ -52,6 +53,7 @@ public:
 
     UBool match(InputText* textIn, CharsetMatch *results) const;
 };
+#endif
 
 class CharsetRecog_UTF_16_LE : public CharsetRecog_Unicode
 {
@@ -64,6 +66,7 @@ public:
     UBool match(InputText* textIn, CharsetMatch *results) const;
 };
 
+#if !UCONFIG_ONLY_HTML_CONVERSION
 class CharsetRecog_UTF_32 : public CharsetRecog_Unicode
 {
 protected:
@@ -101,6 +104,7 @@ public:
 
     const char* getName() const;
 };
+#endif
 
 U_NAMESPACE_END