mirror of
https://github.com/yuzu-emu/FasTC
synced 2024-11-22 10:24:02 +00:00
Add some static casts
This commit is contained in:
parent
ebfd8f8f81
commit
ce99d79bab
2 changed files with 4 additions and 4 deletions
|
@ -94,7 +94,7 @@ namespace FasTC {
|
|||
}
|
||||
|
||||
T LengthSq() const { return this->Dot(*this); }
|
||||
T Length() const { return sqrt(LengthSq()); }
|
||||
T Length() const { return static_cast<T>(sqrt(LengthSq())); }
|
||||
|
||||
void Normalize() {
|
||||
T len = Length();
|
||||
|
@ -110,7 +110,7 @@ namespace FasTC {
|
|||
const VectorTypeTwo &v2) {
|
||||
VectorTypeOne a(v1);
|
||||
for(int i = 0; i < VectorTypeOne::Size; i++) {
|
||||
a(i) += v2[i];
|
||||
a(i) += static_cast<VectorTypeOne::ScalarType>(v2[i]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace FasTC {
|
|||
const VectorTypeTwo &v2) {
|
||||
VectorTypeOne a(v1);
|
||||
for(int i = 0; i < VectorTypeOne::Size; i++) {
|
||||
a(i) -= v2[i];
|
||||
a(i) -= static_cast<VectorTypeOne::ScalarType>(v2[i]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ TEST(VectorBase, Addition) {
|
|||
EXPECT_NEAR(af[1], 5.2f, kEpsilon);
|
||||
|
||||
au = v2u - v2f;
|
||||
EXPECT_EQ(au[0], 3);
|
||||
EXPECT_EQ(au[0], 4);
|
||||
EXPECT_EQ(au[1], -1);
|
||||
|
||||
af = v2f - v2u;
|
||||
|
|
Loading…
Reference in a new issue