Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f66af599
Commit
f66af599
authored
Feb 25, 2004
by
Huw Davies
Committed by
Alexandre Julliard
Feb 25, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up RtlTimeFieldsToTime.
parent
9f9462a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
time.c
dlls/ntdll/time.c
+13
-6
No files found.
dlls/ntdll/time.c
View file @
f66af599
...
...
@@ -284,7 +284,6 @@ static const struct tagTZ_INFO TZ_INFO[] =
#define TICKS_1601_TO_1980 (SECS_1601_TO_1980 * TICKSPERSEC)
static
const
int
YearLengths
[
2
]
=
{
DAYSPERNORMALYEAR
,
DAYSPERLEAPYEAR
};
static
const
int
MonthLengths
[
2
][
MONSPERYEAR
]
=
{
{
31
,
28
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
},
...
...
@@ -421,7 +420,7 @@ BOOLEAN WINAPI RtlTimeFieldsToTime(
PTIME_FIELDS
tfTimeFields
,
PLARGE_INTEGER
Time
)
{
int
CurYear
,
CurMonth
;
int
CurYear
,
CurMonth
,
DeltaYear
;
LONGLONG
rcTime
;
TIME_FIELDS
TimeFields
=
*
tfTimeFields
;
...
...
@@ -445,9 +444,18 @@ BOOLEAN WINAPI RtlTimeFieldsToTime(
}
/* FIXME: handle calendar corrections here */
for
(
CurYear
=
EPOCHYEAR
;
CurYear
<
TimeFields
.
Year
;
CurYear
++
)
{
rcTime
+=
YearLengths
[
IsLeapYear
(
CurYear
)];
}
CurYear
=
TimeFields
.
Year
-
EPOCHYEAR
;
DeltaYear
=
CurYear
/
400
;
CurYear
-=
DeltaYear
*
400
;
rcTime
+=
DeltaYear
*
DAYSPERQUADRICENTENNIUM
;
DeltaYear
=
CurYear
/
100
;
CurYear
-=
DeltaYear
*
100
;
rcTime
+=
DeltaYear
*
DAYSPERNORMALCENTURY
;
DeltaYear
=
CurYear
/
4
;
CurYear
-=
DeltaYear
*
4
;
rcTime
+=
DeltaYear
*
DAYSPERNORMALQUADRENNIUM
;
rcTime
+=
CurYear
*
DAYSPERNORMALYEAR
;
for
(
CurMonth
=
1
;
CurMonth
<
TimeFields
.
Month
;
CurMonth
++
)
{
rcTime
+=
MonthLengths
[
IsLeapYear
(
CurYear
)][
CurMonth
-
1
];
}
...
...
@@ -460,7 +468,6 @@ BOOLEAN WINAPI RtlTimeFieldsToTime(
return
TRUE
;
}
/************ end of code by Rex Jolliff (rex@lvcablemodem.com) ***************/
/******************************************************************************
* RtlLocalTimeToSystemTime [NTDLL.@]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment