Merge pull request #275 from mapbox/correct-calloc

Correct calloc
This commit is contained in:
Konstantin Käfer
2014-05-30 11:26:19 +02:00
2 changed files with 3 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ private:
BinPack<dimension> bin;
std::map<std::string, Rect<dimension>> images;
std::set<std::string> uninitialized;
char *data = nullptr;
uint32_t *data = nullptr;
std::atomic<bool> dirty;
uint32_t texture = 0;
uint32_t filter = 0;

View File

@@ -30,7 +30,7 @@ bool SpriteAtlas::resize(const float newRatio) {
pixelRatio = newRatio;
if (data) {
char *old_data = data;
uint32_t *old_data = data;
data = nullptr;
allocate();
@@ -185,7 +185,7 @@ void SpriteAtlas::allocate() {
if (!data) {
dimension w = static_cast<dimension>(width * pixelRatio);
dimension h = static_cast<dimension>(height * pixelRatio);
data = (char *)calloc(w * h, sizeof(uint32_t));
data = (uint32_t *)calloc(w * h, sizeof(uint32_t));
}
}