1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Prevent ambiguity errors during compilation caused by the new dispatch system under x64 builds.

This commit is contained in:
Sandu Liviu Catalin 2016-08-25 01:01:03 +03:00
parent d449247b5e
commit fae1e51c7b
11 changed files with 127 additions and 46 deletions

View File

@ -666,7 +666,7 @@ template < typename T > struct SqDynArgMulFn
*/ */
T operator () (std::nullptr_t) const T operator () (std::nullptr_t) const
{ {
return (*mVar.value) * 0; return (*mVar.value) * static_cast< SQInteger >(0);
} }
}; };
@ -733,7 +733,7 @@ template < typename T > struct SqDynArgDivFn
*/ */
T operator () (std::nullptr_t) const T operator () (std::nullptr_t) const
{ {
return (*mVar.value) / 0; return (*mVar.value) / static_cast< SQInteger >(0);
} }
}; };
@ -800,7 +800,7 @@ template < typename T > struct SqDynArgModFn
*/ */
T operator () (std::nullptr_t) const T operator () (std::nullptr_t) const
{ {
return (*mVar.value) % 0; return (*mVar.value) % static_cast< SQInteger >(0);
} }
}; };

View File

@ -42,7 +42,7 @@ struct AABB
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a an equally sized and perfectly shaped box from a scalar value. * Construct a an equally sized and perfectly shaped box from a scalar value.
*/ */
AABB(Value sv); explicit AABB(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a an equally sized but imperfectly shaped box from individual components of a * Construct a an equally sized but imperfectly shaped box from individual components of a
@ -270,7 +270,7 @@ struct AABB
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(AABB(s, s, s, s, s, s)); return Cmp(AABB(s, s, s, s, s, s));
} }
@ -278,7 +278,16 @@ struct AABB
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
const Value v = static_cast< Value >(s);
return Cmp(AABB(v, v, v, v, v, v));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
const Value v = static_cast< Value >(s); const Value v = static_cast< Value >(s);
return Cmp(AABB(v, v, v, v, v, v)); return Cmp(AABB(v, v, v, v, v, v));

View File

@ -44,7 +44,7 @@ struct Circle
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a circle at position 0,0 using the specified radius. * Construct a circle at position 0,0 using the specified radius.
*/ */
Circle(Value rv); explicit Circle(Value rv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a circle at the specified position using the specified radius. * Construct a circle at the specified position using the specified radius.
@ -309,15 +309,23 @@ struct Circle
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Circle(s)); return Cmp(Circle(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Circle(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Circle(static_cast< Value >(s))); return Cmp(Circle(static_cast< Value >(s)));
} }

View File

@ -42,7 +42,7 @@ struct Color3
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a color with all components with the same specified color. * Construct a color with all components with the same specified color.
*/ */
Color3(Value sv); explicit Color3(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct with individually specified red, green and blue colors. * Construct with individually specified red, green and blue colors.
@ -372,7 +372,7 @@ struct Color3
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{ {
return Cmp(Color3(static_cast< Value >(s))); return Cmp(Color3(static_cast< Value >(s)));
} }
@ -380,7 +380,15 @@ struct Color3
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Float32 s) const Int32 Cmp(SQFloat s) const
{
return Cmp(Color3(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Color3(static_cast< Value >(s))); return Cmp(Color3(static_cast< Value >(s)));
} }

View File

@ -42,7 +42,7 @@ struct Color4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a color with all components with the same specified color. * Construct a color with all components with the same specified color.
*/ */
Color4(Value sv); explicit Color4(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct with individually specified red, green and blue colors. * Construct with individually specified red, green and blue colors.
@ -372,7 +372,7 @@ struct Color4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{ {
return Cmp(Color4(static_cast< Value >(s))); return Cmp(Color4(static_cast< Value >(s)));
} }
@ -380,7 +380,15 @@ struct Color4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Float32 s) const Int32 Cmp(SQFloat s) const
{
return Cmp(Color4(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Color4(static_cast< Value >(s))); return Cmp(Color4(static_cast< Value >(s)));
} }

View File

@ -43,7 +43,7 @@ struct Quaternion
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct from scalar value. * Construct from scalar value.
*/ */
Quaternion(Value sv); explicit Quaternion(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct from Euler angles (in degrees.) * Construct from Euler angles (in degrees.)
@ -263,15 +263,23 @@ struct Quaternion
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Quaternion(s)); return Cmp(Quaternion(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Quaternion(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Quaternion(static_cast< Value >(s))); return Cmp(Quaternion(static_cast< Value >(s)));
} }

View File

