Fixing warnings and errors for MSVS 2005 compiler

This commit is contained in:
Ianos Gnatiuc
2006-04-21 19:57:30 +00:00
parent e3bbfbee86
commit df0f689816
44 changed files with 417 additions and 289 deletions

View File

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

View File

@@ -168,11 +168,12 @@ void FidoArea::save_message(int __mode, gmsg* __msg, FidoHdr& __hdr) {
__hdr.opus.written = TimeToFTime(__msg->written);
__hdr.opus.arrived = TimeToFTime(__msg->arrived);
}
struct tm* _tm = ggmtime(&__msg->written);
struct tm _tm; ggmtime(&_tm, &__msg->written);
sprintf(__hdr.datetime, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec
);
_tm.tm_mday, gmonths[_tm.tm_mon + 1], _tm.tm_year % 100,
_tm.tm_hour, _tm.tm_min, _tm.tm_sec
);
// Write message header
write(_fh, &__hdr, sizeof(FidoHdr));

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;
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = gmktime(&_tm);
struct tm tp; ggmtime(&tp, &a);
tp.tm_isdst = -1;
time32_t b = gmktime(&tp);
__msg->written = a + a - b;
__msg->arrived = 0;

View File

@@ -127,9 +127,9 @@ void _HudsArea<msgn_t, rec_t, attr_t, board_t, last_t, __HUDSON>::save_message(i
__hdr.replyto = (msgn_t)__msg->link.to();
__hdr.reply1st = (msgn_t)__msg->link.first();
struct tm* _tmp = ggmtime(&__msg->written);
strc2p(strftimei(__hdr.date, 9, "%m-%d-%y", _tmp));
strc2p(strftimei(__hdr.time, 6, "%H:%M", _tmp));
struct tm _tmp; ggmtime(&_tmp, &__msg->written);
strc2p(strftimei(__hdr.date, 9, "%m-%d-%y", &_tmp));
strc2p(strftimei(__hdr.time, 6, "%H:%M", &_tmp));
strc2p(strxcpy(__hdr.to, __msg->to, sizeof(__hdr.to)));
strc2p(strxcpy(__hdr.by, __msg->by, sizeof(__hdr.by)));

View File

@@ -148,14 +148,14 @@ void JamArea::open_area() {
data->highwater = -1;
// Is the signature invalid?
if(memcmp(data->hdrinfo.signature, JAM_SIGNATURE, 4)) {
if (memcmp(data->hdrinfo.signature, JAM_SIGNATURE, 4))
{
// Initialize header info
memcpy(data->hdrinfo.signature, JAM_SIGNATURE, 4);
time32_t a = gtime(NULL);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = gtime(NULL);
struct tm tp; ggmtime(&tp, &a);
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;
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = gmktime(&_tm);
struct tm tp; ggmtime(&tp, &a);
tp.tm_isdst = -1;
time32_t b = gmktime(&tp);
__msg->written = a + a - b;
__msg->arrived = 0;

View File

@@ -158,18 +158,22 @@ void PcbArea::save_message(int __mode, gmsg* __msg, PcbHdr& __hdr) {
// Convert dates and times
char _dtbuf[9];
struct tm* _tm = ggmtime(&__msg->written);
memcpy(__hdr.date, strftimei(_dtbuf, 9, __msg->attr.uns() ? "%d-%m-%y" : "%d-%m\xC4%y", _tm), 8);
memcpy(__hdr.time, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);
_idx.date = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
if(__msg->link.first()) {
struct tm _tm; ggmtime(&_tm, &__msg->written);
memcpy(__hdr.date, strftimei(_dtbuf, 9, __msg->attr.uns() ? "%d-%m-%y" : "%d-%m\xC4%y", &_tm), 8);
memcpy(__hdr.time, strftimei(_dtbuf, 6, "%H:%M", &_tm), 5);
_idx.date = (word)YMD2JDN(1900+_tm.tm_year, _tm.tm_mon+1, _tm.tm_mday);
if (__msg->link.first())
{
__hdr.hasreply = 'R';
_tm = ggmtime(&__msg->pcboard.reply_written);
int _year = _tm->tm_year % 100;
__hdr.replydate = L2B((10000L*_year) + (100L*(_tm->tm_mon+1)) + _tm->tm_mday);
memcpy(__hdr.replytime, strftimei(_dtbuf, 6, "%H:%M", _tm), 5);
ggmtime(&_tm, &__msg->pcboard.reply_written);
int _year = _tm.tm_year % 100;
__hdr.replydate = L2B((10000L*_year) + (100L*(_tm.tm_mon+1)) + _tm.tm_mday);
memcpy(__hdr.replytime, strftimei(_dtbuf, 6, "%H:%M", &_tm), 5);
}
else {
else
{
__hdr.hasreply = ' ';
__hdr.replydate = L2B(0);
memcpy(__hdr.replytime, " ", 5);

View File

@@ -324,13 +324,14 @@ 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);
time32_t a = smsgp->hdr.when_written.time;
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = smsgp->hdr.when_written.time;
struct tm tp; ggmtime(&tp, &a);
tp.tm_isdst = -1;
time32_t b = gmktime(&tp);
__msg->written = a + a - b;
a = smsgp->hdr.when_imported.time;
b = gmktime(ggmtime(&a));
ggmtime(&tp, &a);
b = gmktime(&tp);
__msg->arrived = a + a - b;
__msg->received = 0;
@@ -533,12 +534,13 @@ void SMBArea::save_hdr(int mode, gmsg* msg)
smsg.hdr.netattr = 0;
smsg.hdr.auxattr = 0;
}
else {
else
{
memcpy(smsg.hdr.id, "SHD\x1a", 4);
smsg.hdr.version = smb_ver();
struct tm *tp = ggmtime(&msg->written);
tp->tm_isdst = -1;
smsg.hdr.when_written.time = gmktime(tp);
struct tm tp; ggmtime(&tp, &msg->written);
tp.tm_isdst = -1;
smsg.hdr.when_written.time = gmktime(&tp);
}
smsg.hdr.when_imported.time = gtime(NULL);
@@ -968,9 +970,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, gctime(&smsg.hdr.when_written.time))[-1] = NUL;
gctime(buf, ARRAYSIZE(buf), &smsg.hdr.when_written.time);
line = AddLineF(line, "Written : %s", buf);
stpcpy(buf, gctime(&smsg.hdr.when_imported.time))[-1] = NUL;
gctime(buf, ARRAYSIZE(buf), &smsg.hdr.when_imported.time);
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

@@ -437,11 +437,12 @@ void SquishArea::save_message(int __mode, gmsg* __msg) {
__hdr.date_written = TimeToFTime(__msg->written);
__hdr.date_arrived = TimeToFTime(__msg->arrived);
struct tm* _tm = ggmtime(&__msg->written);
struct tm _tm; ggmtime(&_tm, &__msg->written);
sprintf(__hdr.ftsc_date, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec
);
_tm.tm_mday, gmonths[_tm.tm_mon + 1], _tm.tm_year % 100,
_tm.tm_hour, _tm.tm_min, _tm.tm_sec
);
// Setup some local variables for speed
int _fhsqd = data->fhsqd;

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;
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = gmktime(&_tm);
struct tm tp; ggmtime(&tp, &a);
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;
time32_t a = gmktime(&_tm);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
time32_t a = gmktime(&_tm);
struct tm tp; ggmtime(&tp, &a);
tp.tm_isdst = -1;
time32_t b = gmktime(&tp);
__msg->received = a + a - b;
}

View File

@@ -118,16 +118,18 @@ void WCatArea::save_message(int __mode, gmsg* __msg, WCatHdr& __hdr) {
strcpy(__msg->wildcat.network, "FTSC");
strc2p(strcpy(__hdr.network, __msg->wildcat.network));
if(__msg->written) {
struct tm* _tm = ggmtime(&__msg->written);
__hdr.msgdate = (word)(YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday)-1);
__hdr.msgtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
if (__msg->written)
{
struct tm _tm; ggmtime(&_tm, &__msg->written);
__hdr.msgdate = (word)(YMD2JDN(1900+_tm.tm_year, _tm.tm_mon+1, _tm.tm_mday)-1);
__hdr.msgtime = ((_tm.tm_hour*3600L)+(_tm.tm_min*60L)+_tm.tm_sec)+1;
}
if(__msg->received) {
struct tm* _tm = ggmtime(&__msg->received);
__hdr.readdate = (word)YMD2JDN(1900+_tm->tm_year, _tm->tm_mon+1, _tm->tm_mday);
__hdr.readtime = ((_tm->tm_hour*3600L)+(_tm->tm_min*60L)+_tm->tm_sec)+1;
if (__msg->received)
{
struct tm _tm; ggmtime(&_tm, &__msg->received);
__hdr.readdate = (word)YMD2JDN(1900+_tm.tm_year, _tm.tm_mon+1, _tm.tm_mday);
__hdr.readtime = ((_tm.tm_hour*3600L)+(_tm.tm_min*60L)+_tm.tm_sec)+1;
}
__hdr.mflags |= (word)(__msg->attr.pvt() ? mfPrivate : 0);

View File

@@ -77,8 +77,10 @@ Line* WCatArea::make_dump_msg(Line*& lin, gmsg* msg, char* lng_head) {
AddLineF(line, "DestUserID : %i", _hdr.touserid);
AddLineF(line, "Subject : %s", STRNP2C(_hdr.subject));
AddLineF(line, "Network : %s", STRNP2C(_hdr.network));
AddLineF(line, "MsgTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", ggmtime(&msg->written)), _hdr.msgdate, _hdr.msgtime);
AddLineF(line, "ReadTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", ggmtime(&msg->received)), _hdr.readdate, _hdr.readtime);
struct tm _tm; ggmtime(&_tm, &msg->written);
AddLineF(line, "MsgTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", &_tm), _hdr.msgdate, _hdr.msgtime);
ggmtime(&_tm, &msg->received);
AddLineF(line, "ReadTime : %s (%u, %i)", strftimei(buf, 100, "%d %b %y %H:%M:%S", &_tm), _hdr.readdate, _hdr.readtime);
AddLineF(line, "mFlags : %u (%04Xh)", _hdr.mflags, _hdr.mflags);
AddLineF(line, "Reference : %u", _hdr.reference);
AddLineF(line, "FidoFrom : %u:%u/%u.%u", _hdr.origaddr.zone, _hdr.origaddr.net, _hdr.origaddr.node, _hdr.origaddr.point);

View File

@@ -65,17 +65,19 @@ int XbbsArea::load_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
__msg->written = FidoTimeToUnix(__hdr.date);
__msg->received = __hdr.timerecv;
if(__hdr.indate[2]) {
if(__hdr.indate[2])
{
struct tm t;
t.tm_year = __hdr.indate[0]+89;
t.tm_mon = __hdr.indate[1]-1;
t.tm_mday = __hdr.indate[2];
t.tm_hour = t.tm_min = t.tm_sec = 0;
t.tm_isdst = -1;
time32_t a = gmktime(&t);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
t.tm_year = __hdr.indate[0]+89;
t.tm_mon = __hdr.indate[1]-1;
t.tm_mday = __hdr.indate[2];
t.tm_hour = t.tm_min = t.tm_sec = 0;
t.tm_isdst = -1;
time32_t a = gmktime(&t);
struct tm tp; ggmtime(&tp, &a);
tp.tm_isdst = -1;
time32_t b = gmktime(&tp);
__msg->arrived = a + a - b;
}

View File

@@ -135,16 +135,17 @@ void XbbsArea::save_message(int __mode, gmsg* __msg, XbbsHdr& __hdr) {
strxcpy(__hdr.to, __msg->to, sizeof(__hdr.to));
strxcpy(__hdr.subj, __msg->re, sizeof(__hdr.subj));
struct tm* _tm = ggmtime(&__msg->written);
struct tm _tm; ggmtime(&_tm, &__msg->written);
sprintf(__hdr.date, "%02d %3s %02d %02d:%02d:%02d",
_tm->tm_mday, gmonths[_tm->tm_mon+1], _tm->tm_year % 100,
_tm->tm_hour, _tm->tm_min, _tm->tm_sec
);
if(__msg->arrived)
_tm = ggmtime(&__msg->arrived);
__hdr.indate[0] = (byte)(_tm->tm_year - 89);
__hdr.indate[1] = (byte)(_tm->tm_mon + 1);
__hdr.indate[2] = (byte)(_tm->tm_mday);
_tm.tm_mday, gmonths[_tm.tm_mon + 1], _tm.tm_year % 100,
_tm.tm_hour, _tm.tm_min, _tm.tm_sec
);
if (__msg->arrived) ggmtime(&_tm, &__msg->arrived);
__hdr.indate[0] = (byte)(_tm.tm_year - 89);
__hdr.indate[1] = (byte)(_tm.tm_mon + 1);
__hdr.indate[2] = (byte)(_tm.tm_mday);
__hdr.indate[3] = 0;
__hdr.msgnum = __msg->msgno;