diff options
author | Paramat <paramat@users.noreply.github.com> | 2019-01-22 21:13:06 +0000 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2019-01-22 22:13:06 +0100 |
commit | bc1e54764b736310ca3797dc3e06fe8326949367 (patch) | |
tree | 5a45a9fccfee16faffb4b50231db539701002f38 /src | |
parent | 33afe1fb56273251400fed1eb13b2b407a3d0420 (diff) | |
download | minetest-bc1e54764b736310ca3797dc3e06fe8326949367.tar.gz minetest-bc1e54764b736310ca3797dc3e06fe8326949367.tar.bz2 minetest-bc1e54764b736310ca3797dc3e06fe8326949367.zip |
Fix warnings about dungeongen.cpp memcpy() and unused variable in MapBlock::deSerializeNetworkSpecific() (#8122)
* Fix warning about dungeongen.cpp memcpy()
* Fix unused variable in MapBlock::deSerializeNetworkSpecific()
* Fix unused variable a simpler way
Diffstat (limited to 'src')
-rw-r--r-- | src/mapblock.cpp | 7 | ||||
-rw-r--r-- | src/mapgen/dungeongen.cpp | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 734ea478d..0996dd168 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -557,9 +557,10 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk) void MapBlock::deSerializeNetworkSpecific(std::istream &is) { try { - const u8 version = readU8(is); - //if(version != 1) - // throw SerializationError("unsupported MapBlock version"); + readU8(is); + //const u8 version = readU8(is); + //if (version != 1) + //throw SerializationError("unsupported MapBlock version"); } catch(SerializationError &e) { warningstream<<"MapBlock::deSerializeNetworkSpecific(): Ignoring an error" diff --git a/src/mapgen/dungeongen.cpp b/src/mapgen/dungeongen.cpp index 32bea4caa..77ac05770 100644 --- a/src/mapgen/dungeongen.cpp +++ b/src/mapgen/dungeongen.cpp @@ -51,7 +51,7 @@ DungeonGen::DungeonGen(const NodeDefManager *ndef, #endif if (dparams) { - memcpy(&dp, dparams, sizeof(dp)); + dp = *dparams; } else { // Default dungeon parameters dp.seed = 0; |