Dmitry Timoshkov : ntdll: Simplify TIME_GetBias.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 30 08:55:46 CDT 2007


Module: wine
Branch: master
Commit: 6119f4990d52dad826db4095bdcad6ffb3880778
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6119f4990d52dad826db4095bdcad6ffb3880778

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Sun Jul 29 21:33:23 2007 +0900

ntdll: Simplify TIME_GetBias.

---

 dlls/ntdll/time.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c
index b49d80c..497087c 100644
--- a/dlls/ntdll/time.c
+++ b/dlls/ntdll/time.c
@@ -607,20 +607,19 @@ static int TIME_GetBias(time_t utc, int *pdaylight)
     int ret;
 
     RtlEnterCriticalSection( &TIME_GetBias_section );
-    if(utc == last_utc)
-    {
-        *pdaylight = last_daylight;
-        ret = last_bias;	
-    } else
+    if (utc != last_utc)
     {
         ptm = localtime(&utc);
-	*pdaylight = last_daylight =
-            ptm->tm_isdst; /* daylight for local timezone */
+	last_daylight = ptm->tm_isdst; /* daylight for local timezone */
 	ptm = gmtime(&utc);
-	ptm->tm_isdst = *pdaylight; /* use local daylight, not that of Greenwich */
+	ptm->tm_isdst = last_daylight; /* use local daylight, not that of Greenwich */
 	last_utc = utc;
-	ret = last_bias = (int)(utc-mktime(ptm));
+	last_bias = (int)(utc - mktime(ptm));
     }
+
+    *pdaylight = last_daylight;
+    ret = last_bias;
+
     RtlLeaveCriticalSection( &TIME_GetBias_section );
     return ret;
 }




More information about the wine-cvs mailing list