summaryrefslogtreecommitdiff
path: root/src/guichan/sdl/sdlimage.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-07 19:34:52 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-07 19:34:52 +0300
commit9e83411f7e4147d09af5a5006888dcc187ea0ef8 (patch)
treec084bdf8afabc6220779645dcb5dbf71af6a151f /src/guichan/sdl/sdlimage.cpp
parentbc7d91cc0c9c0f6dcad01d612932c6899afb5514 (diff)
downloadplus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.gz
plus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.bz2
plus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.tar.xz
plus-9e83411f7e4147d09af5a5006888dcc187ea0ef8.zip
Fix some warnings under gcc 4.7.
Diffstat (limited to 'src/guichan/sdl/sdlimage.cpp')
-rw-r--r--src/guichan/sdl/sdlimage.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/guichan/sdl/sdlimage.cpp b/src/guichan/sdl/sdlimage.cpp
index 12c5571cf..156b399b3 100644
--- a/src/guichan/sdl/sdlimage.cpp
+++ b/src/guichan/sdl/sdlimage.cpp
@@ -50,6 +50,8 @@
#include "guichan/exception.hpp"
#include "guichan/sdl/sdlpixel.hpp"
+#include "debug.h"
+
namespace gcn
{
SDLImage::SDLImage(SDL_Surface* surface, bool autoFree)
@@ -71,7 +73,7 @@ namespace gcn
int SDLImage::getWidth() const
{
- if (mSurface == NULL)
+ if (!mSurface)
{
throw GCN_EXCEPTION("Trying to get the width of "
"a non loaded image.");
@@ -82,7 +84,7 @@ namespace gcn
int SDLImage::getHeight() const
{
- if (mSurface == NULL)
+ if (!mSurface)
{
throw GCN_EXCEPTION("Trying to get the height of "
"a non loaded image.");
@@ -93,7 +95,7 @@ namespace gcn
Color SDLImage::getPixel(int x, int y)
{
- if (mSurface == NULL)
+ if (!mSurface)
{
throw GCN_EXCEPTION("Trying to get a pixel from a "
"non loaded image.");
@@ -104,7 +106,7 @@ namespace gcn
void SDLImage::putPixel(int x, int y, const Color& color)
{
- if (mSurface == NULL)
+ if (!mSurface)
{
throw GCN_EXCEPTION("Trying to put a pixel in a "
"non loaded image.");
@@ -115,7 +117,7 @@ namespace gcn
void SDLImage::convertToDisplayFormat()
{
- if (mSurface == NULL)
+ if (!mSurface)
{
throw GCN_EXCEPTION("Trying to convert a non loaded image "
"to display format.");
@@ -155,16 +157,16 @@ namespace gcn
{
tmp = SDL_DisplayFormatAlpha(mSurface);
SDL_FreeSurface(mSurface);
- mSurface = NULL;
+ mSurface = nullptr;
}
else
{
tmp = SDL_DisplayFormat(mSurface);
SDL_FreeSurface(mSurface);
- mSurface = NULL;
+ mSurface = nullptr;
}
- if (tmp == NULL)
+ if (!tmp)
throw GCN_EXCEPTION("Unable to convert image to display format.");
if (hasPink)