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

Side by Side Diff: third_party/WebKit/Source/wtf/DateMath.h

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/wtf/DataLog.cpp ('k') | third_party/WebKit/Source/wtf/DateMath.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 * 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) 2010 Research In Motion Limited. All rights reserved. 5 * Copyright (C) 2010 Research In Motion Limited. All rights reserved.
6 * 6 *
7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
8 * 8 *
9 * The contents of this file are subject to the Mozilla Public License Version 9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with 10 * 1.1 (the "License"); you may not use this file except in compliance with
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 namespace WTF { 51 namespace WTF {
52 52
53 WTF_EXPORT void initializeDates(); 53 WTF_EXPORT void initializeDates();
54 54
55 // Not really math related, but this is currently the only shared place to put t hese. 55 // Not really math related, but this is currently the only shared place to put t hese.
56 WTF_EXPORT double parseDateFromNullTerminatedCharacters(const char* dateString); 56 WTF_EXPORT double parseDateFromNullTerminatedCharacters(const char* dateString);
57 // dayOfWeek: [0, 6] 0 being Monday, day: [1, 31], month: [0, 11], year: ex: 201 1, hours: [0, 23], minutes: [0, 59], seconds: [0, 59], utcOffset: [-720,720]. 57 // dayOfWeek: [0, 6] 0 being Monday, day: [1, 31], month: [0, 11], year: ex: 201 1, hours: [0, 23], minutes: [0, 59], seconds: [0, 59], utcOffset: [-720,720].
58 WTF_EXPORT String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsign ed month, unsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset); 58 WTF_EXPORT String makeRFC2822DateString(unsigned dayOfWeek, unsigned day, unsign ed month, unsigned year, unsigned hours, unsigned minutes, unsigned seconds, int utcOffset);
59 59
60 const char weekdayName[7][4] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; 60 const char weekdayName[7][4] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"} ;
61 const char monthName[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 61 const char monthName[12][4] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
62 const char* const monthFullName[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; 62 const char* const monthFullName[12] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} ;
63 63
64 const double minutesPerHour = 60.0; 64 const double minutesPerHour = 60.0;
65 const double secondsPerMinute = 60.0; 65 const double secondsPerMinute = 60.0;
66 const double msPerSecond = 1000.0; 66 const double msPerSecond = 1000.0;
67 const double msPerMinute = 60.0 * 1000.0; 67 const double msPerMinute = 60.0 * 1000.0;
68 const double msPerHour = 60.0 * 60.0 * 1000.0; 68 const double msPerHour = 60.0 * 60.0 * 1000.0;
69 const double msPerDay = 24.0 * 60.0 * 60.0 * 1000.0; 69 const double msPerDay = 24.0 * 60.0 * 60.0 * 1000.0;
70 70
71 WTF_EXPORT bool isLeapYear(int year); 71 WTF_EXPORT bool isLeapYear(int year);
72 72
73 // Returns the number of days from 1970-01-01 to the specified date. 73 // Returns the number of days from 1970-01-01 to the specified date.
74 WTF_EXPORT double dateToDaysFrom1970(int year, int month, int day); 74 WTF_EXPORT double dateToDaysFrom1970(int year, int month, int day);
75 WTF_EXPORT int msToYear(double ms); 75 WTF_EXPORT int msToYear(double ms);
76 WTF_EXPORT int dayInYear(int year, int month, int day); 76 WTF_EXPORT int dayInYear(int year, int month, int day);
77 WTF_EXPORT int dayInYear(double ms, int year); 77 WTF_EXPORT int dayInYear(double ms, int year);
78 WTF_EXPORT int monthFromDayInYear(int dayInYear, bool leapYear); 78 WTF_EXPORT int monthFromDayInYear(int dayInYear, bool leapYear);
79 WTF_EXPORT int dayInMonthFromDayInYear(int dayInYear, bool leapYear); 79 WTF_EXPORT int dayInMonthFromDayInYear(int dayInYear, bool leapYear);
80 80
81 // Returns milliseconds with UTC and DST. 81 // Returns milliseconds with UTC and DST.
82 WTF_EXPORT double convertToLocalTime(double ms); 82 WTF_EXPORT double convertToLocalTime(double ms);
83 83
84 } // namespace WTF 84 } // namespace WTF
85 85
86 using WTF::isLeapYear; 86 using WTF::isLeapYear;
87 using WTF::dateToDaysFrom1970; 87 using WTF::dateToDaysFrom1970;
88 using WTF::dayInMonthFromDayInYear; 88 using WTF::dayInMonthFromDayInYear;
89 using WTF::dayInYear; 89 using WTF::dayInYear;
90 using WTF::minutesPerHour; 90 using WTF::minutesPerHour;
91 using WTF::monthFromDayInYear; 91 using WTF::monthFromDayInYear;
92 using WTF::msPerDay; 92 using WTF::msPerDay;
93 using WTF::msPerHour; 93 using WTF::msPerHour;
94 using WTF::msPerMinute; 94 using WTF::msPerMinute;
95 using WTF::msPerSecond; 95 using WTF::msPerSecond;
96 using WTF::msToYear; 96 using WTF::msToYear;
97 using WTF::secondsPerMinute; 97 using WTF::secondsPerMinute;
98 using WTF::parseDateFromNullTerminatedCharacters; 98 using WTF::parseDateFromNullTerminatedCharacters;
99 using WTF::makeRFC2822DateString; 99 using WTF::makeRFC2822DateString;
100 using WTF::convertToLocalTime; 100 using WTF::convertToLocalTime;
101 101
102 #endif // DateMath_h 102 #endif // DateMath_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/DataLog.cpp ('k') | third_party/WebKit/Source/wtf/DateMath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698