diff --git a/src/array.h b/src/array.h index e38fae95..64f29512 100644 --- a/src/array.h +++ b/src/array.h @@ -191,8 +191,12 @@ public: if (toreserve <= (int)m_reserved) return; - Element *tmp = reinterpret_cast - (new uint8_t [sizeof(Element) * toreserve]); + /* This cast is not very nice, because we kill any alignment + * information we could have. But until C++ gives us the proper + * tools to deal with it, we assume new uint8_t[] returns properly + * aligned data. */ + Element *tmp = reinterpret_cast(reinterpret_cast + (new uint8_t[sizeof(Element) * toreserve])); for (int i = 0; i < m_count; i++) { new(&tmp[i]) Element(m_data[i]); diff --git a/src/gpu/vertexbuffer.cpp b/src/gpu/vertexbuffer.cpp index a3a75bb5..15b368c3 100644 --- a/src/gpu/vertexbuffer.cpp +++ b/src/gpu/vertexbuffer.cpp @@ -435,7 +435,7 @@ void VertexDeclaration::SetStream(VertexBuffer *vb, ShaderAttrib attr1, stride, (GLvoid const *)(uintptr_t)offset); break; default: - Log::Error("vertex usage %d is not supported yet\n"); + Log::Error("vertex usage %d is not supported yet\n", usage); break; } # endif