@ -44,7 +44,7 @@ struct Sphere
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a sphere at position 0,0,0 using the specified radius. * Construct a sphere at position 0,0,0 using the specified radius.
*/ */
Sphere(Value rv); explicit Sphere(Value rv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a sphere at the specified position using the specified radius. * Construct a sphere at the specified position using the specified radius.
@ -309,15 +309,23 @@ struct Sphere
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Sphere(s)); return Cmp(Sphere(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Sphere(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Sphere(static_cast< Value >(s))); return Cmp(Sphere(static_cast< Value >(s)));
} }

View File

@ -42,7 +42,7 @@ struct Vector2
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the same scalar value for all components. * Construct a vector with the same scalar value for all components.
*/ */
Vector2(Value sv); explicit Vector2(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the specified component values. * Construct a vector with the specified component values.
@ -257,15 +257,23 @@ struct Vector2
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Vector2(s)); return Cmp(Vector2(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Vector2(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Vector2(static_cast< Value >(s))); return Cmp(Vector2(static_cast< Value >(s)));
} }
@ -355,4 +363,4 @@ struct Vector2
} // Namespace:: SqMod } // Namespace:: SqMod
#endif // _BASE_VECTOR2_HPP_ #endif // _BASE_VECTOR2_HPP_

View File

@ -42,7 +42,7 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the same scalar value for all components. * Construct a vector with the same scalar value for all components.
*/ */
Vector2i(Value sv); explicit Vector2i(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the specified component values. * Construct a vector with the specified component values.
@ -137,7 +137,7 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Bitwise right shift assignment operator. * Bitwise right shift assignment operator.
*/ */
Vector2i & operator >>= (const Vector2i & v); Vector2i & operator >>= (const Vector2i & v);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Scalar value addition assignment operator. * Scalar value addition assignment operator.
@ -187,7 +187,7 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Scalar value bitwise right shift assignment operator. * Scalar value bitwise right shift assignment operator.
*/ */
Vector2i & operator >>= (Value s); Vector2i & operator >>= (Value s);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Pre-increment operator. * Pre-increment operator.
@ -207,7 +207,7 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Post-decrement operator. * Post-decrement operator.
*/ */
Vector2i operator -- (int); Vector2i operator -- (int);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Addition operator. * Addition operator.
@ -362,7 +362,7 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{ {
return Cmp(Vector2i(static_cast< Value >(s))); return Cmp(Vector2i(static_cast< Value >(s)));
} }
@ -370,7 +370,15 @@ struct Vector2i
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Float32 s) const Int32 Cmp(SQFloat s) const
{
return Cmp(Vector2i(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Vector2i(static_cast< Value >(s))); return Cmp(Vector2i(static_cast< Value >(s)));
} }
@ -460,4 +468,4 @@ struct Vector2i
} // Namespace:: SqMod } // Namespace:: SqMod
#endif // _BASE_VECTOR2I_HPP_ #endif // _BASE_VECTOR2I_HPP_

View File

@ -49,7 +49,7 @@ struct Vector3
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the same scalar value for all components. * Construct a vector with the same scalar value for all components.
*/ */
Vector3(Value sv); explicit Vector3(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the specified component values. * Construct a vector with the specified component values.
@ -264,15 +264,23 @@ struct Vector3
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Vector3(s)); return Cmp(Vector3(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Vector3(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Vector3(static_cast< Value >(s))); return Cmp(Vector3(static_cast< Value >(s)));
} }

View File

@ -42,7 +42,7 @@ struct Vector4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the same scalar value for all components. * Construct a vector with the same scalar value for all components.
*/ */
Vector4(Value sv); explicit Vector4(Value sv);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Construct a vector with the specified component values. * Construct a vector with the specified component values.
@ -162,7 +162,7 @@ struct Vector4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Post-decrement operator. * Post-decrement operator.
*/ */
Vector4 operator -- (int); Vector4 operator -- (int);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Addition operator. * Addition operator.
@ -262,15 +262,23 @@ struct Vector4
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Value s) const Int32 Cmp(SQFloat s) const
{ {
return Cmp(Vector4(s)); return Cmp(Vector4(static_cast< Value >(s)));
} }
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value. * Used by the script engine to compare an instance of this type with a scalar value.
*/ */
Int32 Cmp(Int32 s) const Int32 Cmp(SQInteger s) const
{
return Cmp(Vector4(static_cast< Value >(s)));
}
/* --------------------------------------------------------------------------------------------
* Used by the script engine to compare an instance of this type with a scalar value.
*/
Int32 Cmp(bool s) const
{ {
return Cmp(Vector4(static_cast< Value >(s))); return Cmp(Vector4(static_cast< Value >(s)));
} }
@ -375,4 +383,4 @@ struct Vector4
} // Namespace:: SqMod } // Namespace:: SqMod
#endif // _BASE_VECTOR4_HPP_ #endif // _BASE_VECTOR4_HPP_