Commit 44a7defa authored by rswindell's avatar rswindell
Browse files

Resolve more 64/32-bit time_t warnings.

parent 6a1c93ac
......@@ -241,26 +241,26 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
f.cdt=flength(filepath);
padfname(getfname(filepath),f.name);
printf("%s %10lu %s\n"
,f.name,f.cdt,unixtodstr(&scfg,fdate(filepath),str));
,f.name,f.cdt,unixtodstr(&scfg,(time32_t)fdate(filepath),str));
exist=findfile(&scfg,f.dir,f.name);
if(exist) {
if(mode&NO_UPDATE)
continue;
getfileixb(&scfg,&f);
if(mode&ULDATE_ONLY) {
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
update_uldate(&scfg, &f);
continue;
}
}
if(mode&FILE_DATE) { /* get the file date and put into desc */
unixtodstr(&scfg,fdate(filepath),f.desc);
unixtodstr(&scfg,(time32_t)fdate(filepath),f.desc);
strcat(f.desc," ");
}
if(mode&TODAYS_DATE) { /* put today's date in desc */
unixtodstr(&scfg,time(NULL),f.desc);
unixtodstr(&scfg,time32(NULL),f.desc);
strcat(f.desc," ");
}
......@@ -303,7 +303,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
}
}
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
......@@ -388,7 +388,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
continue;
getfileixb(&scfg,&f);
if(mode&ULDATE_ONLY) {
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
update_uldate(&scfg, &f);
continue;
}
......@@ -398,13 +398,13 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
: scfg.dir[f.dir]->path,fname);
if(mode&FILE_DATE) { /* get the file date and put into desc */
l=fdate(filepath);
l=(time32_t)fdate(filepath);
unixtodstr(&scfg,l,f.desc);
strcat(f.desc," ");
}
if(mode&TODAYS_DATE) { /* put today's date in desc */
l=time(NULL);
l=time32(NULL);
unixtodstr(&scfg,l,f.desc);
strcat(f.desc," ");
}
......@@ -508,7 +508,7 @@ void addlist(char *inpath, file_t f, uint dskip, uint sskip)
}
f.cdt=l;
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
......@@ -861,9 +861,9 @@ int main(int argc, char **argv)
sprintf(str,"%s%s",cur_altpath ? scfg.altpath[cur_altpath-1]
: scfg.dir[f.dir]->path,argv[j]);
if(mode&FILE_DATE)
sprintf(f.desc,"%s ",unixtodstr(&scfg,fdate(str),tmp));
sprintf(f.desc,"%s ",unixtodstr(&scfg,(time32_t)fdate(str),tmp));
if(mode&TODAYS_DATE)
sprintf(f.desc,"%s ",unixtodstr(&scfg,time(NULL),tmp));
sprintf(f.desc,"%s ",unixtodstr(&scfg,time32(NULL),tmp));
sprintf(tmp,"%.*s",(int)(LEN_FDESC-strlen(f.desc)),argv[++j]);
strcpy(f.desc,tmp);
l=flength(str);
......@@ -877,13 +877,13 @@ int main(int argc, char **argv)
continue;
getfileixb(&scfg,&f);
if(mode&ULDATE_ONLY) {
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
update_uldate(&scfg, &f);
continue;
}
}
f.cdt=l;
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
f.altpath=cur_altpath;
prep_desc(f.desc);
if(mode&ASCII_ONLY)
......
......@@ -107,7 +107,7 @@ int main(int argc, char **argv)
int i,j,file,dirnum,libnum,desc_off,lines,nots=0
,omode=O_WRONLY|O_CREAT|O_TRUNC;
ulong l,m,n,cdt,misc=0,total_cdt=0,total_files=0,dir_files,datbuflen;
time_t uld,dld,now;
time32_t uld,dld,now;
long max_age=0;
FILE *in,*out=NULL;
......@@ -158,7 +158,7 @@ int main(int argc, char **argv)
exit(1);
}
now=time(NULL);
now=time32(NULL);
memset(&scfg,0,sizeof(scfg));
scfg.size=sizeof(scfg);
......@@ -402,7 +402,7 @@ int main(int argc, char **argv)
if(misc&DFD) {
sprintf(str,"%s%s",scfg.dir[i]->path,fname);
fprintf(out,"%s ",unixtodstr(&scfg,fdate(str),str));
fprintf(out,"%s ",unixtodstr(&scfg,(time32_t)fdate(str),str));
desc_off+=9; }
if(misc&ULD) {
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -160,14 +160,14 @@ int main(int argc, char **argv)
user.misc=(scfg.new_misc&~(DELETED|INACTIVE|QUIET|NETMAIL));
user.misc|=AUTOTERM; /* No way to frob the default value... */
user.qwk=QWK_DEFAULT;
user.firston=now;
user.laston=now; /* must set this or user may be purged prematurely */
user.pwmod=now;
user.firston=(time32_t)now;
user.laston=(time32_t)now; /* must set this or user may be purged prematurely */
user.pwmod=(time32_t)now;
user.sex=' ';
user.prot=scfg.new_prot;
if(scfg.new_expire)
user.expire=now+((long)scfg.new_expire*24L*60L*60L);
user.expire=(time32_t)(now+((long)scfg.new_expire*24L*60L*60L));
for(i=first_arg;i<argc;i++) {
if(argv[i][0]=='-') {
......@@ -189,7 +189,7 @@ int main(int argc, char **argv)
SAFECOPY(user.comment,argv[i]);
break;
case 'E':
user.expire=now+((long)atoi(argv[i])*24L*60L*60L);
user.expire=(time32_t)(now+((long)atoi(argv[i])*24L*60L*60L));
break;
case 'F':
switch(toupper(argv[i-1][2])) {
......
......@@ -790,7 +790,7 @@ void xmodem_progress(void* unused, unsigned block_num, int64_t offset, int64_t f
now=time(NULL);
if(now-last_progress>=progress_interval || offset >= fsize || newline) {
t=now-start;
t=(long)(now-start);
if(t<=0)
t=1;
if((cps=(unsigned)(offset/t))==0)
......@@ -859,7 +859,7 @@ void zmodem_progress(void* cbdata, int64_t current_pos)
now=time(NULL);
if(now-last_progress>=progress_interval || current_pos >= zm.current_file_size || newline) {
t=now-zm.transfer_start_time;
t=(long)(now-zm.transfer_start_time);
if(t<=0)
t=1;
if(zm.transfer_start_pos>current_pos)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment