summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-09 20:30:47 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-09 20:30:47 +0300
commit407de0a8d0898b28a587962e997df816cb17b6a9 (patch)
tree99a0184bb44950a900a9f093afb8887bdd148548 /src/resources
parent972fdcbd1ed61e2528c8b4c733f21a70d7f674b1 (diff)
downloadmv-407de0a8d0898b28a587962e997df816cb17b6a9.tar.gz
mv-407de0a8d0898b28a587962e997df816cb17b6a9.tar.bz2
mv-407de0a8d0898b28a587962e997df816cb17b6a9.tar.xz
mv-407de0a8d0898b28a587962e997df816cb17b6a9.zip
Fix code style.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/beingcommon.cpp7
-rw-r--r--src/resources/inventory/inventory.cpp6
-rw-r--r--src/resources/loaders/xmlloader.cpp1
-rw-r--r--src/resources/mapreader.cpp4
-rw-r--r--src/resources/sdlgfxblitfunc.cpp2
5 files changed, 12 insertions, 8 deletions
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp
index ec3744da0..7401933a6 100644
--- a/src/resources/beingcommon.cpp
+++ b/src/resources/beingcommon.cpp
@@ -58,15 +58,16 @@ void BeingCommon::readWalkingAttributes(BeingInfo *const info,
XmlNodePtrConst node,
const int moreBlockFlags)
{
- unsigned char block = 0;
+ uint8_t block = 0;
std::string walkStr = XML::getProperty(
node, "walkType", "walk");
- const unsigned char allFlags = BlockMask::GROUND |
+ const uint8_t allFlags = CAST_U8(
+ BlockMask::GROUND |
BlockMask::WALL |
BlockMask::WATER |
BlockMask::AIR |
- moreBlockFlags;
+ moreBlockFlags);
StringVect tokens;
splitToStringVector(tokens, walkStr, ',');
FOR_EACH (StringVectCIter, it, tokens)
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp
index 97bb255fe..df7104d03 100644
--- a/src/resources/inventory/inventory.cpp
+++ b/src/resources/inventory/inventory.cpp
@@ -492,8 +492,12 @@ void Inventory::virtualRestore(const Item *const item,
mVirtualRemove[index] -= amount;
if (mVirtualRemove[index] < 0)
mVirtualRemove.erase(index);
- if (index < 0 || index >= CAST_S32(mSize) || (mItems[index] == nullptr))
+ if (index < 0 ||
+ index >= CAST_S32(mSize) ||
+ mItems[index] == nullptr)
+ {
return;
+ }
mItems[index]->mQuantity += amount;
}
}
diff --git a/src/resources/loaders/xmlloader.cpp b/src/resources/loaders/xmlloader.cpp
index 61618530e..2374e44d1 100644
--- a/src/resources/loaders/xmlloader.cpp
+++ b/src/resources/loaders/xmlloader.cpp
@@ -61,4 +61,3 @@ XML::Document *Loader::getXml(const std::string &idPath,
return static_cast<XML::Document*>(ResourceManager::get(
"xml_" + idPath, ResourceLoader::load, &rl));
}
-
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 22fcd7bd8..cc9a2917d 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -627,9 +627,9 @@ inline static void setTile(Map *const map,
case MapLayerType::HEIGHTS:
{
- if ((set == nullptr) || (heights == nullptr))
+ if (set == nullptr || heights == nullptr)
break;
- if ((heights != nullptr) && map->getVersion() >= 2)
+ if (map->getVersion() >= 2)
{
heights->setHeight(x, y, CAST_U8(
gid - set->getFirstGid() + 1));
diff --git a/src/resources/sdlgfxblitfunc.cpp b/src/resources/sdlgfxblitfunc.cpp
index 89fe0b21e..e635c20d5 100644
--- a/src/resources/sdlgfxblitfunc.cpp
+++ b/src/resources/sdlgfxblitfunc.cpp
@@ -337,7 +337,7 @@ static void _SDL_gfxBlitBlitterRGBA(SDL_gfxBlitInfo *info)
const int srcskip = info->s_skip;
Uint8 *dst = info->d_pixels;
const int dstskip = info->d_skip;
- SDL_PixelFormat *srcfmt = info->src;
+ const SDL_PixelFormat *const srcfmt = info->src;
while ((height--) != 0)
{