Replace useless reinterpret_cast by static_cast

Former-commit-id: f61d644d968d4fe9523a5cd122e11525a9c2765d
This commit is contained in:
Lynix
2016-04-07 04:20:18 +02:00
parent 9efed23cbc
commit a31a969409
17 changed files with 42 additions and 42 deletions

View File

@@ -115,7 +115,7 @@ namespace Nz
stream.Read(&triangles[0], header.num_tris*sizeof(MD2_Triangle));
BufferMapper<IndexBuffer> indexMapper(indexBuffer, BufferAccess_DiscardAndWrite);
UInt16* index = reinterpret_cast<UInt16*>(indexMapper.GetPointer());
UInt16* index = static_cast<UInt16*>(indexMapper.GetPointer());
for (unsigned int i = 0; i < header.num_tris; ++i)
{
@@ -190,7 +190,7 @@ namespace Nz
translate *= s;
BufferMapper<VertexBuffer> vertexMapper(vertexBuffer, BufferAccess_DiscardAndWrite);
MeshVertex* vertex = reinterpret_cast<MeshVertex*>(vertexMapper.GetPointer());
MeshVertex* vertex = static_cast<MeshVertex*>(vertexMapper.GetPointer());
/// Chargement des coordonnées de texture
const unsigned int indexFix[3] = {0, 2, 1}; // Pour respécifier les indices dans le bon ordre

View File

@@ -249,7 +249,7 @@ namespace Nz
VertexBufferRef vertexBuffer = VertexBuffer::New(VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent), vertexCount, parameters.storage);
BufferMapper<VertexBuffer> vertexMapper(vertexBuffer, BufferAccess_WriteOnly);
MeshVertex* vertex = reinterpret_cast<MeshVertex*>(vertexMapper.GetPointer());
MeshVertex* vertex = static_cast<MeshVertex*>(vertexMapper.GetPointer());
for (const MD5MeshParser::Vertex& md5Vertex : md5Mesh.vertices)
{
// Skinning MD5 (Formule d'Id Tech)

View File

@@ -14,25 +14,25 @@ namespace Nz
{
UInt32 Getter16(const void* buffer, unsigned int i)
{
const UInt16* ptr = reinterpret_cast<const UInt16*>(buffer);
const UInt16* ptr = static_cast<const UInt16*>(buffer);
return ptr[i];
}
UInt32 Getter32(const void* buffer, unsigned int i)
{
const UInt32* ptr = reinterpret_cast<const UInt32*>(buffer);
const UInt32* ptr = static_cast<const UInt32*>(buffer);
return ptr[i];
}
void Setter16(void* buffer, unsigned int i, UInt32 value)
{
UInt16* ptr = reinterpret_cast<UInt16*>(buffer);
UInt16* ptr = static_cast<UInt16*>(buffer);
ptr[i] = static_cast<UInt16>(value);
}
void Setter32(void* buffer, unsigned int i, UInt32 value)
{
UInt32* ptr = reinterpret_cast<UInt32*>(buffer);
UInt32* ptr = static_cast<UInt32*>(buffer);
ptr[i] = value;
}

View File

@@ -213,7 +213,7 @@ namespace Nz
Vector2i EventImpl::GetMousePosition(const Window& relativeTo)
{
HWND handle = reinterpret_cast<HWND>(relativeTo.GetHandle());
HWND handle = static_cast<HWND>(relativeTo.GetHandle());
if (handle)
{
POINT pos;
@@ -283,7 +283,7 @@ namespace Nz
void EventImpl::SetMousePosition(int x, int y, const Window& relativeTo)
{
HWND handle = reinterpret_cast<HWND>(relativeTo.GetHandle());
HWND handle = static_cast<HWND>(relativeTo.GetHandle());
if (handle)
{
POINT pos = {x, y};

View File

@@ -193,7 +193,7 @@ namespace Nz
bool WindowImpl::Create(WindowHandle handle)
{
m_handle = reinterpret_cast<HWND>(handle);
m_handle = static_cast<HWND>(handle);
if (!m_handle || !IsWindow(m_handle))
{
@@ -342,7 +342,7 @@ namespace Nz
#endif
if (cursor != WindowCursor_None)
m_cursor = reinterpret_cast<HCURSOR>(LoadImage(nullptr, windowsCursors[cursor], IMAGE_CURSOR, 0, 0, LR_SHARED));
m_cursor = static_cast<HCURSOR>(LoadImage(nullptr, windowsCursors[cursor], IMAGE_CURSOR, 0, 0, LR_SHARED));
else
m_cursor = nullptr;
@@ -1125,7 +1125,7 @@ namespace Nz
WindowImpl* me;
if (message == WM_CREATE)
{
me = reinterpret_cast<WindowImpl*>(reinterpret_cast<CREATESTRUCT*>(lParam)->lpCreateParams);
me = static_cast<WindowImpl*>(reinterpret_cast<CREATESTRUCT*>(lParam)->lpCreateParams);
SetWindowLongPtr(window, GWL_USERDATA, reinterpret_cast<LONG_PTR>(me));
}
else