Skip to content

Commit

Permalink
When dealing with 32-bit timestamps from GetTickCount() use DWORD and…
Browse files Browse the repository at this point in the history
… (x-y) > diff rather than x > y + diff, etc. -- from 3c54d6d3
  • Loading branch information
Cockos Inc authored and Justin Frankel committed May 11, 2020
1 parent ad7ae9f commit fb1a68b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ninjam/server/usercon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,10 @@ int User_Group::Run()
// track bpm/bpi stuff
#ifdef _WIN32
DWORD now=GetTickCount();
if (now >= m_next_loop_time)
if (!m_next_loop_time || (now-m_next_loop_time) < 0x10000000)
{
m_next_loop_time = now + (60*1000*m_last_bpi) / (m_last_bpm?m_last_bpm:120);
if (!m_next_loop_time) m_next_loop_time++;
#else
struct timeval now;
gettimeofday(&now,NULL);
Expand Down

0 comments on commit fb1a68b

Please sign in to comment.