time_t conversions made explicit

This commit is contained in:
Arthur Dene Ice
2014-05-10 21:50:08 -07:00
parent 6985f90477
commit 5a49cdf938
10 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -941,7 +941,7 @@ void EQStream::SendSessionRequest()
EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(SessionRequest));
SessionRequest *Request=(SessionRequest *)out->pBuffer;
memset(Request,0,sizeof(SessionRequest));
Request->Session=htonl(time(nullptr));
Request->Session=htonl((u_long)time(nullptr));
Request->MaxLength=htonl(512);
_log(NET__NET_TRACE, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength));
+1 -1
View File
@@ -540,7 +540,7 @@ ENCODE(OP_TaskDescription)
outapp->WriteUInt32(in->ReadUInt32()); // Duration
outapp->WriteUInt32(in->ReadUInt32()); // Unknown
uint32 StartTime = in->ReadUInt32();
outapp->WriteUInt32(time(nullptr) - StartTime); // RoF has elapsed time here rather than starttime
outapp->WriteUInt32((uint32)(time(nullptr) - StartTime)); // RoF has elapsed time here rather than starttime
// Copy the rest of the packet verbatim
uint32 BytesLeftToCopy = in->size - in->GetReadPosition();
+1 -1
View File
@@ -72,7 +72,7 @@ int gettimeofday (timeval *tp, ...)
ftime (&tb);
tp->tv_sec = tb.time;
tp->tv_sec = (long)tb.time;
tp->tv_usec = tb.millitm * 1000;
return 0;