Skip to content

Commit

Permalink
Fixes for VC6, long long is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed May 22, 2009
1 parent 8d39aec commit 65b9c00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions ext/ed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ ConnectionDescriptor::GetCommInactivityTimeout

float ConnectionDescriptor::GetCommInactivityTimeout()
{
return ((float)InactivityTimeout / 1000000LL);
return ((float)InactivityTimeout / 1000000);
}


Expand All @@ -1609,7 +1609,7 @@ ConnectionDescriptor::SetCommInactivityTimeout
int ConnectionDescriptor::SetCommInactivityTimeout (float value)
{
if (value > 0) {
InactivityTimeout = (Int64)(value * 1000000LL);
InactivityTimeout = (Int64)(value * 1000000);
return 1;
}
return 0;
Expand Down Expand Up @@ -1654,7 +1654,7 @@ DatagramDescriptor::GetCommInactivityTimeout

float DatagramDescriptor::GetCommInactivityTimeout()
{
return ((float)InactivityTimeout / 1000000LL);
return ((float)InactivityTimeout / 1000000);
}

/********************************************
Expand All @@ -1664,7 +1664,7 @@ DatagramDescriptor::SetCommInactivityTimeout
int DatagramDescriptor::SetCommInactivityTimeout (float value)
{
if (value > 0) {
InactivityTimeout = (Int64)(value * 1000000LL);
InactivityTimeout = (Int64)(value * 1000000);
return 1;
}
return 0;
Expand Down
14 changes: 5 additions & 9 deletions ext/em.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,25 +351,21 @@ EventMachine_t::_UpdateTime

void EventMachine_t::_UpdateTime()
{
#ifdef OS_UNIX
#if defined(OS_UNIX)
struct timeval tv;
gettimeofday (&tv, NULL);
gCurrentLoopTime = (((Int64)(tv.tv_sec)) * 1000000LL) + ((Int64)(tv.tv_usec));
#endif

#ifdef OS_WIN32
#elif defined(OS_WIN32)
unsigned tick = GetTickCount();
if (tick < gLastTickCount)
gTickCountTickover += 1;
gLastTickCount = tick;
gCurrentLoopTime = ((Int64)gTickCountTickover << 32) + (Int64)tick;
#endif

#ifndef OS_UNIX
#ifndef OS_WIN32
#else
gCurrentLoopTime = (Int64)time(NULL) * 1000000LL;
#endif
#endif
}

/*******************
Expand Down Expand Up @@ -2246,7 +2242,7 @@ EventMachine_t::GetHeartbeatInterval

float EventMachine_t::GetHeartbeatInterval()
{
return ((float)HeartbeatInterval / 1000000LL);
return ((float)HeartbeatInterval / 1000000);
}


Expand All @@ -2256,7 +2252,7 @@ EventMachine_t::SetHeartbeatInterval

int EventMachine_t::SetHeartbeatInterval(float interval)
{
int iv = (int)(interval * 1000000LL);
int iv = (int)(interval * 1000000);
if (iv > 0) {
HeartbeatInterval = iv;
return 1;
Expand Down

0 comments on commit 65b9c00

Please sign in to comment.