Use right combination of casts

This commit is contained in:
Lorenz Meier 2014-02-23 19:05:32 -08:00
parent b4c1713b96
commit 76ac14d3c4
1 changed files with 2 additions and 2 deletions

View File

@ -1617,11 +1617,11 @@ void StoreStates(uint64_t timestamp_ms)
// Output the state vector stored at the time that best matches that specified by msec
void RecallStates(float (&statesForFusion)[n_states], uint64_t msec)
{
long int bestTimeDelta = 200;
int64_t bestTimeDelta = 200;
unsigned bestStoreIndex = 0;
for (unsigned storeIndex = 0; storeIndex < data_buffer_size; storeIndex++)
{
int64_t timeDelta = (int64_t)msec - statetimeStamp[storeIndex];
int64_t timeDelta = (int)msec - statetimeStamp[storeIndex];
if (timeDelta < 0) timeDelta = -timeDelta;
if (timeDelta < bestTimeDelta)
{