[PATCH 4/4] ntdll: Simplify TIME_GetBias

Dmitry Timoshkov dmitry at codeweavers.com
Sun Jul 29 07:59:45 CDT 2007


>From b4e6a608ed1d198bfb7ce3879faa906b9b4b765a Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry at codeweavers.com>
Date: Sun, 29 Jul 2007 21:33:23 +0900
Subject: [PATCH 4/4] 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..a80595a 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;
 }
-- 
1.5.2.3






More information about the wine-patches mailing list