Index: third_party/icu/source/i18n/calendar.cpp |
=================================================================== |
--- third_party/icu/source/i18n/calendar.cpp (revision 74230) |
+++ third_party/icu/source/i18n/calendar.cpp (working copy) |
@@ -24,7 +24,6 @@ |
******************************************************************************* |
*/ |
-#include <typeinfo> // for 'typeid' to work |
#include "unicode/utypes.h" |
@@ -373,7 +372,7 @@ |
virtual UObject* create(const ICUServiceKey& key, const ICUService* /*service*/, UErrorCode& status) const { |
#ifdef U_DEBUG_CALSVC |
- if(dynamic_cast<const LocaleKey*>(&key) == NULL) { |
+ if(CR_DYNAMIC_CAST<const LocaleKey*>(&key) == NULL) { |
fprintf(stderr, "::create - not a LocaleKey!\n"); |
} |
#endif |
@@ -444,7 +443,7 @@ |
} |
virtual UObject* cloneInstance(UObject* instance) const { |
- UnicodeString *s = dynamic_cast<UnicodeString *>(instance); |
+ UnicodeString *s = CR_DYNAMIC_CAST<UnicodeString *>(instance); |
if(s != NULL) { |
return s->clone(); |
} else { |
@@ -814,7 +813,7 @@ |
} |
#if !UCONFIG_NO_SERVICE |
- const UnicodeString* str = dynamic_cast<const UnicodeString*>(u); |
+ const UnicodeString* str = CR_DYNAMIC_CAST<const UnicodeString*>(u); |
if(str != NULL) { |
// It's a unicode string telling us what type of calendar to load ("gregorian", etc) |
// Create a Locale over this string |
@@ -842,12 +841,12 @@ |
return NULL; |
} |
- str = dynamic_cast<const UnicodeString*>(c); |
- if(str != NULL) { |
- // recursed! Second lookup returned a UnicodeString. |
+ if (c->getDynamicClassID() == UnicodeString::getStaticClassID()) { |
+ // recursed! Second lookup returned a UnicodeString. |
// Perhaps DefaultCalendar{} was set to another locale. |
#ifdef U_DEBUG_CALSVC |
char tmp[200]; |
+ const UnicodeString* str = (const UnicodeString*) c; |
// Extract a char* out of it.. |
int32_t len = str->length(); |
int32_t actLen = sizeof(tmp)-1; |
@@ -909,7 +908,7 @@ |
UBool |
Calendar::isEquivalentTo(const Calendar& other) const |
{ |
- return typeid(*this) == typeid(other) && |
+ return CR_TYPEID(*this) == CR_TYPEID(other) && |
fLenient == other.fLenient && |
fFirstDayOfWeek == other.fFirstDayOfWeek && |
fMinimalDaysInFirstWeek == other.fMinimalDaysInFirstWeek && |