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

Side by Side Diff: Source/wtf/DateMath.cpp

Issue 216313002: Introduce ASSERT_ENABLED macro. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/wtf/BloomFilter.h ('k') | Source/wtf/StringHasher.h » ('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 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * Copyright (C) 2007-2009 Torch Mobile, Inc. 5 * Copyright (C) 2007-2009 Torch Mobile, Inc.
6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net) 6 * Copyright (C) 2010 &yet, LLC. (nate@andyet.net)
7 * 7 *
8 * The Original Code is Mozilla Communicator client code, released 8 * The Original Code is Mozilla Communicator client code, released
9 * March 31, 1998. 9 * March 31, 1998.
10 * 10 *
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 int month = monthFromDayInYear(dayInYearLocal, leapYear); 447 int month = monthFromDayInYear(dayInYearLocal, leapYear);
448 double day = dateToDaysFrom1970(equivalentYear, month, dayInMonth); 448 double day = dateToDaysFrom1970(equivalentYear, month, dayInMonth);
449 ms = (day * msPerDay) + msToMilliseconds(ms); 449 ms = (day * msPerDay) + msToMilliseconds(ms);
450 } 450 }
451 451
452 return calculateDSTOffsetSimple(ms / msPerSecond, utcOffset); 452 return calculateDSTOffsetSimple(ms / msPerSecond, utcOffset);
453 } 453 }
454 454
455 void initializeDates() 455 void initializeDates()
456 { 456 {
457 #if !ASSERT_DISABLED 457 #if ASSERT_ENABLED
458 static bool alreadyInitialized; 458 static bool alreadyInitialized;
459 ASSERT(!alreadyInitialized); 459 ASSERT(!alreadyInitialized);
460 alreadyInitialized = true; 460 alreadyInitialized = true;
461 #endif 461 #endif
462 462
463 equivalentYearForDST(2000); // Need to call once to initialize a static used in this function. 463 equivalentYearForDST(2000); // Need to call once to initialize a static used in this function.
464 } 464 }
465 465
466 static inline double ymdhmsToSeconds(int year, long mon, long day, long hour, lo ng minute, double second) 466 static inline double ymdhmsToSeconds(int year, long mon, long day, long hour, lo ng minute, double second)
467 { 467 {
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 875
876 stringBuilder.append(utcOffset > 0 ? '+' : '-'); 876 stringBuilder.append(utcOffset > 0 ? '+' : '-');
877 int absoluteUTCOffset = abs(utcOffset); 877 int absoluteUTCOffset = abs(utcOffset);
878 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60)); 878 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset / 60));
879 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60)); 879 stringBuilder.append(twoDigitStringFromNumber(absoluteUTCOffset % 60));
880 880
881 return stringBuilder.toString(); 881 return stringBuilder.toString();
882 } 882 }
883 883
884 } // namespace WTF 884 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/BloomFilter.h ('k') | Source/wtf/StringHasher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698