diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-12-19 16:58:25 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-12-19 16:58:25 +0400 |
commit | 2df2fd1d252fe1e53d86416070557dec8c996891 (patch) | |
tree | ddcd6134ec920442c481fd9de42f3a6d813b3f89 /src/lib/mathlib/math/Vector.hpp | |
parent | ba612c3ee8b88b9352e7cfa723997887dd736b76 (diff) | |
download | px4-firmware-2df2fd1d252fe1e53d86416070557dec8c996891.tar.gz px4-firmware-2df2fd1d252fe1e53d86416070557dec8c996891.tar.bz2 px4-firmware-2df2fd1d252fe1e53d86416070557dec8c996891.zip |
mathlib minor fixes
Diffstat (limited to 'src/lib/mathlib/math/Vector.hpp')
-rw-r--r-- | src/lib/mathlib/math/Vector.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/mathlib/math/Vector.hpp b/src/lib/mathlib/math/Vector.hpp index 2df87c74b..8d754a321 100644 --- a/src/lib/mathlib/math/Vector.hpp +++ b/src/lib/mathlib/math/Vector.hpp @@ -135,7 +135,7 @@ public: */ const Vector<N> &operator =(const Vector<N> &v) { memcpy(data, v.data, sizeof(data)); - return *reinterpret_cast<const Vector<N>*>(this); + return *static_cast<const Vector<N>*>(this); } /** @@ -180,7 +180,7 @@ public: * uniform scaling */ const Vector<N> operator /(const float num) const { - Vector<N> temp(*reinterpret_cast<const Vector<N>*>(this)); + Vector<N> temp(*static_cast<const Vector<N>*>(this)); return temp /= num; } @@ -190,7 +190,7 @@ public: const Vector<N> &operator +=(const Vector<N> &v) { for (unsigned int i = 0; i < N; i++) data[i] += v(i); - return *reinterpret_cast<const Vector<N>*>(this); + return *static_cast<const Vector<N>*>(this); } /** @@ -199,7 +199,7 @@ public: const Vector<N> &operator -=(const Vector<N> &v) { for (unsigned int i = 0; i < N; i++) data[i] -= v(i); - return *reinterpret_cast<const Vector<N>*>(this); + return *static_cast<const Vector<N>*>(this); } /** @@ -208,7 +208,7 @@ public: const Vector<N> &operator *=(const float num) { for (unsigned int i = 0; i < N; i++) data[i] *= num; - return *reinterpret_cast<const Vector<N>*>(this); + return *static_cast<const Vector<N>*>(this); } /** @@ -217,7 +217,7 @@ public: const Vector<N> &operator /=(const float num) { for (unsigned int i = 0; i < N; i++) data[i] /= num; - return *reinterpret_cast<const Vector<N>*>(this); + return *static_cast<const Vector<N>*>(this); } /** @@ -241,7 +241,7 @@ public: * gets the length of this vector */ float length() const { - return sqrtf(*this * *reinterpret_cast<const Vector<N>*>(this)); + return sqrtf(*this * *static_cast<const Vector<N>*>(this)); } /** |