Changed time_t type to time32_t

This commit is contained in:
Ianos Gnatiuc
2005-10-20 21:10:42 +00:00
parent d8a855aa42
commit 44c26c3b0a
34 changed files with 1392 additions and 1369 deletions

View File

@@ -97,10 +97,10 @@ int FidoArea::load_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
__msg->written = __msg->written ? __msg->written : FidoTimeToUnix(__hdr.datetime);
if(__msg->arrived == 0) {
time_t a = time(NULL);
time32_t a = gtime(NULL);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->arrived = a + a - b;
}

View File

@@ -134,10 +134,10 @@ int _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::load_message(in
_tm.tm_min = _minute;
_tm.tm_sec = 0;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->written = a + a - b;
__msg->arrived = 0;

View File

@@ -152,10 +152,10 @@ void JamArea::open_area() {
// Initialize header info
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
time_t a = time(NULL);
time32_t a = gtime(NULL);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
data->hdrinfo.datecreated = a + a - b;
data->hdrinfo.passwordcrc = 0xFFFFFFFFL;
data->hdrinfo.basemsgnum = 1;

View File

@@ -79,10 +79,10 @@ int PcbArea::load_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
_tm.tm_min = _minute;
_tm.tm_sec = 0;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->written = a + a - b;
__msg->arrived = 0;

View File

@@ -324,13 +324,13 @@ int SMBArea::load_hdr(gmsg* __msg, smbmsg_t *smsg)
__msg->attr.cfm(smsgp->hdr.auxattr & MSG_CONFIRMREQ);
__msg->attr.tfs(smsgp->hdr.auxattr & MSG_TRUNCFILE);
time_t a = smsgp->hdr.when_written.time;
time32_t a = smsgp->hdr.when_written.time;
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->written = a + a - b;
a = smsgp->hdr.when_imported.time;
b = mktime(ggmtime(&a));
b = gmktime(ggmtime(&a));
__msg->arrived = a + a - b;
__msg->received = 0;
@@ -538,9 +538,9 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
smsg.hdr.version = smb_ver();
struct tm *tp = ggmtime(&msg->written);
tp->tm_isdst = -1;
smsg.hdr.when_written.time = mktime(tp);
smsg.hdr.when_written.time = gmktime(tp);
}
smsg.hdr.when_imported.time = time(NULL);
smsg.hdr.when_imported.time = gtime(NULL);
// Transfer attributes
if(msg->attr.pvt()) smsg.hdr.attr |= MSG_PRIVATE;
@@ -968,9 +968,9 @@ Line* SMBArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head)
line = AddLineF(line, "Attr : %04Xh", smsg.hdr.attr);
line = AddLineF(line, "AUXAttr : %04Xh", smsg.hdr.auxattr);
line = AddLineF(line, "NetAttr : %04Xh", smsg.hdr.netattr);
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_written.time))[-1] = NUL;
stpcpy(buf, gctime(&smsg.hdr.when_written.time))[-1] = NUL;
line = AddLineF(line, "Written : %s", buf);
stpcpy(buf, ctime((time_t *)&smsg.hdr.when_imported.time))[-1] = NUL;
stpcpy(buf, gctime(&smsg.hdr.when_imported.time))[-1] = NUL;
line = AddLineF(line, "Imported : %s", buf);
line = AddLineF(line, "Number : %d (%d)", smsg.hdr.number, (int32_t)(ftell(data->sid_fp)/sizeof(idxrec_t)));
line = AddLineF(line, "Thread orig : %d", smsg.hdr.thread_orig);

View File

@@ -128,7 +128,7 @@ int SquishArea::load_message(int __mode, gmsg* __msg, SqshHdr& __hdr) {
__msg->dest.point = __msg->odest.point = __hdr.dest.point;
// Convert date and time
time_t _written = FTimeToTime(&__hdr.date_written);
time32_t _written = FTimeToTime(&__hdr.date_written);
__msg->written = _written ? _written : FidoTimeToUnix(__hdr.ftsc_date);
__msg->arrived = FTimeToTime(&__hdr.date_arrived);

View File

@@ -103,10 +103,10 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_tm.tm_min = _minute;
_tm.tm_sec = _second;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->written = a + a - b;
}
@@ -123,10 +123,10 @@ int WCatArea::load_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
_tm.tm_min = _minute;
_tm.tm_sec = _second;
_tm.tm_isdst = -1;
time_t a = mktime(&_tm);
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->received = a + a - b;
}

View File

@@ -72,10 +72,10 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
t.tm_mday = __hdr.indate[2];
t.tm_hour = t.tm_min = t.tm_sec = 0;
t.tm_isdst = -1;
time_t a = mktime(&t);
time32_t a = gmktime(&t);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
__msg->arrived = a + a - b;
}