From 64aabf79b5a10bdf8192bb1048804a3e36730905 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 May 2014 22:47:30 +0300 Subject: Fix code style in resources. --- src/resources/sdlimagehelper.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/resources/sdlimagehelper.cpp') diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 7b9aeda5e..0858a9908 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -118,7 +118,7 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage, return nullptr; bool hasAlpha = false; - const int sz = tmpImage->w * tmpImage->h; + const size_t sz = tmpImage->w * tmpImage->h; // The alpha channel to be filled with alpha values uint8_t *alphaChannel = new uint8_t[sz]; @@ -126,7 +126,7 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage, const SDL_PixelFormat *const fmt = tmpImage->format; if (fmt->Amask) { - for (int i = 0; i < sz; ++ i) + for (size_t i = 0; i < sz; ++ i) { uint32_t c = (static_cast(tmpImage->pixels))[i]; @@ -202,7 +202,7 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) const converted = true; } - const int sz = tmpImage->w * tmpImage->h; + const size_t sz = tmpImage->w * tmpImage->h; // The alpha channel to be filled with alpha values uint8_t *alphaChannel = new uint8_t[sz]; @@ -217,7 +217,7 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) const const uint8_t ashift = fmt->Ashift; const uint8_t aloss = fmt->Aloss; const uint32_t *pixels = static_cast(tmpImage->pixels); - for (int i = 0; i < sz; ++ i) + for (size_t i = 0; i < sz; ++ i) { const unsigned v = (pixels[i] & amask) >> ashift; const uint8_t a = static_cast((v << aloss) -- cgit v1.2.3-60-g2f50