mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 01:57:34 +08:00
constructors use array size rather than pointers
This commit is contained in:
@@ -38,7 +38,7 @@ public:
|
||||
*
|
||||
* @param data_ array
|
||||
*/
|
||||
AxisAngle(const Type *data_) :
|
||||
AxisAngle(const Type data_[3]) :
|
||||
Vector<Type, 3>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@ namespace matrix
|
||||
template <typename Type, size_t M>
|
||||
class Vector;
|
||||
|
||||
template<typename Type, size_t M, size_t N>
|
||||
template<typename Type, size_t M, size_t N>
|
||||
class Matrix
|
||||
{
|
||||
|
||||
@@ -35,12 +35,12 @@ public:
|
||||
// Constructors
|
||||
Matrix() = default;
|
||||
|
||||
Matrix(const Type data_[][N])
|
||||
Matrix(const Type data_[M*N])
|
||||
{
|
||||
memcpy(_data, data_, sizeof(_data));
|
||||
}
|
||||
|
||||
Matrix(const Type *data_)
|
||||
Matrix(const Type data_[M][N])
|
||||
{
|
||||
memcpy(_data, data_, sizeof(_data));
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
*
|
||||
* @param data_ array
|
||||
*/
|
||||
Quaternion(const Type *data_) :
|
||||
Quaternion(const Type data_[4]) :
|
||||
Vector<Type, 4>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class SquareMatrix : public Matrix<Type, M, M>
|
||||
public:
|
||||
SquareMatrix() = default;
|
||||
|
||||
SquareMatrix(const Type *data_) :
|
||||
SquareMatrix(const Type data_[M][M]) :
|
||||
Matrix<Type, M, M>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Vector(const Type *data_) :
|
||||
Vector(const Type data_[M]) :
|
||||
MatrixM1(data_)
|
||||
{
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Vector2(const Type *data_) :
|
||||
Vector2(const Type data_[2]) :
|
||||
Vector<Type, 2>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Vector3(const Type *data_) :
|
||||
Vector3(const Type data_[3]) :
|
||||
Vector<Type, 3>(data_)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user