Replace QVector, QList with std::vector, std::list

An exception is made of TexPool, which will need a
bit more testing before transitioning to std containers.

Also replace 'int' with 'size_t' where it is used only
as an array index.
This commit is contained in:
Jonas Kulla 2013-12-26 20:18:33 +01:00
parent 8215bc7e7d
commit 231e38ae8e
16 changed files with 188 additions and 165 deletions

View file

@ -22,9 +22,10 @@
#include "rwmem.h"
#include <SDL_rwops.h>
#include <QVector>
typedef QVector<char> ByteVec;
#include <vector>
typedef std::vector<char> ByteVec;
static inline ByteVec *
getRWPrivate(SDL_RWops *ops)
@ -62,7 +63,7 @@ static size_t SDL_RWopsWrite(SDL_RWops *ops, const void *buffer, size_t size, si
if (writeBytes == 1)
{
char byte = *static_cast<const char*>(buffer);
v->append(byte);
v->push_back(byte);
return 1;
}
@ -100,7 +101,7 @@ int RWMemGetData(SDL_RWops *ops, void *buffer)
ByteVec *v = getRWPrivate(ops);
if (buffer)
memcpy(buffer, v->constData(), v->size());
memcpy(buffer, &(*v)[0], v->size());
return v->size();
}