Browse Source

core: fix a bad format string and disable an annoying warning in Array<>.

legacy
Sam Hocevar sam 12 years ago
parent
commit
5b57aa50fe
2 changed files with 7 additions and 3 deletions
  1. +6
    -2
      src/array.h
  2. +1
    -1
      src/gpu/vertexbuffer.cpp

+ 6
- 2
src/array.h View File

@@ -191,8 +191,12 @@ public:
if (toreserve <= (int)m_reserved)
return;

Element *tmp = reinterpret_cast<Element *>
(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<Element *>(reinterpret_cast<uintptr_t>
(new uint8_t[sizeof(Element) * toreserve]));
for (int i = 0; i < m_count; i++)
{
new(&tmp[i]) Element(m_data[i]);


+ 1
- 1
src/gpu/vertexbuffer.cpp View File

@@ -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


Loading…
Cancel
Save