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

@@ -550,17 +550,17 @@ enum {
// The Message Browser
struct MLst {
ulong msgno;
byte high;
char num[8];
char marks[3];
char by[sizeof(Name)+20];
char to[sizeof(Name)+20];
Subj re;
time_t written;
time_t arrived;
time_t received;
char goldmark;
ulong msgno;
byte high;
char num[8];
char marks[3];
char by[sizeof(Name)+20];
char to[sizeof(Name)+20];
Subj re;
time32_t written;
time32_t arrived;
time32_t received;
char goldmark;
};

View File

@@ -2581,7 +2581,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
gotorowcol(mincol, minrow);
dispins();
time_t _lasttime = time(NULL);
time32_t _lasttime = gtime(NULL);
while(not done) {
@@ -2613,7 +2613,7 @@ int IEclass::Start(int __mode, uint* __position, GMsg* __msg) {
#endif
if(EDIT->AutoSave()) {
time_t _thistime = time(NULL);
time32_t _thistime = gtime(NULL);
if(_thistime >= (_lasttime+EDIT->AutoSave())) {
_lasttime = _thistime;
SaveFile();

View File

@@ -515,7 +515,7 @@ void Initialize(int argc, char* argv[]) {
#if defined(GUTLOS_FUNCS)
g_init_os(1);
#endif
srand((unsigned)time(NULL));
srand(gtime(NULL));
// Display startup banner
std::cout << __gver_longpid__ << " " << __gver_ver__ << "\n";

View File

@@ -797,11 +797,11 @@ void KludgeDATE(GMsg* msg, const char* ptr) {
t.tm_min = minute;
t.tm_sec = second;
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);
msg->written = a + a - b;
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
msg->written = a + a - b;
}
}

View File

@@ -314,7 +314,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
char nbuf[33], dbuf[20];
strcpy(dbuf, LNG->n_a);
time_t dt = 0;
time32_t dt = 0;
switch(AA->Msglistdate()) {
case MSGLISTDATE_WRITTEN: dt = ml->written; break;
case MSGLISTDATE_ARRIVED: dt = ml->arrived; break;
@@ -896,7 +896,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
char dbuf[11];
time_t dt = 0;
time32_t dt = 0;
memset(dbuf, ' ', 10);
dbuf[10] = NUL;

View File

@@ -34,7 +34,7 @@ static ulong msgcount = 0;
ulong getClassicMsgId() {
return time(NULL)+(msgcount++);
return gtime(NULL)+(msgcount++);
}
// ------------------------------------------------------------------

View File

@@ -106,7 +106,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
const char *xmailer = get_informative_string();
const char *osver = ggetosstring();
time_t t = time(NULL);
time32_t t = gtime(NULL);
struct tm* written_tm = glocaltime(&t);
char cdate[80];
strftimei(cdate, 80, LNG->DateFmt, written_tm);

View File

@@ -243,10 +243,10 @@ static void MakeMsg3(int& mode, GMsg* msg) {
// Do Timefields
if(msg->attr.fmu()) {
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);
a += a - b;
if(AA->havereceivedstamp())
msg->received = a;
@@ -824,10 +824,10 @@ void MakeMsg(int mode, GMsg* omsg, bool ignore_replyto) {
dochgdate = false;
}
if(dochgdate) {
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);
a += a - b;
msg->received = msg->arrived = msg->written = a;
}

View File

@@ -208,15 +208,15 @@ int ImportQWK() {
_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);
msg->written = a + a - b;
a = time(NULL);
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
msg->written = a + a - b;
a = gtime(NULL);
tp = ggmtime(&a);
tp->tm_isdst = -1;
b = mktime(tp);
b = gmktime(tp);
msg->arrived = a + a - b;
// Read message text

View File

@@ -1174,10 +1174,10 @@ int LoadMessage(GMsg* msg, int margin) {
if(msg->attr.tou()) {
reader_rcv_noise = 1;
if(not msg->attr.rcv()) { // Have we seen it?
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->received = a + a - b; // Get current date
msg->attr.rcv1(); // Mark as received
reader_rcv_noise++;

View File

@@ -171,11 +171,11 @@ void ProcessSoupMsg(char* lbuf, GMsg* msg, int& msgs, char* areaname, int tossto
msg->orig = msg->oorig = CFG->internetgate.addr.valid() ? CFG->internetgate.addr : AA->aka();
msg->dest = msg->odest = AA->aka();
time_t a = time(NULL);
time32_t a = gtime(NULL);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
msg->arrived = a + a - b;
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
msg->arrived = a + a - b;
Line* line = NULL;
Line* fline = NULL;
@@ -697,11 +697,11 @@ int ExportSoupMsg(GMsg* msg, char* msgfile, gfile& fp, int ismail) {
msg->attr.snt1();
msg->attr.scn1();
msg->attr.uns0();
time_t a = time(NULL);
time32_t a = gtime(NULL);
struct tm *tp = ggmtime(&a);
tp->tm_isdst = -1;
time_t b = mktime(tp);
msg->arrived = a + a - b;
tp->tm_isdst = -1;
time32_t b = gmktime(tp);
msg->arrived = a + a - b;
AA->SaveHdr(GMSG_UPDATE, msg);
if(msg->attr.k_s())
AA->DeleteMsg(msg, DIR_NEXT);

View File

@@ -342,7 +342,7 @@ bool guserbase::edit_entry(uint idx) {
window.prints(13, 53, wattr, "Times Used:");
char dbuf[16];
time_t dt = entry.firstdate;
time32_t dt = entry.firstdate;
if(dt)
window.prints(13, 13, wattr, strftimei(dbuf, 16, "%d %b %y", ggmtime(&dt)));
dt = entry.lastdate;
@@ -427,10 +427,10 @@ bool guserbase::find_entry(char* name, bool lookup) {
void guserbase::write_entry(uint idx, bool updateit) {
if(updateit and not entry.is_deleted) {
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);
entry.lastdate = a + a - b;
if(not entry.firstdate)
entry.firstdate = entry.lastdate;

View File

@@ -54,7 +54,7 @@ void update_statuslines() {
*help = NUL;
if(CFG->switches.get(statuslineclock)) {
time_t t = time(NULL);
time32_t t = gtime(NULL);
sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
}

View File

@@ -267,7 +267,7 @@ void ScreenBlankIdle() {
char blankmsg1[80];
char blankmsg2[80];
time_t t = time(NULL);
time32_t t = gtime(NULL);
sprintf(blankmsg1, " %s %s %s ", __gver_longpid__, __gver_ver__, strftimei(blankmsg2, 40, LNG->StatusLineTimeFmt, glocaltime(&t)));
sprintf(blankmsg2, " %s ", LNG->BlankMsg);
if(strblank(blankmsg2)) {