mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-02 21:11:25 +12:00
C-style cast cleanup III
This commit is contained in:
parent
ad9c9f0183
commit
28eacc616a
18 changed files with 143 additions and 94 deletions
|
@ -114,7 +114,7 @@ struct size2_base
|
|||
template<typename NT>
|
||||
constexpr operator size2_base<NT>() const
|
||||
{
|
||||
return{ (NT)width, (NT)height };
|
||||
return{ static_cast<NT>(width), static_cast<NT>(height) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -142,11 +142,11 @@ struct position1_base
|
|||
template<typename RhsT>
|
||||
position1_base operator *(RhsT rhs) const
|
||||
{
|
||||
return{ T(x * rhs) };
|
||||
return{ static_cast<T>(x * rhs) };
|
||||
}
|
||||
position1_base operator *(const position1_base& rhs) const
|
||||
{
|
||||
return{ T(x * rhs.x) };
|
||||
return{ static_cast<T>(x * rhs.x) };
|
||||
}
|
||||
template<typename RhsT>
|
||||
position1_base operator /(RhsT rhs) const
|
||||
|
@ -225,7 +225,7 @@ struct position1_base
|
|||
template<typename NT>
|
||||
operator position1_base<NT>() const
|
||||
{
|
||||
return{ (NT)x };
|
||||
return{ static_cast<NT>(x) };
|
||||
}
|
||||
|
||||
double distance(const position1_base& to)
|
||||
|
@ -303,11 +303,11 @@ struct position2_base
|
|||
template<typename RhsT>
|
||||
constexpr position2_base operator *(RhsT rhs) const
|
||||
{
|
||||
return{ T(x * rhs), T(y * rhs) };
|
||||
return{ static_cast<T>(x * rhs), static_cast<T>(y * rhs) };
|
||||
}
|
||||
constexpr position2_base operator *(const position2_base& rhs) const
|
||||
{
|
||||
return{ T(x * rhs.x), T(y * rhs.y) };
|
||||
return{ static_cast<T>(x * rhs.x), static_cast<T>(y * rhs.y) };
|
||||
}
|
||||
template<typename RhsT>
|
||||
constexpr position2_base operator /(RhsT rhs) const
|
||||
|
@ -398,12 +398,12 @@ struct position2_base
|
|||
template<typename NT>
|
||||
constexpr operator position2_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y) };
|
||||
}
|
||||
|
||||
double distance(const position2_base& to) const
|
||||
{
|
||||
return std::sqrt(double((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y)));
|
||||
return std::sqrt((x - to.x) * (x - to.x) + (y - to.y) * (y - to.y));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -490,7 +490,7 @@ struct position3_base
|
|||
template<typename NT>
|
||||
operator position3_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)z };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -580,7 +580,7 @@ struct position4_base
|
|||
template<typename NT>
|
||||
constexpr operator position4_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)z, (NT)w };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z), static_cast<NT>(w) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -652,7 +652,7 @@ struct coord_base
|
|||
template<typename NT>
|
||||
constexpr operator coord_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)width, (NT)height };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(width), static_cast<NT>(height) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -755,13 +755,13 @@ struct area_base
|
|||
}
|
||||
constexpr area_base operator * (const f32& value) const
|
||||
{
|
||||
return{ (T)(x1 * value), (T)(y1 * value), (T)(x2 * value), (T)(y2 * value) };
|
||||
return{ static_cast<T>(x1 * value), static_cast<T>(y1 * value), static_cast<T>(x2 * value), static_cast<T>(y2 * value) };
|
||||
}
|
||||
|
||||
template<typename NT>
|
||||
constexpr operator area_base<NT>() const
|
||||
{
|
||||
return{ (NT)x1, (NT)y1, (NT)x2, (NT)y2 };
|
||||
return{ static_cast<NT>(x1), static_cast<NT>(y1), static_cast<NT>(x2), static_cast<NT>(y2) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -824,7 +824,7 @@ struct coord3_base
|
|||
template<typename NT>
|
||||
constexpr operator coord3_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)z, (NT)width, (NT)height, (NT)depth };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z), static_cast<NT>(width), static_cast<NT>(height), static_cast<NT>(depth) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -877,7 +877,7 @@ struct color4_base
|
|||
template<typename NT>
|
||||
constexpr operator color4_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)z, (NT)w };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z), static_cast<NT>(w) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -920,7 +920,7 @@ struct color3_base
|
|||
template<typename NT>
|
||||
constexpr operator color3_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y, (NT)z };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y), static_cast<NT>(z) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -962,7 +962,7 @@ struct color2_base
|
|||
template<typename NT>
|
||||
constexpr operator color2_base<NT>() const
|
||||
{
|
||||
return{ (NT)x, (NT)y };
|
||||
return{ static_cast<NT>(x), static_cast<NT>(y) };
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -993,7 +993,7 @@ struct color1_base
|
|||
template<typename NT>
|
||||
constexpr operator color1_base<NT>() const
|
||||
{
|
||||
return{ (NT)x };
|
||||
return{ static_cast<NT>(x) };
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue