Title: [124560] trunk/Source
Revision
124560
Author
[email protected]
Date
2012-08-02 22:06:38 -0700 (Thu, 02 Aug 2012)

Log Message

Move getLocalTime() as static inline function to DateMath
https://bugs.webkit.org/show_bug.cgi?id=92955

Reviewed by Ryosuke Niwa.

getCurrentLocalTime() and getLocalTime() has been superseded with the
GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
function. This allows us to remove the dependecy on time() and localtime()
for Windows CE, where this functions require the ce_time library to work.

Source/_javascript_Core:

* _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def:

Source/WTF:

* wtf/CurrentTime.cpp:
(WTF):
* wtf/CurrentTime.h:
* wtf/DateMath.cpp:
(WTF):
(WTF::getLocalTime):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (124559 => 124560)


--- trunk/Source/_javascript_Core/ChangeLog	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-08-03 05:06:38 UTC (rev 124560)
@@ -1,3 +1,17 @@
+2012-08-02  Patrick Gansterer  <[email protected]>
+
+        Move getLocalTime() as static inline function to DateMath
+        https://bugs.webkit.org/show_bug.cgi?id=92955
+
+        Reviewed by Ryosuke Niwa.
+
+        getCurrentLocalTime() and getLocalTime() has been superseded with the
+        GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
+        function. This allows us to remove the dependecy on time() and localtime()
+        for Windows CE, where this functions require the ce_time library to work.
+
+        * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def:
+
 2012-08-02  Filip Pizlo  <[email protected]>
 
         ASSERTION FAILED: at(m_compileIndex).canExit() || m_isCheckingArgumentTypes

Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def (124559 => 124560)


--- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def	2012-08-03 05:06:38 UTC (rev 124560)
@@ -201,7 +201,6 @@
     ?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z
     ?getCallableObjectSlow@JSC@@YAPAVJSCell@1@PAV21@@Z
     ?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
-    ?getCurrentLocalTime@WTF@@YAXPAUtm@@@Z
     ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
     ?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@VPropertyName@2@AAVPropertyDescriptor@2@@Z
     ?getOwnPropertyDescriptor@JSObject@JSC@@SA_NPAV12@PAVExecState@2@VPropertyName@2@AAVPropertyDescriptor@2@@Z

Modified: trunk/Source/WTF/ChangeLog (124559 => 124560)


--- trunk/Source/WTF/ChangeLog	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/WTF/ChangeLog	2012-08-03 05:06:38 UTC (rev 124560)
@@ -1,5 +1,24 @@
 2012-08-02  Patrick Gansterer  <[email protected]>
 
+        Move getLocalTime() as static inline function to DateMath
+        https://bugs.webkit.org/show_bug.cgi?id=92955
+
+        Reviewed by Ryosuke Niwa.
+
+        getCurrentLocalTime() and getLocalTime() has been superseded with the
+        GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
+        function. This allows us to remove the dependecy on time() and localtime()
+        for Windows CE, where this functions require the ce_time library to work.
+
+        * wtf/CurrentTime.cpp:
+        (WTF):
+        * wtf/CurrentTime.h:
+        * wtf/DateMath.cpp:
+        (WTF):
+        (WTF::getLocalTime):
+
+2012-08-02  Patrick Gansterer  <[email protected]>
+
         [WINCE] Return 0 at calculateDSTOffset(double, double)
         https://bugs.webkit.org/show_bug.cgi?id=92953
 

Modified: trunk/Source/WTF/wtf/CurrentTime.cpp (124559 => 124560)


--- trunk/Source/WTF/wtf/CurrentTime.cpp	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/WTF/wtf/CurrentTime.cpp	2012-08-03 05:06:38 UTC (rev 124560)
@@ -335,21 +335,4 @@
 
 #endif // !PLATFORM(CHROMIUM)
 
-void getLocalTime(const time_t* localTime, struct tm* localTM)
-{
-#if COMPILER(MSVC7_OR_LOWER) || COMPILER(MINGW) || OS(WINCE)
-    *localTM = *localtime(localTime);
-#elif COMPILER(MSVC)
-    localtime_s(localTM, localTime);
-#else
-    localtime_r(localTime, localTM);
-#endif
-}
-
-void getCurrentLocalTime(struct tm* localTM)
-{
-    time_t localTime = time(0);
-    getLocalTime(&localTime, localTM);
-}
-
 } // namespace WTF

Modified: trunk/Source/WTF/wtf/CurrentTime.h (124559 => 124560)


--- trunk/Source/WTF/wtf/CurrentTime.h	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/WTF/wtf/CurrentTime.h	2012-08-03 05:06:38 UTC (rev 124560)
@@ -47,9 +47,6 @@
     return currentTime() * 1000.0;
 }
 
-WTF_EXPORT_PRIVATE void getLocalTime(const time_t* localTime, struct tm* localTM);
-WTF_EXPORT_PRIVATE void getCurrentLocalTime(struct tm* localTM);
-
 // Provides a monotonically increasing time in seconds since an arbitrary point in the past.
 // On unsupported platforms, this function only guarantees the result will be non-decreasing.
 WTF_EXPORT_PRIVATE double monotonicallyIncreasingTime();
@@ -58,8 +55,6 @@
 
 using WTF::currentTime;
 using WTF::currentTimeMS;
-using WTF::getCurrentLocalTime;
-using WTF::getLocalTime;
 using WTF::monotonicallyIncreasingTime;
 
 #endif // CurrentTime_h

Modified: trunk/Source/WTF/wtf/DateMath.cpp (124559 => 124560)


--- trunk/Source/WTF/wtf/DateMath.cpp	2012-08-03 04:42:15 UTC (rev 124559)
+++ trunk/Source/WTF/wtf/DateMath.cpp	2012-08-03 05:06:38 UTC (rev 124560)
@@ -127,6 +127,19 @@
     {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}
 };
 
+#if !OS(WINCE)
+static inline void getLocalTime(const time_t* localTime, struct tm* localTM)
+{
+#if COMPILER(MSVC7_OR_LOWER) || COMPILER(MINGW)
+    *localTM = *localtime(localTime);
+#elif COMPILER(MSVC)
+    localtime_s(localTM, localTime);
+#else
+    localtime_r(localTime, localTM);
+#endif
+}
+#endif
+
 bool isLeapYear(int year)
 {
     if (year % 4 != 0)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to