diff --git a/libraries/AP_Math/matrix3.h b/libraries/AP_Math/matrix3.h index 4e3c7cf88f..902575bfd1 100644 --- a/libraries/AP_Math/matrix3.h +++ b/libraries/AP_Math/matrix3.h @@ -122,41 +122,10 @@ public: }; -#define MATRIX3_CTORS(name, type) \ - /* trivial ctor */ \ - name() {} \ - /* down casting ctor */ \ - name(const Matrix3 &m): Matrix3(m.a, m.b, m.c) {} \ - /* make a,b,c combination into a matrix */ \ - name(const Vector3 &a0, const Vector3 &b0, const Vector3 &c0) : Matrix3(a0, b0, c0) {} - -class Matrix3i : public Matrix3 -{ -public: - MATRIX3_CTORS(Matrix3i, int) -}; - -class Matrix3ui : public Matrix3 -{ -public: - MATRIX3_CTORS(Matrix3ui, unsigned int) -}; - -class Matrix3l : public Matrix3 -{ -public: - MATRIX3_CTORS(Matrix3l, long) -}; -class Matrix3ul : public Matrix3 -{ -public: - MATRIX3_CTORS(Matrix3ul, unsigned long) -}; - -class Matrix3f : public Matrix3 -{ -public: - MATRIX3_CTORS(Matrix3f, float) -}; +typedef Matrix3 Matrix3i; +typedef Matrix3 Matrix3ui; +typedef Matrix3 Matrix3l; +typedef Matrix3 Matrix3ul; +typedef Matrix3 Matrix3f; #endif // MATRIX3_H diff --git a/libraries/AP_Math/vector2.h b/libraries/AP_Math/vector2.h index f3a2a87234..bbe380aeb6 100644 --- a/libraries/AP_Math/vector2.h +++ b/libraries/AP_Math/vector2.h @@ -149,45 +149,10 @@ struct Vector2 }; - -// macro to make creating the ctors for derived vectors easier -#define VECTOR2_CTORS(name, type) \ - /* trivial ctor */ \ - name() {} \ - /* down casting ctor */ \ - name(const Vector2 &v): Vector2(v.x, v.y) {} \ - /* make x,y combination into a vector */ \ - name(type x0, type y0): Vector2(x0, y0) {} - - - -struct Vector2i: public Vector2 -{ - VECTOR2_CTORS(Vector2i, int) -}; - - -struct Vector2ui: public Vector2 -{ - VECTOR2_CTORS(Vector2ui, unsigned int) -}; - - -struct Vector2l: public Vector2 -{ - VECTOR2_CTORS(Vector2l, long) -}; - - -struct Vector2ul: public Vector2 -{ - VECTOR2_CTORS(Vector2ul, unsigned long) -}; - - -struct Vector2f: public Vector2 -{ - VECTOR2_CTORS(Vector2f, float) -}; +typedef Vector2 Vector2i; +typedef Vector2 Vector2ui; +typedef Vector2 Vector2l; +typedef Vector2 Vector2ul; +typedef Vector2 Vector2f; #endif // VECTOR2_H diff --git a/libraries/AP_Math/vector3.h b/libraries/AP_Math/vector3.h index ae141dd5da..7c23a5fc63 100644 --- a/libraries/AP_Math/vector3.h +++ b/libraries/AP_Math/vector3.h @@ -174,50 +174,10 @@ public: }; -// macro to make creating the ctors for derived vectors easier -#define VECTOR3_CTORS(name, type) \ - /* trivial ctor */ \ - name() {} \ - /* down casting ctor */ \ - name(const Vector3 &v): Vector3(v.x, v.y, v.z) {} \ - /* make x,y,z combination into a vector */ \ - name(type x0, type y0, type z0): Vector3(x0, y0, z0) {} - - - - -class Vector3i: public Vector3 -{ -public: - VECTOR3_CTORS(Vector3i, int) -}; - - -class Vector3ui: public Vector3 -{ -public: - VECTOR3_CTORS(Vector3ui, unsigned int) -}; - - -class Vector3l: public Vector3 -{ -public: - VECTOR3_CTORS(Vector3l, long) -}; - - -class Vector3ul: public Vector3 -{ -public: - VECTOR3_CTORS(Vector3ul, unsigned long) -}; - - -class Vector3f: public Vector3 -{ -public: - VECTOR3_CTORS(Vector3f, float) -}; +typedef Vector3 Vector3i; +typedef Vector3 Vector3ui; +typedef Vector3 Vector3l; +typedef Vector3 Vector3ul; +typedef Vector3 Vector3f; #endif // VECTOR3_H