Browse Source

AP_Math: fixed warnings on bounds checking in quaternion

master
Andrew Tridgell 10 years ago
parent
commit
fefdc37a4d
  1. 4
      libraries/AP_Math/quaternion.h

4
libraries/AP_Math/quaternion.h

@ -91,7 +91,7 @@ public:
float & operator[](uint8_t i) { float & operator[](uint8_t i) {
float *_v = &q1; float *_v = &q1;
#if MATH_CHECK_INDEXES #if MATH_CHECK_INDEXES
assert(i >= 0 && i < 4); assert(i < 4);
#endif #endif
return _v[i]; return _v[i];
} }
@ -99,7 +99,7 @@ public:
const float & operator[](uint8_t i) const { const float & operator[](uint8_t i) const {
const float *_v = &q1; const float *_v = &q1;
#if MATH_CHECK_INDEXES #if MATH_CHECK_INDEXES
assert(i >= 0 && i < 4); assert(i < 4);
#endif #endif
return _v[i]; return _v[i];
} }

Loading…
Cancel
Save