Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
07dcd91b
Commit
07dcd91b
authored
18 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
This is probobly the worst place to shadow time() with a variable.
parent
1e829c5a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xpdev/datewrap.c
+14
-14
14 additions, 14 deletions
src/xpdev/datewrap.c
with
14 additions
and
14 deletions
src/xpdev/datewrap.c
+
14
−
14
View file @
07dcd91b
...
...
@@ -135,17 +135,17 @@ time_t xpDateTime_to_time(xpDateTime_t xpDateTime)
}
xpDateTime_t
time_to_xpDateTime
(
time_t
ti
me
)
xpDateTime_t
time_to_xpDateTime
(
time_t
ti
)
{
xpDateTime_t
never
;
struct
tm
tm
;
memset
(
&
never
,
0
,
sizeof
(
never
));
if
(
ti
me
==
0
)
if
(
ti
==
0
)
return
(
never
);
ZERO_VAR
(
tm
);
if
(
gmtime_r
(
&
ti
me
,
&
tm
)
==
NULL
)
if
(
gmtime_r
(
&
ti
,
&
tm
)
==
NULL
)
return
(
never
);
return
xpDateTime_create
(
1900
+
tm
.
tm_year
,
1
+
tm
.
tm_mon
,
tm
.
tm_mday
...
...
@@ -170,24 +170,24 @@ isoDate_t xpDateTime_to_isoDateTime(xpDateTime_t xpDateTime, isoTime_t* isoTime)
return
isoDate_create
(
xpDateTime
.
date
.
year
,
xpDateTime
.
date
.
month
,
xpDateTime
.
date
.
day
);
}
xpDateTime_t
isoDateTime_to_xpDateTime
(
isoDate_t
date
,
isoTime_t
ti
me
)
xpDateTime_t
isoDateTime_to_xpDateTime
(
isoDate_t
date
,
isoTime_t
ti
)
{
return
xpDateTime_create
(
isoDate_year
(
date
),
isoDate_month
(
date
),
isoDate_day
(
date
)
,
isoTime_hour
(
ti
me
),
isoTime_minute
(
ti
me
),(
float
)
isoTime_second
(
ti
me
),
xpTimeZone_local
());
,
isoTime_hour
(
ti
),
isoTime_minute
(
ti
),(
float
)
isoTime_second
(
ti
),
xpTimeZone_local
());
}
isoDate_t
time_to_isoDateTime
(
time_t
ti
me
,
isoTime_t
*
isoTime
)
isoDate_t
time_to_isoDateTime
(
time_t
ti
,
isoTime_t
*
isoTime
)
{
struct
tm
tm
;
if
(
isoTime
!=
NULL
)
*
isoTime
=
0
;
if
(
ti
me
==
0
)
if
(
ti
==
0
)
return
(
0
);
ZERO_VAR
(
tm
);
if
(
gmtime_r
(
&
ti
me
,
&
tm
)
==
NULL
)
if
(
gmtime_r
(
&
ti
,
&
tm
)
==
NULL
)
return
(
0
);
if
(
isoTime
!=
NULL
)
...
...
@@ -196,16 +196,16 @@ isoDate_t time_to_isoDateTime(time_t time, isoTime_t* isoTime)
return
isoDate_create
(
1900
+
tm
.
tm_year
,
1
+
tm
.
tm_mon
,
tm
.
tm_mday
);
}
isoTime_t
time_to_isoTime
(
time_t
ti
me
)
isoTime_t
time_to_isoTime
(
time_t
ti
)
{
isoTime_t
isoTime
;
time_to_isoDateTime
(
ti
me
,
&
isoTime
);
time_to_isoDateTime
(
ti
,
&
isoTime
);
return
isoTime
;
}
time_t
isoDateTime_to_time
(
isoDate_t
date
,
isoTime_t
ti
me
)
time_t
isoDateTime_to_time
(
isoDate_t
date
,
isoTime_t
ti
)
{
struct
tm
tm
;
...
...
@@ -218,9 +218,9 @@ time_t isoDateTime_to_time(isoDate_t date, isoTime_t time)
tm
.
tm_mon
=
isoDate_month
(
date
);
tm
.
tm_mday
=
isoDate_day
(
date
);
tm
.
tm_hour
=
isoTime_hour
(
ti
me
);
tm
.
tm_min
=
isoTime_minute
(
ti
me
);
tm
.
tm_sec
=
isoTime_second
(
ti
me
);
tm
.
tm_hour
=
isoTime_hour
(
ti
);
tm
.
tm_min
=
isoTime_minute
(
ti
);
tm
.
tm_sec
=
isoTime_second
(
ti
);
return
sane_mktime
(
&
tm
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment