From 30a34d73f87f28a63b4451e823b6d10ee3fc5d9e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 29 May 2014 13:23:00 -0700 Subject: [PATCH] fix static analyzer warning: Result of 'calloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'uint32_t' --- include/llmr/geometry/sprite_atlas.hpp | 2 +- src/geometry/sprite_atlas.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llmr/geometry/sprite_atlas.hpp b/include/llmr/geometry/sprite_atlas.hpp index 220edc701..13b85e548 100644 --- a/include/llmr/geometry/sprite_atlas.hpp +++ b/include/llmr/geometry/sprite_atlas.hpp @@ -62,7 +62,7 @@ private: BinPack bin; std::map> images; std::set uninitialized; - char *data = nullptr; + uint32_t *data = nullptr; std::atomic dirty; uint32_t texture = 0; uint32_t filter = 0; diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp index 35f6f4588..4404695f9 100644 --- a/src/geometry/sprite_atlas.cpp +++ b/src/geometry/sprite_atlas.cpp @@ -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(width * pixelRatio); dimension h = static_cast(height * pixelRatio); - data = (char *)calloc(w * h, sizeof(uint32_t)); + data = (uint32_t *)calloc(w * h, sizeof(uint32_t)); } }