Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
cec43b58
Commit
cec43b58
authored
Sep 02, 2004
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const qualifiers
parent
84183112
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
skeletons/GeneralizedTime.c
skeletons/GeneralizedTime.c
+4
-5
No files found.
skeletons/GeneralizedTime.c
View file @
cec43b58
...
@@ -18,21 +18,20 @@
...
@@ -18,21 +18,20 @@
#warning if you want to use asn_GT2time() or asn_UT2time().
#warning if you want to use asn_GT2time() or asn_UT2time().
#warning PLEASE STOP AND READ!
#warning PLEASE STOP AND READ!
static
struct
tm
*
localtime_r
(
time_t
*
tloc
,
struct
tm
*
result
)
{
static
struct
tm
*
localtime_r
(
const
time_t
*
tloc
,
struct
tm
*
result
)
{
struct
tm
*
tm
;
struct
tm
*
tm
;
if
((
tm
=
localtime
(
tloc
)))
if
((
tm
=
localtime
(
tloc
)))
return
memcpy
(
result
,
tm
,
sizeof
(
struct
tm
));
return
memcpy
(
result
,
tm
,
sizeof
(
struct
tm
));
return
0
;
return
0
;
}
}
static
struct
tm
*
gmtime_r
(
time_t
*
tloc
,
struct
tm
*
result
)
{
static
struct
tm
*
gmtime_r
(
const
time_t
*
tloc
,
struct
tm
*
result
)
{
struct
tm
*
tm
;
struct
tm
*
tm
;
if
((
tm
=
gmtime
(
tloc
)))
if
((
tm
=
gmtime
(
tloc
)))
return
memcpy
(
result
,
tm
,
sizeof
(
struct
tm
));
return
memcpy
(
result
,
tm
,
sizeof
(
struct
tm
));
return
0
;
return
0
;
}
}
#define tzset() _tzset()
static
time_t
timegm
(
struct
tm
*
tm
)
{
static
time_t
timegm
(
struct
tm
*
tm
)
{
time_t
tloc
;
time_t
tloc
;
char
*
tz
;
char
*
tz
;
...
@@ -40,7 +39,7 @@ static time_t timegm(struct tm *tm) {
...
@@ -40,7 +39,7 @@ static time_t timegm(struct tm *tm) {
tz
=
getenv
(
"TZ"
);
tz
=
getenv
(
"TZ"
);
_putenv
(
"TZ=UTC"
);
_putenv
(
"TZ=UTC"
);
tzset
();
_
tzset
();
tloc
=
mktime
(
tm
);
tloc
=
mktime
(
tm
);
if
(
tz
)
{
if
(
tz
)
{
buf
=
alloca
(
strlen
(
tz
)
+
4
);
buf
=
alloca
(
strlen
(
tz
)
+
4
);
...
@@ -49,7 +48,7 @@ static time_t timegm(struct tm *tm) {
...
@@ -49,7 +48,7 @@ static time_t timegm(struct tm *tm) {
buf
=
"TZ="
;
buf
=
"TZ="
;
}
}
_putenv
(
buf
);
_putenv
(
buf
);
tzset
();
_
tzset
();
return
tloc
;
return
tloc
;
}
}
...
...
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