From ee1a05faf157c8c9f0f43cf5b906d84f39ded497 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 28 Aug 2013 15:53:18 +0300 Subject: fix compilation errors and warnings in debug checkers. --- src/resources/atlasmanager.cpp | 9 ++++++--- src/resources/image.cpp | 7 ++++--- src/resources/resourcemanager.cpp | 9 ++++++--- src/resources/sdlimagehelper.cpp | 2 ++ src/resources/subimage.cpp | 6 ++++-- 5 files changed, 22 insertions(+), 11 deletions(-) (limited to 'src/resources') diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index 3b8f6a326..015ad0c93 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -125,7 +125,8 @@ void AtlasManager::loadImages(const StringVect &files, { image->mIdPath = str; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", image, image->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(image), + image->mIdPath.c_str()); #endif images.push_back(image); } @@ -274,7 +275,8 @@ void AtlasManager::convertAtlas(TextureAtlas *const atlas) image->mIdPath = atlas->name; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", image, image->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(image), + image->mIdPath.c_str()); #endif image->incRef(); @@ -291,7 +293,8 @@ void AtlasManager::convertAtlas(TextureAtlas *const atlas) { image2->mIdPath = item->name; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", image2, image2->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(image2), + image2->mIdPath.c_str()); #endif image2->incRef(); } diff --git a/src/resources/image.cpp b/src/resources/image.cpp index b5a852996..cd8231e7b 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -115,7 +115,7 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0, mIsAlphaCalculated(false) { #ifdef DEBUG_IMAGES - logger->log("created: %p", this); + logger->log("created: %p", static_cast(this)); #endif mBounds.x = 0; @@ -159,7 +159,7 @@ Image::Image(const GLuint glimage, const int width, const int height, mIsAlphaCalculated(false) { #ifdef DEBUG_IMAGES - logger->log("created: %p", this); + logger->log("created: %p", static_cast(this)); #endif mBounds.x = 0; @@ -182,7 +182,8 @@ Image::Image(const GLuint glimage, const int width, const int height, Image::~Image() { #ifdef DEBUG_IMAGES - logger->log("delete: %p, %s, %s", this, mIdPath.c_str(), mSource.c_str()); + logger->log("delete: %p, %s, %s", static_cast(this), + mIdPath.c_str(), mSource.c_str()); #endif unload(); } diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 662024f36..3d13e6e00 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -450,7 +450,8 @@ bool ResourceManager::addResource(const std::string &idPath, resource->incRef(); resource->mIdPath = idPath; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", resource, resource->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(resource), + resource->mIdPath.c_str()); #endif mResources[idPath] = resource; return true; @@ -522,7 +523,8 @@ Resource *ResourceManager::get(const std::string &idPath, const generator fun, resource->incRef(); resource->mIdPath = idPath; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", resource, resource->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(resource), + resource->mIdPath.c_str()); #endif mResources[idPath] = resource; cleanOrphans(); @@ -539,7 +541,8 @@ Resource *ResourceManager::get(const std::string &idPath, const generator fun, resource->incRef(); resource->mIdPath = idPath; #ifdef DEBUG_IMAGES - logger->log("set name %p, %s", resource, resource->mIdPath.c_str()); + logger->log("set name %p, %s", static_cast(resource), + resource->mIdPath.c_str()); #endif } else diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index cc5460fde..cf8d1d04a 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -33,6 +33,8 @@ #include "resources/image.h" +#include "utils/sdlcheckutils.h" + #include #include diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp index 8a8fa2735..a13a885bb 100644 --- a/src/resources/subimage.cpp +++ b/src/resources/subimage.cpp @@ -105,7 +105,8 @@ SubImage::SubImage(Image *const parent, SDL_Surface *const image, mAlphaChannel = mParent->SDLgetAlphaChannel(); mSource = parent->getIdPath(); #ifdef DEBUG_IMAGES - logger->log("set name2 %p, %s", this, mSource.c_str()); + logger->log("set name2 %p, %s", static_cast(this), + mSource.c_str()); #endif #ifdef DEBUG_BIND_TEXTURE mIdPath = parent->getIdPath(); @@ -164,7 +165,8 @@ SubImage::SubImage(Image *const parent, const GLuint image, mInternalBounds.h = mParent->mBounds.h; mSource = parent->getIdPath(); #ifdef DEBUG_IMAGES - logger->log("set name2 %p, %s", this, mSource.c_str()); + logger->log("set name2 %p, %s", static_cast(this), + mSource.c_str()); #endif #ifdef DEBUG_BIND_TEXTURE mIdPath = parent->getIdPath(); -- cgit v1.2.3-60-g2f50