Commit 813aed3d authored by rswindell's avatar rswindell

Resolve 64-bit time_t issues with combination MSVC10/BCB6 builds by making

all exported functions and data types using a 32-bit time_t (time32_t).
parent e4978284
......@@ -242,8 +242,7 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
return(smb_zonestr(sys_timezone(&cfg),str));
if(!strcmp(sp,"DATE") || !strcmp(sp,"SYSDATE")) {
now=time(NULL);
return(unixtodstr(&cfg,now,str));
return(unixtodstr(&cfg,time32(NULL),str));
}
if(!strcmp(sp,"DATETIME"))
......@@ -420,7 +419,7 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
if(!strcmp(sp,"TUSED")) { /* Synchronet only */
now=time(NULL);
return(sectostr(now-logontime,str)+1);
return(sectostr((uint)(now-logontime),str)+1);
}
if(!strcmp(sp,"TLEFT")) { /* Synchronet only */
......@@ -453,7 +452,7 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
if(!strcmp(sp,"LASTTIMEON")) {
memset(&tm,0,sizeof(tm));
localtime_r(&useron.laston,&tm);
localtime32(&useron.laston,&tm);
safe_snprintf(str,maxlen,"%02d:%02d %s"
,tm.tm_hour==0 ? 12
: tm.tm_hour>12 ? tm.tm_hour-12
......@@ -512,7 +511,7 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
}
if(!strcmp(sp,"LASTNEW"))
return(unixtodstr(&cfg,ns_time,str));
return(unixtodstr(&cfg,(time32_t)ns_time,str));
if(!strcmp(sp,"NEWFILETIME"))
return(timestr(ns_time));
......@@ -566,7 +565,7 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
if(!strcmp(sp,"EXPDAYS")) {
now=time(NULL);
l=useron.expire-now;
l=(long)(useron.expire-now);
if(l<0)
l=0;
safe_snprintf(str,maxlen,"%lu",l/(1440L*60L));
......
......@@ -102,7 +102,7 @@ bool sbbs_t::bulkmail(uchar *ar)
smb_hfield_str(&msg,SUBJECT,title);
msg.hdr.when_written.time=time(NULL);
msg.hdr.when_written.time=time32(NULL);
msg.hdr.when_written.zone=sys_timezone(&cfg);
if(editor!=NULL)
......
......@@ -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 *
......@@ -47,7 +47,7 @@ typedef struct {
char addr[16]; /* IP address */
char host[64]; /* host name */
WORD port; /* TCP port number */
time_t time; /* connect time */
time32_t time; /* connect time */
const char* protocol; /* protocol description */
const char* user; /* user name */
char pad[32]; /* padding for future expansion */
......
......@@ -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 2009 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 *
......@@ -465,7 +465,7 @@ void sbbs_t::ctrl_a(char x)
break;
case 'D': /* Date */
now=time(NULL);
bputs(unixtodstr(&cfg,now,tmp1));
bputs(unixtodstr(&cfg,(time32_t)now,tmp1));
break;
case ',': /* Delay 1/10 sec */
mswait(100);
......
......@@ -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 2010 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 *
......@@ -212,7 +212,7 @@ ulong sbbs_t::gettimeleft(bool handle_out_of_time)
now=time(NULL);
timeleft = ::gettimeleft(&cfg, &useron, starttime);
timeleft = (ulong)::gettimeleft(&cfg, &useron, starttime);
/* Timed event time reduction handler */
event_time=getnextevent(&cfg, &nextevent);
......@@ -223,7 +223,7 @@ ulong sbbs_t::gettimeleft(bool handle_out_of_time)
if(event_time<now)
timeleft=0;
else
timeleft=event_time-now;
timeleft=(ulong)(event_time-now);
if(!(sys_status&SS_EVENT)) {
lprintf(LOG_NOTICE,"Node %d Time reduced (to %s) due to upcoming event (%s) on %s"
,cfg.node_num,sectostr(timeleft,tmp),event_code,timestr(event_time));
......@@ -281,7 +281,7 @@ ulong sbbs_t::gettimeleft(bool handle_out_of_time)
useron.exempt=cfg.val_exempt[cfg.level_expireto[useron.level]];
useron.rest=cfg.val_rest[cfg.level_expireto[useron.level]];
if(cfg.val_expire[cfg.level_expireto[useron.level]])
useron.expire=now
useron.expire=(time32_t)now
+(cfg.val_expire[cfg.level_expireto[useron.level]]*24*60*60);
else
useron.expire=0;
......@@ -305,7 +305,7 @@ ulong sbbs_t::gettimeleft(bool handle_out_of_time)
putuserrec(&cfg,useron.number,U_FLAGS2,8,ultoa(useron.flags2,str,16));
putuserrec(&cfg,useron.number,U_FLAGS3,8,ultoa(useron.flags3,str,16));
putuserrec(&cfg,useron.number,U_FLAGS4,8,ultoa(useron.flags4,str,16));
putuserrec(&cfg,useron.number,U_EXPIRE,8,ultoa(useron.expire,str,16));
putuserrec(&cfg,useron.number,U_EXPIRE,8,ultoa((ulong)useron.expire,str,16));
putuserrec(&cfg,useron.number,U_EXEMPT,8,ultoa(useron.exempt,str,16));
putuserrec(&cfg,useron.number,U_REST,8,ultoa(useron.rest,str,16));
if(cfg.expire_mod[0])
......
......@@ -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 2009 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 *
......@@ -44,7 +44,7 @@ const char *mon[]={"Jan","Feb","Mar","Apr","May","Jun"
/****************************************************************************/
/* Converts a date string in format MM/DD/YY into unix time format */
/****************************************************************************/
time_t DLLCALL dstrtounix(scfg_t* cfg, char *instr)
time32_t DLLCALL dstrtounix(scfg_t* cfg, char *instr)
{
char* p;
char* day;
......@@ -89,15 +89,16 @@ time_t DLLCALL dstrtounix(scfg_t* cfg, char *instr)
if (tm.tm_mon)
tm.tm_mon--; /* zero-based month field */
tm.tm_isdst=-1; /* Do not adjust for DST */
return(mktime(&tm));
return(mktime32(&tm));
}
/****************************************************************************/
/* Converts unix time format (long - time_t) into a char str MM/DD/YY */
/****************************************************************************/
char* DLLCALL unixtodstr(scfg_t* cfg, time_t unix_time, char *str)
char* DLLCALL unixtodstr(scfg_t* cfg, time32_t t, char *str)
{
struct tm tm;
time_t unix_time=t;
if(!unix_time)
strcpy(str,"00/00/00");
......@@ -154,11 +155,12 @@ char* DLLCALL hhmmtostr(scfg_t* cfg, struct tm* tm, char* str)
/* Generates a 24 character ASCII string that represents the time_t pointer */
/* Used as a replacement for ctime() */
/****************************************************************************/
char* DLLCALL timestr(scfg_t* cfg, time_t intime, char* str)
char* DLLCALL timestr(scfg_t* cfg, time32_t t, char* str)
{
char* mer;
uchar hour;
struct tm tm;
time_t intime=t;
if(localtime_r(&intime,&tm)==NULL) {
strcpy(str,"Invalid Time");
......
......@@ -101,7 +101,7 @@ void sbbs_t::downloadfile(file_t* f)
/*******************/
/* Update IXB File */
/*******************/
f->datedled=time(NULL);
f->datedled=time32(NULL);
sprintf(str,"%s%s.ixb",cfg.dir[f->dir]->data_dir,cfg.dir[f->dir]->code);
if((file=nopen(str,O_RDWR))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDWR);
......@@ -160,7 +160,7 @@ void sbbs_t::notdownloaded(ulong size, time_t start, time_t end)
sprintf(str,"Estimated Time: %s Transfer Time: %s"
,sectostr(cur_cps ? size/cur_cps : 0,tmp)
,sectostr((uint)end-start,tmp2));
,sectostr((uint)(end-start),tmp2));
logline(nulstr,str);
if(cfg.leech_pct && cur_cps /* leech detection */
&& end-start>=cfg.leech_sec
......
......@@ -264,7 +264,7 @@ bool sbbs_t::email(int usernumber, const char *top, const char *subj, long mode)
msg.hdr.attr=msgattr;
if(mode&WM_FILE)
msg.hdr.auxattr|=MSG_FILEATTACH;
msg.hdr.when_written.time=msg.hdr.when_imported.time=time(NULL);
msg.hdr.when_written.time=msg.hdr.when_imported.time=time32(NULL);
msg.hdr.when_written.zone=msg.hdr.when_imported.zone=sys_timezone(&cfg);
if(cfg.mail_maxcrcs) {
......
......@@ -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 2010 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 *
......@@ -755,7 +755,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
lp=getintvar(csi,*(int32_t *)csi->ip);
csi->ip+=4;
if(lp)
*lp=time(NULL);
*lp=time32(NULL);
return(0);
case DATE_STR_TO_INT:
lp=getintvar(csi,*(int32_t *)csi->ip);
......@@ -763,7 +763,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
pp=getstrvar(csi,*(int32_t *)csi->ip);
csi->ip+=4;
if(lp && pp && *pp)
*lp=dstrtounix(&cfg,*pp);
*lp=(int32_t)dstrtounix(&cfg,*pp);
return(0);
case STRLEN_INT_VAR:
lp=getintvar(csi,*(int32_t *)csi->ip);
......@@ -833,7 +833,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
csi->ip+=4;
if(lp) {
if(pp && *pp)
*lp=fdate(*pp);
*lp=(int32_t)fdate(*pp);
else
*lp=0;
}
......@@ -1267,7 +1267,7 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
lp2=getintvar(csi,*(int32_t *)csi->ip);
csi->ip+=4;
if(lp1 && (uint)*lp1<csi->files && lp2)
*lp2=filetime(fileno(csi->file[*lp1]));
*lp2=(int32_t)filetime(fileno(csi->file[*lp1]));
return(0);
case FIO_SET_TIME:
lp1=getintvar(csi,*(int32_t *)csi->ip);
......
......@@ -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 2010 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 *
......@@ -532,7 +532,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
memset(&msg,0,sizeof(smbmsg_t));
msg.hdr.version=smb_ver();
msg.hdr.when_imported.time=time(NULL);
msg.hdr.when_imported.time=time32(NULL);
msg.hdr.when_imported.zone=sys_timezone(&cfg);
if(fromhub || useron.rest&FLAG('Q')) {
......@@ -596,7 +596,7 @@ void sbbs_t::qwktonetmail(FILE *rep, char *block, char *into, uchar fromhub)
tm.tm_sec=0;
tm.tm_isdst=-1; /* Do not adjust for DST */
msg.hdr.when_written.time=mktime(&tm);
msg.hdr.when_written.time=mktime32(&tm);
sprintf(str,"%.25s",block+71); /* Title */
smb_hfield(&msg,SUBJECT,strlen(str),str);
......
......@@ -75,7 +75,7 @@ BOOL DLLCALL getfiledat(scfg_t* cfg, file_t* f)
if(!f->size) { /* only read disk if this is null */
getfilepath(cfg,f,str);
if((f->size=(long)flength(str))>=0)
f->date=fdate(str);
f->date=(time32_t)fdate(str);
/*
}
else {
......@@ -123,7 +123,7 @@ BOOL DLLCALL putfiledat(scfg_t* cfg, file_t* f)
putrec(buf,F_TIMESDLED+5,2,crlf);
putrec(buf,F_OPENCOUNT,3,ultoa(f->opencount,tmp,10));
putrec(buf,F_OPENCOUNT+3,2,crlf);
buf[F_MISC]=f->misc+' ';
buf[F_MISC]=(char)f->misc+' ';
putrec(buf,F_ALTPATH,2,hexplus(f->altpath,tmp));
putrec(buf,F_ALTPATH+2,2,crlf);
SAFEPRINTF2(str,"%s%s.dat",cfg->dir[f->dir]->data_dir,cfg->dir[f->dir]->code);
......@@ -201,7 +201,7 @@ BOOL DLLCALL addfiledat(scfg_t* cfg, file_t* f)
putrec(fdat,F_TIMESDLED+5,2,crlf);
putrec(fdat,F_OPENCOUNT,3,ultoa(f->opencount,tmp,10));
putrec(fdat,F_OPENCOUNT+3,2,crlf);
fdat[F_MISC]=f->misc+' ';
fdat[F_MISC]=(char)f->misc+' ';
putrec(fdat,F_ALTPATH,2,hexplus(f->altpath,tmp));
putrec(fdat,F_ALTPATH+2,2,crlf);
f->datoffset=l;
......
......@@ -586,11 +586,11 @@ BOOL js_add_file(JSContext* js_cx, JSObject* array,
if(!JS_SetProperty(js_cx, file, "time", &val))
return(FALSE);
val=INT_TO_JSVAL(uploaded);
val=INT_TO_JSVAL((int32)uploaded);
if(!JS_SetProperty(js_cx, file, "uploaded", &val))
return(FALSE);
val=INT_TO_JSVAL(last_downloaded);
val=INT_TO_JSVAL((int32)last_downloaded);
if(!JS_SetProperty(js_cx, file, "last_downloaded", &val))
return(FALSE);
......@@ -1512,7 +1512,7 @@ static void send_thread(void* arg)
if(getfileixb(&scfg,&f)==TRUE && getfiledat(&scfg,&f)==TRUE) {
f.timesdled++;
putfiledat(&scfg,&f);
f.datedled=time(NULL);
f.datedled=time32(NULL);
putfileixb(&scfg,&f);
lprintf(LOG_INFO,"%04d %s downloaded: %s (%lu times total)"
......@@ -1761,7 +1761,7 @@ static void receive_thread(void* arg)
if(scfg.dir[f.dir]->misc&DIR_AONLY) /* Forced anonymous */
f.misc|=FM_ANON;
f.cdt=flength(xfer.filename);
f.dateuled=time(NULL);
f.dateuled=time32(NULL);
/* Desciption specified with DESC command? */
if(xfer.desc!=NULL && *xfer.desc!=0)
......@@ -2537,7 +2537,7 @@ static void ctrl_thread(void* arg)
/* Initialize client display */
client.size=sizeof(client);
client.time=time(NULL);
client.time=time32(NULL);
SAFECOPY(client.addr,host_ip);
SAFECOPY(client.host,host_name);
client.port=ntohs(ftp.client_addr.sin_port);
......@@ -2760,7 +2760,7 @@ static void ctrl_thread(void* arg)
lprintf(LOG_INFO,"%04d %s logged in (%u today, %u total)"
,sock,user.alias,user.ltoday+1, user.logons+1);
logintime=time(NULL);
timeleft=gettimeleft(&scfg,&user,logintime);
timeleft=(long)gettimeleft(&scfg,&user,logintime);
ftp_printfile(sock,"hello",230);
#ifdef JAVASCRIPT
......@@ -2800,7 +2800,7 @@ static void ctrl_thread(void* arg)
putuserrec(&scfg,user.number,U_MODEM,LEN_MODEM,"FTP");
putuserrec(&scfg,user.number,U_COMP,LEN_COMP,host_name);
putuserrec(&scfg,user.number,U_NOTE,LEN_NOTE,host_ip);
putuserrec(&scfg,user.number,U_LOGONTIME,0,ultoa(logintime,str,16));
putuserrec(&scfg,user.number,U_LOGONTIME,0,ultoa((ulong)logintime,str,16));
getuserdat(&scfg, &user); /* make user current */
continue;
......@@ -2814,7 +2814,7 @@ static void ctrl_thread(void* arg)
if(!(user.rest&FLAG('G')))
getuserdat(&scfg, &user); /* get current user data */
if((timeleft=gettimeleft(&scfg,&user,logintime))<1L) {
if((timeleft=(long)gettimeleft(&scfg,&user,logintime))<1L) {
sockprintf(sock,"421 Sorry, you've run out of time.");
lprintf(LOG_WARNING,"%04d Out of time, disconnecting",sock);
break;
......@@ -2851,7 +2851,7 @@ static void ctrl_thread(void* arg)
continue;
}
if(!stricmp(cmd, "SITE UPTIME")) {
sockprintf(sock,"211 %s (%lu served)",sectostr(time(NULL)-uptime,str),served);
sockprintf(sock,"211 %s (%lu served)",sectostr((uint)(time(NULL)-uptime),str),served);
continue;
}
if(!stricmp(cmd, "SITE RECYCLE") && user.level>=SYSOP_LEVEL) {
......
......@@ -141,8 +141,8 @@ void sbbs_t::nodesync()
if(!(sys_status&SS_NEWDAY)) {
now=time(NULL);
unixtodstr(&cfg,logontime,str);
unixtodstr(&cfg,now,today);
unixtodstr(&cfg,(time32_t)logontime,str);
unixtodstr(&cfg,(time32_t)now,today);
if(strcmp(str,today)) { /* New day, clear "today" user vars */
sys_status|=SS_NEWDAY; // So we don't keep doing this over&over
resetdailyuserdat(&cfg, &useron,/* write: */true);
......
......@@ -238,7 +238,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
bprintf(text[TiLogon],timestr(logontime));
bprintf(text[TiNow],timestr(now));
bprintf(text[TiTimeon]
,sectostr(now-logontime,tmp));
,sectostr((uint)(now-logontime),tmp));
bprintf(text[TiTimeLeft]
,sectostr(timeleft,tmp));
SYNC;
......
......@@ -251,7 +251,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
char tmp[128];
const char* p=NULL;
const char* nulstr="";
ulong val=0;
uint32 val=0;
jsint tiny;
sbbs_t* sbbs;
jsrefcount rc;
......@@ -270,19 +270,19 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
val=sbbs->startup->options;
break;
case BBS_PROP_ANSWER_TIME:
val=sbbs->answertime;
val=(uint32)sbbs->answertime;
break;
case BBS_PROP_LOGON_TIME:
val=sbbs->logontime;
val=(uint32)sbbs->logontime;
break;
case BBS_PROP_START_TIME:
val=sbbs->starttime;
val=(uint32)sbbs->starttime;
break;
case BBS_PROP_NS_TIME:
val=sbbs->ns_time;
val=(uint32)sbbs->ns_time;
break;
case BBS_PROP_LAST_NS_TIME:
val=sbbs->last_ns_time;
val=(uint32)sbbs->last_ns_time;
break;
case BBS_PROP_ONLINE:
val=sbbs->online;
......@@ -293,7 +293,7 @@ static JSBool js_bbs_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
JS_RESUMEREQUEST(cx, rc);
break;
case BBS_PROP_EVENT_TIME:
val=sbbs->event_time;
val=(uint32)sbbs->event_time;
break;
case BBS_PROP_EVENT_CODE:
p=sbbs->event_code;
......
......@@ -72,7 +72,7 @@ static JSBool js_client_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
{
jsval idval;
const char* p=NULL;
ulong val=0;
int32 val=0;
jsint tiny;
JSString* js_str;
client_t* client;
......@@ -94,7 +94,7 @@ static JSBool js_client_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
val=client->port;
break;
case CLIENT_PROP_TIME:
val=client->time;
val=(int32)client->time;
break;
case CLIENT_PROP_PROTOCOL:
p=(char*)client->protocol;
......
......@@ -73,8 +73,8 @@ enum {
static JSBool js_console_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
{
jsval idval;
ulong val;
jsval idval;
int32 val;
jsint tiny;
JSString* js_str;
sbbs_t* sbbs;
......@@ -123,7 +123,7 @@ static JSBool js_console_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
val=sbbs->cfg.sec_hangup;
break;
case CON_PROP_TIMEOUT:
val=sbbs->timeout;
val=(int32)sbbs->timeout;
break;
case CON_PROP_TIMELEFT_WARN:
val=sbbs->timeleft_warn;
......
......@@ -661,7 +661,7 @@ js_iniGetValue(JSContext *cx, uintN argc, jsval *arglist)
if((dflt_obj = JSVAL_TO_OBJECT(dflt))!=NULL && (strcmp("Date",JS_GetClass(cx, dflt_obj)->name)==0)) {
tt=(time_t)(js_DateGetMsecSinceEpoch(cx,dflt_obj)/1000.0);
rc=JS_SUSPENDREQUEST(cx);
dbl=iniReadDateTime(p->fp,section,key,tt);
dbl=(double)iniReadDateTime(p->fp,section,key,tt);
dbl *= 1000;
JS_RESUMEREQUEST(cx, rc);
date_obj = JS_NewDateObjectMsec(cx, dbl);
......@@ -1161,6 +1161,17 @@ And July-22-2010:
websrvr.dll!http_session_thread(void * arg) Line 5091 + 0xc bytes C
And Sept-17-2011:
JS_SetElement(JSContext * 0x058b7138, JSObject * 0x0578cd78, long 2, long * 0x084cb338) line 3178 + 32 bytes
js_iniGetAllObjects(JSContext * 0x058b7138, JSObject * 0x0578cd60, unsigned int 0, long * 0x063adfbc, long * 0x084cb460) line 1115 + 24 bytes
js_Invoke(JSContext * 0x058b7138, unsigned int 0, unsigned int 0) line 1375 + 23 bytes
js_Interpret(JSContext * 0x058b7138, unsigned char * 0x04e9298b, long * 0x084cc678) line 3944 + 15 bytes
js_Execute(JSContext * 0x058b7138, JSObject * 0x057b4b48, JSScript * 0x04e92880, JSStackFrame * 0x00000000, unsigned int 0, long * 0x084cc860) line 1633 + 19 bytes
JS_ExecuteScript(JSContext * 0x058b7138, JSObject * 0x057b4b48, JSScript * 0x04e92880, long * 0x084cc860) line 4188 + 25 bytes
exec_ssjs(http_session_t * 0x084ce0f0, char * 0x084ce221) line 4644 + 36 bytes
respond(http_session_t * 0x084ce0f0) line 4690 + 18 bytes
http_session_thread(void * 0x00000000) line 5098 + 12 bytes
*/
if(!JS_SetElement(cx, array, i, &val))
break;
......
......@@ -572,7 +572,7 @@ js_time(JSContext *cx, uintN argc, jsval *arglist)
{
JSObject *obj=JS_THIS_OBJECT(cx, arglist);
jsval *argv=JS_ARGV(cx, arglist);
JS_SET_RVAL(cx, arglist,UINT_TO_JSVAL(time(NULL)));
JS_SET_RVAL(cx, arglist,UINT_TO_JSVAL((uint32_t)time(NULL)));
return(JS_TRUE);
}
......@@ -1777,7 +1777,7 @@ js_html_encode(JSContext *cx, uintN argc, jsval *arglist)
case 'D':
now=time(NULL);
j+=sprintf(outbuf+j,"%s",unixtodstr(p->cfg,now,tmp1));
j+=sprintf(outbuf+j,"%s",unixtodstr(p->cfg,(time32_t)now,tmp1));
break;
case 'T':
now=time(NULL);
......@@ -2782,7 +2782,7 @@ js_utime(JSContext *cx, uintN argc, jsval *arglist)
ut.actime = ut.modtime = time(NULL);
if(argc>1) {
actime=modtime=ut.actime;
actime=modtime=(int32_t)ut.actime;
JS_ValueToInt32(cx,argv[1],&actime);
JS_ValueToInt32(cx,argv[2],&modtime);
ut.actime=actime;
......@@ -3224,7 +3224,7 @@ js_strftime(JSContext *cx, uintN argc, jsval *arglist)
jsval *argv=JS_ARGV(cx, arglist);
char str[128];
char* fmt;
int32 i=time(NULL);
int32 i=(int32_t)time(NULL);
time_t t;
struct tm tm;
JSString* js_str;
......
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