From: Paramat Date: Tue, 22 Jan 2019 21:13:06 +0000 (+0000) Subject: Fix warnings about dungeongen.cpp memcpy() and unused variable in MapBlock::deSeriali... X-Git-Tag: 5.0.0~70 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bc1e54764b736310ca3797dc3e06fe8326949367;p=oweals%2Fminetest.git 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 --- 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;