]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/reldtfmt.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / i18n / reldtfmt.cpp
index 839198b3859c125d9764a6bde9137686e3549a56..c8ffd0464607044d2e576e58b8343f8b973f281a 100644 (file)
@@ -51,7 +51,7 @@ RelativeDateFormat::RelativeDateFormat(const RelativeDateFormat& other) :
  fCapitalizationBrkIter(NULL)
 {
     if(other.fDateTimeFormatter != NULL) {
-        fDateTimeFormatter = (SimpleDateFormat*)other.fDateTimeFormatter->clone();
+        fDateTimeFormatter = other.fDateTimeFormatter->clone();
     }
     if(other.fCombinedFormat != NULL) {
         fCombinedFormat = new SimpleFormatter(*other.fCombinedFormat);
@@ -131,7 +131,7 @@ RelativeDateFormat::~RelativeDateFormat() {
 }
 
 
-Format* RelativeDateFormat::clone(void) const {
+RelativeDateFormat* RelativeDateFormat::clone() const {
     return new RelativeDateFormat(*this);
 }
 
@@ -430,7 +430,7 @@ RelativeDateFormat::setContext(UDisplayContext value, UErrorCode& status)
         if ( fCapitalizationBrkIter == NULL && (value==UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE ||
                 (value==UDISPCTX_CAPITALIZATION_FOR_UI_LIST_OR_MENU && fCapitalizationOfRelativeUnitsForUIListMenu) ||
                 (value==UDISPCTX_CAPITALIZATION_FOR_STANDALONE && fCapitalizationOfRelativeUnitsForStandAlone)) ) {
-            UErrorCode status = U_ZERO_ERROR;
+            status = U_ZERO_ERROR;
             fCapitalizationBrkIter = BreakIterator::createSentenceInstance(fLocale, status);
             if (U_FAILURE(status)) {
                 delete fCapitalizationBrkIter;
@@ -456,8 +456,8 @@ RelativeDateFormat::initCapitalizationContextInfo(const Locale& thelocale)
         const int32_t * intVector = ures_getIntVector(rb.getAlias(),
                                                       &len, &status);
         if (U_SUCCESS(status) && intVector != NULL && len >= 2) {
-            fCapitalizationOfRelativeUnitsForUIListMenu = intVector[0];
-            fCapitalizationOfRelativeUnitsForStandAlone = intVector[1];
+            fCapitalizationOfRelativeUnitsForUIListMenu = static_cast<UBool>(intVector[0]);
+            fCapitalizationOfRelativeUnitsForStandAlone = static_cast<UBool>(intVector[1]);
         }
     }
 #endif