aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons/GeneralizedTime.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-09-02 05:20:39 +0000
committerLev Walkin <vlm@lionet.info>2004-09-02 05:20:39 +0000
commitcec43b58f789812003539161b035ff8b6d431684 (patch)
treed499b0dcf9c1f78547b328cfee5b3171ea6e8d50 /skeletons/GeneralizedTime.c
parent8418311264c8cce20d9eb3c00f07f0205e31a866 (diff)
const qualifiers
Diffstat (limited to 'skeletons/GeneralizedTime.c')
-rw-r--r--skeletons/GeneralizedTime.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/skeletons/GeneralizedTime.c b/skeletons/GeneralizedTime.c
index 687ccd4b..b3199173 100644
--- a/skeletons/GeneralizedTime.c
+++ b/skeletons/GeneralizedTime.c
@@ -18,21 +18,20 @@
#warning if you want to use asn_GT2time() or asn_UT2time().
#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;
if((tm = localtime(tloc)))
return memcpy(result, tm, sizeof(struct tm));
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;
if((tm = gmtime(tloc)))
return memcpy(result, tm, sizeof(struct tm));
return 0;
}
-#define tzset() _tzset()
static time_t timegm(struct tm *tm) {
time_t tloc;
char *tz;
@@ -40,7 +39,7 @@ static time_t timegm(struct tm *tm) {
tz = getenv("TZ");
_putenv("TZ=UTC");
- tzset();
+ _tzset();
tloc = mktime(tm);
if (tz) {
buf = alloca(strlen(tz) + 4);
@@ -49,7 +48,7 @@ static time_t timegm(struct tm *tm) {
buf = "TZ=";
}
_putenv(buf);
- tzset();
+ _tzset();
return tloc;
}