From 684293f5274a6b80b1596f4ea1189d702a0fcb2b Mon Sep 17 00:00:00 2001 From: cutealien Date: Sat, 8 Jan 2022 18:22:20 +0000 Subject: [PATCH] Prefer static_cast to reinterpret_cast where possible. Just safer. Could probably do in a lot more places... another time. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6293 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/CMeshBuffer.h | 4 ++-- source/Irrlicht/CAnimatedMeshSceneNode.cpp | 4 ++-- source/Irrlicht/CIrrDeviceWin32.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/CMeshBuffer.h b/include/CMeshBuffer.h index 05b8acdf..fe84fb9f 100644 --- a/include/CMeshBuffer.h +++ b/include/CMeshBuffer.h @@ -193,8 +193,8 @@ namespace scene Vertices.reallocate(vertexCount+numVertices); for (i=0; i(vertices)[i]); - BoundingBox.addInternalPoint(reinterpret_cast(vertices)[i].Pos); + Vertices.push_back(static_cast(vertices)[i]); + BoundingBox.addInternalPoint(static_cast(vertices)[i].Pos); } Indices.reallocate(getIndexCount()+numIndices); diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/source/Irrlicht/CAnimatedMeshSceneNode.cpp index 085ba631..15a00185 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -192,7 +192,7 @@ IMesh * CAnimatedMeshSceneNode::getMeshForCurrentFrame() // As multiple scene nodes may be sharing the same skinned mesh, we have to // re-animate it every frame to ensure that this node gets the mesh that it needs. - CSkinnedMesh* skinnedMesh = reinterpret_cast(Mesh); + CSkinnedMesh* skinnedMesh = static_cast(Mesh); if (JointMode == EJUOR_CONTROL)//write to mesh skinnedMesh->transferJointsToMesh(JointChildSceneNodes); @@ -747,7 +747,7 @@ void CAnimatedMeshSceneNode::animateJoints(bool CalculateAbsolutePositions) checkJoints(); const f32 frame = getFrameNr(); //old? - CSkinnedMesh* skinnedMesh=reinterpret_cast(Mesh); + CSkinnedMesh* skinnedMesh=static_cast(Mesh); skinnedMesh->transferOnlyJointsHintsToMesh( JointChildSceneNodes ); skinnedMesh->animateMesh(frame, 1.0f); diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index 985fec8e..101068e7 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -1140,7 +1140,7 @@ bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rect(windowId); + hwnd = static_cast(windowId); HDC dc = GetDC(hwnd);