]> granicus.if.org Git - icu/commitdiff
ICU-9633 Adjust to UDisplayContext[Type] updates
authorPeter Edberg <pedberg@unicode.org>
Tue, 9 Oct 2012 03:48:24 +0000 (03:48 +0000)
committerPeter Edberg <pedberg@unicode.org>
Tue, 9 Oct 2012 03:48:24 +0000 (03:48 +0000)
X-SVN-Rev: 32570

icu4c/source/i18n/smpdtfmt.cpp

index 3be94fff6a53b2aba3dc59527d8143311249bd64..fa5dc42cfbc724cc5e2a576febcd754af207256e 100644 (file)
@@ -3113,7 +3113,7 @@ void SimpleDateFormat::setContext(UDisplayContext value, UErrorCode& status)
 {
     if (U_FAILURE(status))
         return;
-    if ( (UDisplayContextType)(value & ~0xFF) == UDISPCTX_TYPE_CAPITALIZATION ) {
+    if ( (UDisplayContextType)((uint32_t)value >> 8) == UDISPCTX_TYPE_CAPITALIZATION ) {
         fCapitalizationContext = value;
     } else {
         status = U_ILLEGAL_ARGUMENT_ERROR;