summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-10-29 02:02:04 +0300
committerAndrei Karas <akaras@inbox.ru>2018-10-29 02:02:04 +0300
commita6d18b282ab916c6536dc25516affeb9200043b6 (patch)
tree9980735a47cb2118999fb4f4dceaa52bf9f4fae7 /src/resources
parent98c74738f21d7ae256f1273b6c1614ee64e2a3ad (diff)
downloadplus-a6d18b282ab916c6536dc25516affeb9200043b6.tar.gz
plus-a6d18b282ab916c6536dc25516affeb9200043b6.tar.bz2
plus-a6d18b282ab916c6536dc25516affeb9200043b6.tar.xz
plus-a6d18b282ab916c6536dc25516affeb9200043b6.zip
Fix code style.s20181102
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/atlas/atlasresource.cpp4
-rw-r--r--src/resources/beingcommon.cpp6
-rw-r--r--src/resources/db/deaddb.cpp2
-rw-r--r--src/resources/db/itemdb.cpp6
-rw-r--r--src/resources/dye/dyepalette.cpp4
-rw-r--r--src/resources/dye/dyepalette_replaceacolor.cpp12
-rw-r--r--src/resources/dye/dyepalette_replaceaoglcolor.cpp12
-rw-r--r--src/resources/dye/dyepalette_replacescolor.cpp12
-rw-r--r--src/resources/dye/dyepalette_replacesoglcolor.cpp12
-rw-r--r--src/resources/image/image.cpp6
-rw-r--r--src/resources/openglimagehelper.cpp2
-rw-r--r--src/resources/resourcemanager/resourcemanager.cpp4
-rw-r--r--src/resources/safeopenglimagehelper.cpp2
-rw-r--r--src/resources/sdlgfxblitfunc.cpp2
-rw-r--r--src/resources/sdlimagehelper.cpp4
-rw-r--r--src/resources/sprite/animatedsprite.cpp2
16 files changed, 46 insertions, 46 deletions
diff --git a/src/resources/atlas/atlasresource.cpp b/src/resources/atlas/atlasresource.cpp
index 3288bb27b..01029a3d6 100644
--- a/src/resources/atlas/atlasresource.cpp
+++ b/src/resources/atlas/atlasresource.cpp
@@ -58,7 +58,7 @@ AtlasResource::~AtlasResource()
void AtlasResource::incRef()
{
- if (mRefCount == 0u)
+ if (mRefCount == 0U)
AtlasManager::injectToResources(this);
Resource::incRef();
}
@@ -66,7 +66,7 @@ void AtlasResource::incRef()
void AtlasResource::decRef()
{
Resource::decRef();
- if (mRefCount == 0u)
+ if (mRefCount == 0U)
AtlasManager::moveToDeleted(this);
}
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp
index 02b342e34..cef275bd1 100644
--- a/src/resources/beingcommon.cpp
+++ b/src/resources/beingcommon.cpp
@@ -232,13 +232,13 @@ bool BeingCommon::readObjectNodes(XmlNodePtrConst &spriteNode,
"missile-particle", "");
const float missileZ = XML::getFloatProperty(
- spriteNode, "missile-z", 32.0f);
+ spriteNode, "missile-z", 32.0F);
const int missileLifeTime = XML::getProperty(
spriteNode, "missile-lifetime", 500);
const float missileSpeed = XML::getFloatProperty(
- spriteNode, "missile-speed", 7.0f);
+ spriteNode, "missile-speed", 7.0F);
const float missileDieDistance = XML::getFloatProperty(
- spriteNode, "missile-diedistance", 8.0f);
+ spriteNode, "missile-diedistance", 8.0F);
currentInfo->addAttack(attackId,
spriteAction,
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index 5f5e2db5a..cd921d05a 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -102,7 +102,7 @@ void DeadDB::unload()
std::string DeadDB::getRandomString()
{
const size_t sz = mMessages.size();
- if (sz == 0u)
+ if (sz == 0U)
return std::string();
return translator->getStr(mMessages[rand() % sz]);
}
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index d6889bd83..78ac033a6 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -369,13 +369,13 @@ void ItemDB::loadXmlFile(const std::string &fileName,
std::string missileParticle = XML::getProperty(
node, "missile-particle", "");
float missileZ = XML::getFloatProperty(
- node, "missile-z", 32.0f);
+ node, "missile-z", 32.0F);
int missileLifeTime = XML::getProperty(
node, "missile-lifetime", 500);
float missileSpeed = XML::getFloatProperty(
- node, "missile-speed", 7.0f);
+ node, "missile-speed", 7.0F);
float missileDieDistance = XML::getFloatProperty(
- node, "missile-diedistance", 8.0f);
+ node, "missile-diedistance", 8.0F);
int hitEffectId = XML::getProperty(node, "hit-effect-id",
paths.getIntValue("hitEffectId"));
int criticalEffectId = XML::getProperty(
diff --git a/src/resources/dye/dyepalette.cpp b/src/resources/dye/dyepalette.cpp
index d5fab2550..f250b36f6 100644
--- a/src/resources/dye/dyepalette.cpp
+++ b/src/resources/dye/dyepalette.cpp
@@ -253,7 +253,7 @@ void DyePalette::initFunctions()
{
#ifdef SIMD_SUPPORTED
const uint32_t flags = Cpu::getFlags();
- if ((flags & Cpu::FEATURE_AVX2) != 0u)
+ if ((flags & Cpu::FEATURE_AVX2) != 0U)
{
funcReplaceSColor = &DyePalette::replaceSColorAvx2;
funcReplaceSColorAvx2 = &DyePalette::replaceSColorAvx2;
@@ -271,7 +271,7 @@ void DyePalette::initFunctions()
funcReplaceAOGLColorSse2 = &DyePalette::replaceAOGLColorSse2;
#endif // USE_OPENGL
}
- else if ((flags & Cpu::FEATURE_SSE2) != 0u)
+ else if ((flags & Cpu::FEATURE_SSE2) != 0U)
{
funcReplaceSColor = &DyePalette::replaceSColorSse2;
funcReplaceSColorAvx2 = &DyePalette::replaceSColorSse2;
diff --git a/src/resources/dye/dyepalette_replaceacolor.cpp b/src/resources/dye/dyepalette_replaceacolor.cpp
index 5d94d9a1f..3ca757021 100644
--- a/src/resources/dye/dyepalette_replaceacolor.cpp
+++ b/src/resources/dye/dyepalette_replaceacolor.cpp
@@ -41,9 +41,9 @@ void DyePalette::replaceAColorDefault(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
@@ -101,9 +101,9 @@ void DyePalette::replaceAColorSse2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
const int mod = bufSize % 4;
const int bufEnd = bufSize - mod;
@@ -172,9 +172,9 @@ void DyePalette::replaceAColorAvx2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
const int mod = bufSize % 8;
const int bufEnd = bufSize - mod;
diff --git a/src/resources/dye/dyepalette_replaceaoglcolor.cpp b/src/resources/dye/dyepalette_replaceaoglcolor.cpp
index ec999812a..e50136783 100644
--- a/src/resources/dye/dyepalette_replaceaoglcolor.cpp
+++ b/src/resources/dye/dyepalette_replaceaoglcolor.cpp
@@ -43,9 +43,9 @@ void DyePalette::replaceAOGLColorDefault(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
@@ -104,9 +104,9 @@ void DyePalette::replaceAOGLColorSse2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
if (bufSize >= 8)
@@ -188,9 +188,9 @@ void DyePalette::replaceAOGLColorAvx2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
if (bufSize >= 8)
diff --git a/src/resources/dye/dyepalette_replacescolor.cpp b/src/resources/dye/dyepalette_replacescolor.cpp
index 80b82751d..4c987aa9d 100644
--- a/src/resources/dye/dyepalette_replacescolor.cpp
+++ b/src/resources/dye/dyepalette_replacescolor.cpp
@@ -41,9 +41,9 @@ void DyePalette::replaceSColorDefault(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
@@ -102,9 +102,9 @@ void DyePalette::replaceSColorSse2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
const int mod = bufSize % 8;
const int bufEnd = bufSize - mod;
@@ -183,9 +183,9 @@ void DyePalette::replaceSColorAvx2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if (sz == 0u || pixels == nullptr)
+ if (sz == 0U || pixels == nullptr)
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
const int mod = bufSize % 8;
const int bufEnd = bufSize - mod;
diff --git a/src/resources/dye/dyepalette_replacesoglcolor.cpp b/src/resources/dye/dyepalette_replacesoglcolor.cpp
index 7e435d936..4483ed02b 100644
--- a/src/resources/dye/dyepalette_replacesoglcolor.cpp
+++ b/src/resources/dye/dyepalette_replacesoglcolor.cpp
@@ -43,9 +43,9 @@ void DyePalette::replaceSOGLColorDefault(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
@@ -104,9 +104,9 @@ void DyePalette::replaceSOGLColorSse2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
if (bufSize >= 8)
@@ -190,9 +190,9 @@ void DyePalette::replaceSOGLColorAvx2(uint32_t *restrict pixels,
{
STD_VECTOR<DyeColor>::const_iterator it_end = mColors.end();
const size_t sz = mColors.size();
- if ((sz == 0u) || (pixels == nullptr))
+ if ((sz == 0U) || (pixels == nullptr))
return;
- if ((sz % 2) != 0u)
+ if ((sz % 2) != 0U)
-- it_end;
if (bufSize >= 8)
diff --git a/src/resources/image/image.cpp b/src/resources/image/image.cpp
index 92cdbee43..69f6da98c 100644
--- a/src/resources/image/image.cpp
+++ b/src/resources/image/image.cpp
@@ -196,7 +196,7 @@ Image::Image(const GLuint glimage, const int width, const int height,
mBounds.w = CAST_U16(width);
mBounds.h = CAST_U16(height);
- if (mGLImage != 0u)
+ if (mGLImage != 0U)
{
mLoaded = true;
}
@@ -249,7 +249,7 @@ void Image::unload()
#endif // USE_SDL2
#ifdef USE_OPENGL
- if (mGLImage != 0u)
+ if (mGLImage != 0U)
{
glDeleteTextures(1, &mGLImage);
mGLImage = 0;
@@ -521,7 +521,7 @@ int Image::calcMemoryLocal() const
#ifdef USE_OPENGL
void Image::decRef()
{
- if ((mGLImage != 0u) && mRefCount <= 1)
+ if ((mGLImage != 0U) && mRefCount <= 1)
OpenGLImageHelper::invalidate(mGLImage);
Resource::decRef();
}
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 1b0ce9979..a2aa72958 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -412,7 +412,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
MSDL_FreeSurface(tmpImage);
GLenum error = graphicsManager.getLastError();
- if (error != 0u)
+ if (error != 0U)
{
std::string errmsg = GraphicsManager::errorToString(error);
reportAlways("Error: Image GL import failed: %s (%u)",
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp
index 5cbf005aa..9ed7b6dde 100644
--- a/src/resources/resourcemanager/resourcemanager.cpp
+++ b/src/resources/resourcemanager/resourcemanager.cpp
@@ -327,7 +327,7 @@ void clearDeleted(const bool full)
std::set<Resource*>::iterator resDelIter = mDeletedResources.begin();
while (resDelIter != mDeletedResources.end())
{
- if ((*resDelIter)->mRefCount == 0u)
+ if ((*resDelIter)->mRefCount == 0U)
{
status = true;
Resource *res = *resDelIter;
@@ -604,7 +604,7 @@ void deleteInstance()
const Resource *const res = iter->second;
if (res != nullptr)
{
- if (res->mRefCount != 0u)
+ if (res->mRefCount != 0U)
{
logger->log(std::string("ResourceLeak: ").append(
res->mIdPath).append(" (").append(toString(
diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp
index 11fcfd4b6..70b2c31a1 100644
--- a/src/resources/safeopenglimagehelper.cpp
+++ b/src/resources/safeopenglimagehelper.cpp
@@ -387,7 +387,7 @@ Image *SafeOpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
MSDL_FreeSurface(tmpImage);
GLenum error = graphicsManager.getLastError();
- if (error != 0u)
+ if (error != 0U)
{
std::string errmsg = GraphicsManager::errorToString(error);
logger->log("Error: Image GL import failed: %s (%u)",
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index c2d66a68f..d72e7fbc5 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -397,7 +397,7 @@ static int _SDL_gfxBlitRGBACall(const SDL_Surface *const src,
/*
* Set up source and destination buffer pointers, then blit
*/
- if ((srcrect->w != 0u) && (srcrect->h != 0u))
+ if ((srcrect->w != 0U) && (srcrect->h != 0U))
{
SDL_gfxBlitInfo info;
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 1d51bb4cc..2c5970a49 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -153,7 +153,7 @@ Image *SDLImageHelper::createTextSurface(SDL_Surface *const tmpImage,
uint8_t *alphaChannel = new uint8_t[sz];
const SDL_PixelFormat *const fmt = tmpImage->format;
- if (fmt->Amask != 0u)
+ if (fmt->Amask != 0U)
{
for (size_t i = 0; i < sz; ++ i)
{
@@ -241,7 +241,7 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage)
if (tmpImage->format->palette == nullptr)
{
const SDL_PixelFormat *const fmt = tmpImage->format;
- if (fmt->Amask != 0u)
+ if (fmt->Amask != 0U)
{
const uint32_t amask = fmt->Amask;
const uint8_t ashift = fmt->Ashift;
diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp
index 476a45f35..965cffbec 100644
--- a/src/resources/sprite/animatedsprite.cpp
+++ b/src/resources/sprite/animatedsprite.cpp
@@ -461,7 +461,7 @@ bool AnimatedSprite::updateNumber(const unsigned num) restrict2
{
mNumber1 = num;
mNumber = mSprite->findNumber(num);
- if (mNumber == 0u)
+ if (mNumber == 0U)
{
mNumber = 100;
return false;