Commit 8e8be7c2 by Nicolas Capens

Fix string format specifiers.

Bug 15387371 Change-Id: I0f86d5ddcef0c2b6fc45164c730eb55f44c5c490 Reviewed-on: https://swiftshader-review.googlesource.com/4492Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent c4748c50
......@@ -42,7 +42,7 @@ bool ValidateSerialNumber( const char* inSerialNumber, const char* checksum_key,
long long serial_number;
sscanf( decrypted_serial, "%2s%10llx%4x", dummy_prefix, &serial_number, &actual_checksum);
sscanf( decrypted_serial, "%2s%10llx%4lx", dummy_prefix, &serial_number, &actual_checksum);
strcpy(working_buffer, checksum_key);
strcat(working_buffer, decrypted_serial);
working_buffer[strlen(checksum_key) + PREFIX_LENGTH + ROOT_LENGTH] = '\0';
......
......@@ -174,7 +174,7 @@ StreamingIndexBuffer::StreamingIndexBuffer(unsigned int initialSize) : mBufferSi
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", initialSize);
ERR("Out of memory allocating an index buffer of size %u.", initialSize);
}
}
......@@ -231,10 +231,10 @@ void StreamingIndexBuffer::reserveSpace(unsigned int requiredSpace, GLenum type)
mBufferSize = std::max(requiredSpace, 2 * mBufferSize);
mIndexBuffer = new sw::Resource(mBufferSize + 16);
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating an index buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
......@@ -214,10 +214,10 @@ VertexBuffer::VertexBuffer(unsigned int size) : mVertexBuffer(NULL)
if(size > 0)
{
mVertexBuffer = new sw::Resource(size + 1024);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", size);
ERR("Out of memory allocating a vertex buffer of size %u.", size);
}
}
}
......@@ -307,10 +307,10 @@ void StreamingVertexBuffer::reserveRequiredSpace()
mBufferSize = std::max(mRequiredSpace, 3 * mBufferSize / 2); // 1.5 x mBufferSize is arbitrary and should be checked to see we don't have too many reallocations.
mVertexBuffer = new sw::Resource(mBufferSize);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating a vertex buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
......@@ -156,7 +156,7 @@ StreamingIndexBuffer::StreamingIndexBuffer(unsigned int initialSize) : mBufferSi
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", initialSize);
ERR("Out of memory allocating an index buffer of size %u.", initialSize);
}
}
......@@ -213,10 +213,10 @@ void StreamingIndexBuffer::reserveSpace(unsigned int requiredSpace, GLenum type)
mBufferSize = std::max(requiredSpace, 2 * mBufferSize);
mIndexBuffer = new sw::Resource(mBufferSize + 16);
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating an index buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
......@@ -208,10 +208,10 @@ VertexBuffer::VertexBuffer(unsigned int size) : mVertexBuffer(NULL)
if(size > 0)
{
mVertexBuffer = new sw::Resource(size + 1024);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", size);
ERR("Out of memory allocating a vertex buffer of size %u.", size);
}
}
}
......@@ -301,10 +301,10 @@ void StreamingVertexBuffer::reserveRequiredSpace()
mBufferSize = std::max(mRequiredSpace, 3 * mBufferSize / 2); // 1.5 x mBufferSize is arbitrary and should be checked to see we don't have too many reallocations.
mVertexBuffer = new sw::Resource(mBufferSize);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating a vertex buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
......@@ -170,7 +170,7 @@ StreamingIndexBuffer::StreamingIndexBuffer(unsigned int initialSize) : mIndexBuf
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", initialSize);
ERR("Out of memory allocating an index buffer of size %u.", initialSize);
}
}
......@@ -227,10 +227,10 @@ void StreamingIndexBuffer::reserveSpace(unsigned int requiredSpace, GLenum type)
mBufferSize = std::max(requiredSpace, 2 * mBufferSize);
mIndexBuffer = new sw::Resource(mBufferSize + 16);
if(!mIndexBuffer)
{
ERR("Out of memory allocating an index buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating an index buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
......@@ -222,10 +222,10 @@ VertexBuffer::VertexBuffer(unsigned int size) : mVertexBuffer(NULL)
if(size > 0)
{
mVertexBuffer = new sw::Resource(size + 1024);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", size);
ERR("Out of memory allocating a vertex buffer of size %u.", size);
}
}
}
......@@ -315,10 +315,10 @@ void StreamingVertexBuffer::reserveRequiredSpace()
mBufferSize = std::max(mRequiredSpace, 3 * mBufferSize / 2); // 1.5 x mBufferSize is arbitrary and should be checked to see we don't have too many reallocations.
mVertexBuffer = new sw::Resource(mBufferSize);
if(!mVertexBuffer)
{
ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
ERR("Out of memory allocating a vertex buffer of size %u.", mBufferSize);
}
mWritePosition = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment