From bc1e54764b736310ca3797dc3e06fe8326949367 Mon Sep 17 00:00:00 2001 From: Paramat Date: Tue, 22 Jan 2019 21:13:06 +0000 Subject: [PATCH] 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 --- src/mapblock.cpp | 7 ++++--- 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; -- 2.25.1