diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-29 12:59:04 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-29 12:59:04 +0200 |
commit | 0426fd3a52888277bcb612c57488e9de33432134 (patch) | |
tree | 77f68a266f5a2bc91fb1c5564f4c776c9e781c49 /src/modules/ekf_att_pos_estimator | |
parent | 2b3241470996d333d78fa9e78fea9b35fee7e18c (diff) | |
download | px4-firmware-0426fd3a52888277bcb612c57488e9de33432134.tar.gz px4-firmware-0426fd3a52888277bcb612c57488e9de33432134.tar.bz2 px4-firmware-0426fd3a52888277bcb612c57488e9de33432134.zip |
estimator: Fix local variable compile warnings.
Diffstat (limited to 'src/modules/ekf_att_pos_estimator')
-rw-r--r-- | src/modules/ekf_att_pos_estimator/estimator_23states.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp index 7f5968363..e4b0c2b14 100644 --- a/src/modules/ekf_att_pos_estimator/estimator_23states.cpp +++ b/src/modules/ekf_att_pos_estimator/estimator_23states.cpp @@ -1760,21 +1760,21 @@ int AttPosEKF::RecallStates(float* statesForFusion, uint64_t msec) int64_t bestTimeDelta = 200; unsigned bestStoreIndex = 0; - for (unsigned storeIndex = 0; storeIndex < data_buffer_size; storeIndex++) + for (unsigned storeIndexLocal = 0; storeIndexLocal < data_buffer_size; storeIndexLocal++) { // Work around a GCC compiler bug - we know 64bit support on ARM is // sketchy in GCC. uint64_t timeDelta; - if (msec > statetimeStamp[storeIndex]) { - timeDelta = msec - statetimeStamp[storeIndex]; + if (msec > statetimeStamp[storeIndexLocal]) { + timeDelta = msec - statetimeStamp[storeIndexLocal]; } else { - timeDelta = statetimeStamp[storeIndex] - msec; + timeDelta = statetimeStamp[storeIndexLocal] - msec; } - if (timeDelta < bestTimeDelta) + if (timeDelta < (uint64_t)bestTimeDelta) { - bestStoreIndex = storeIndex; + bestStoreIndex = storeIndexLocal; bestTimeDelta = timeDelta; } } |