Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(936)

Side by Side Diff: third_party/icu/source/i18n/olsontz.cpp

Issue 6520018: Get ICU 4.6 to be compiled without RTTI.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: do not include typeinfo at all Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/icu/source/i18n/numfmt.cpp ('k') | third_party/icu/source/i18n/rbnf.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ********************************************************************** 2 **********************************************************************
3 * Copyright (c) 2003-2010, International Business Machines 3 * Copyright (c) 2003-2010, International Business Machines
4 * Corporation and others. All Rights Reserved. 4 * Corporation and others. All Rights Reserved.
5 ********************************************************************** 5 **********************************************************************
6 * Author: Alan Liu 6 * Author: Alan Liu
7 * Created: July 21 2003 7 * Created: July 21 2003
8 * Since: ICU 2.8 8 * Since: ICU 2.8
9 ********************************************************************** 9 **********************************************************************
10 */ 10 */
11 11
12 #include <typeinfo> // for 'typeid' to work
13 12
14 #include "olsontz.h" 13 #include "olsontz.h"
15 14
16 #if !UCONFIG_NO_FORMATTING 15 #if !UCONFIG_NO_FORMATTING
17 16
18 #include "unicode/ures.h" 17 #include "unicode/ures.h"
19 #include "unicode/simpletz.h" 18 #include "unicode/simpletz.h"
20 #include "unicode/gregocal.h" 19 #include "unicode/gregocal.h"
21 #include "gregoimp.h" 20 #include "gregoimp.h"
22 #include "cmemory.h" 21 #include "cmemory.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 OlsonTimeZone::~OlsonTimeZone() { 293 OlsonTimeZone::~OlsonTimeZone() {
295 deleteTransitionRules(); 294 deleteTransitionRules();
296 delete finalZone; 295 delete finalZone;
297 } 296 }
298 297
299 /** 298 /**
300 * Returns true if the two TimeZone objects are equal. 299 * Returns true if the two TimeZone objects are equal.
301 */ 300 */
302 UBool OlsonTimeZone::operator==(const TimeZone& other) const { 301 UBool OlsonTimeZone::operator==(const TimeZone& other) const {
303 return ((this == &other) || 302 return ((this == &other) ||
304 (typeid(*this) == typeid(other) && 303 (CR_TYPEID(*this) == CR_TYPEID(other) &&
305 TimeZone::operator==(other) && 304 TimeZone::operator==(other) &&
306 hasSameRules(other))); 305 hasSameRules(other)));
307 } 306 }
308 307
309 /** 308 /**
310 * TimeZone API. 309 * TimeZone API.
311 */ 310 */
312 TimeZone* OlsonTimeZone::clone() const { 311 TimeZone* OlsonTimeZone::clone() const {
313 return new OlsonTimeZone(*this); 312 return new OlsonTimeZone(*this);
314 } 313 }
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 int32_t raw, dst; 586 int32_t raw, dst;
588 getOffset(date, FALSE, raw, dst, ec); 587 getOffset(date, FALSE, raw, dst, ec);
589 return dst != 0; 588 return dst != 0;
590 } 589 }
591 590
592 UBool 591 UBool
593 OlsonTimeZone::hasSameRules(const TimeZone &other) const { 592 OlsonTimeZone::hasSameRules(const TimeZone &other) const {
594 if (this == &other) { 593 if (this == &other) {
595 return TRUE; 594 return TRUE;
596 } 595 }
597 const OlsonTimeZone* z = dynamic_cast<const OlsonTimeZone*>(&other); 596 const OlsonTimeZone* z = CR_DYNAMIC_CAST<const OlsonTimeZone*>(&other);
598 if (z == NULL) { 597 if (z == NULL) {
599 return FALSE; 598 return FALSE;
600 } 599 }
601 600
602 // [sic] pointer comparison: typeMapData points into 601 // [sic] pointer comparison: typeMapData points into
603 // memory-mapped or DLL space, so if two zones have the same 602 // memory-mapped or DLL space, so if two zones have the same
604 // pointer, they are equal. 603 // pointer, they are equal.
605 if (typeMapData == z->typeMapData) { 604 if (typeMapData == z->typeMapData) {
606 return TRUE; 605 return TRUE;
607 } 606 }
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } 1046 }
1048 // Set the result length 1047 // Set the result length
1049 trscount = cnt; 1048 trscount = cnt;
1050 } 1049 }
1051 1050
1052 U_NAMESPACE_END 1051 U_NAMESPACE_END
1053 1052
1054 #endif // !UCONFIG_NO_FORMATTING 1053 #endif // !UCONFIG_NO_FORMATTING
1055 1054
1056 //eof 1055 //eof
OLDNEW
« no previous file with comments | « third_party/icu/source/i18n/numfmt.cpp ('k') | third_party/icu/source/i18n/rbnf.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698