Use int64_t for milliseconds more often, primarily for TimeUntilNextProcess.
This fixes a variety of MSVC warnings about value truncations when implicitly
storing the 64-bit values we get back from e.g. TimeTicks in 32-bit objects, and
removes the need for a number of explicit casts.
This also moves a number of constants so they're declared right where they're used, which is easier to read and maintain, and makes some of them of integral type rather than using the "enum hack".
BUG=chromium:81439
TEST=none
R=tommi@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/33649004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7905 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/utility/source/process_thread_impl.cc b/webrtc/modules/utility/source/process_thread_impl.cc
index bf7db3b..90f107c 100644
--- a/webrtc/modules/utility/source/process_thread_impl.cc
+++ b/webrtc/modules/utility/source/process_thread_impl.cc
@@ -130,12 +130,12 @@
{
// Wait for the module that should be called next, but don't block thread
// longer than 100 ms.
- int32_t minTimeToNext = 100;
+ int64_t minTimeToNext = 100;
{
CriticalSectionScoped lock(_critSectModules);
for (ModuleList::iterator iter = _modules.begin();
iter != _modules.end(); ++iter) {
- int32_t timeToNext = (*iter)->TimeUntilNextProcess();
+ int64_t timeToNext = (*iter)->TimeUntilNextProcess();
if(minTimeToNext > timeToNext)
{
minTimeToNext = timeToNext;
@@ -145,7 +145,8 @@
if(minTimeToNext > 0)
{
- if(kEventError == _timeEvent.Wait(minTimeToNext))
+ if(kEventError ==
+ _timeEvent.Wait(static_cast<unsigned long>(minTimeToNext)))
{
return true;
}
@@ -159,7 +160,7 @@
CriticalSectionScoped lock(_critSectModules);
for (ModuleList::iterator iter = _modules.begin();
iter != _modules.end(); ++iter) {
- int32_t timeToNext = (*iter)->TimeUntilNextProcess();
+ int64_t timeToNext = (*iter)->TimeUntilNextProcess();
if(timeToNext < 1)
{
(*iter)->Process();