1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-04-01 10:06:40 +00:00

Remove redundant casts

This commit is contained in:
elsid 2021-05-04 13:18:44 +02:00
parent d9e7c2fb42
commit d5e28d7269
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ namespace Nif
osg::Quat NIFStream::getQuaternion() osg::Quat NIFStream::getQuaternion()
{ {
float f[4]; float f[4];
readLittleEndianBufferOfType<4, float>(inp, (float*)&f); readLittleEndianBufferOfType<4, float>(inp, f);
osg::Quat quat; osg::Quat quat;
quat.w() = f[0]; quat.w() = f[0];
quat.x() = f[1]; quat.x() = f[1];

View file

@ -49,7 +49,7 @@ template <typename T> inline void readLittleEndianDynamicBufferOfType(Files::ISt
template<typename type> type inline readLittleEndianType(Files::IStreamPtr &pIStream) template<typename type> type inline readLittleEndianType(Files::IStreamPtr &pIStream)
{ {
type val; type val;
readLittleEndianBufferOfType<1, type>(pIStream, (type*)&val); readLittleEndianBufferOfType<1, type>(pIStream, &val);
return val; return val;
} }
@ -99,21 +99,21 @@ public:
osg::Vec2f getVector2() osg::Vec2f getVector2()
{ {
osg::Vec2f vec; osg::Vec2f vec;
readLittleEndianBufferOfType<2,float>(inp, (float*)&vec._v[0]); readLittleEndianBufferOfType<2,float>(inp, vec._v);
return vec; return vec;
} }
osg::Vec3f getVector3() osg::Vec3f getVector3()
{ {
osg::Vec3f vec; osg::Vec3f vec;
readLittleEndianBufferOfType<3, float>(inp, (float*)&vec._v[0]); readLittleEndianBufferOfType<3, float>(inp, vec._v);
return vec; return vec;
} }
osg::Vec4f getVector4() osg::Vec4f getVector4()
{ {
osg::Vec4f vec; osg::Vec4f vec;
readLittleEndianBufferOfType<4, float>(inp, (float*)&vec._v[0]); readLittleEndianBufferOfType<4, float>(inp, vec._v);
return vec; return vec;
} }