1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Warnings fixes (#538)

Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
This commit is contained in:
Alexander Shishkin
2019-01-19 13:52:02 +03:00
committed by GitHub
parent 419fee1fb2
commit b00e935e4d
34 changed files with 67 additions and 71 deletions

View File

@ -319,7 +319,7 @@ namespace TriggeredEventsDetail
if(!data.isNull())
asVector.push_back(data);
return std::move(json);
return json;
}
}//namespace TriggeredEventsDetail
@ -393,7 +393,7 @@ void CMapFormatJson::serializeHeader(JsonSerializeFormat & handler)
handler.serializeInt("heroLevelLimit", mapHeader->levelLimit, 0);
//todo: support arbitrary percentage
handler.serializeEnum("difficulty", mapHeader->difficulty, HeaderDetail::difficultyMap);
handler.serializeEnum("difficulty", mapHeader->difficulty, HeaderDetail::difficultyDefault, HeaderDetail::difficultyMap);
serializePlayerInfo(handler);
@ -870,7 +870,7 @@ std::unique_ptr<CMap> CMapLoaderJson::loadMap()
map = result.get();
mapHeader = map;
readMap();
return std::move(result);
return result;
}
std::unique_ptr<CMapHeader> CMapLoaderJson::loadMapHeader()
@ -880,7 +880,7 @@ std::unique_ptr<CMapHeader> CMapLoaderJson::loadMapHeader()
std::unique_ptr<CMapHeader> result = std::unique_ptr<CMapHeader>(new CMapHeader());
mapHeader = result.get();
readHeader(false);
return std::move(result);
return result;
}
JsonNode CMapLoaderJson::getFromArchive(const std::string & archiveFilename)
@ -894,7 +894,7 @@ JsonNode CMapLoaderJson::getFromArchive(const std::string & archiveFilename)
JsonNode res(reinterpret_cast<char*>(data.first.get()), data.second);
return std::move(res);
return res;
}
void CMapLoaderJson::readMap()
@ -1330,7 +1330,7 @@ JsonNode CMapSaverJson::writeTerrainLevel(const int index)
row.Vector()[pos.x].String() = writeTerrainTile(map->getTile(pos));
}
return std::move(data);
return data;
}
void CMapSaverJson::writeTerrain()