summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Ouellette <oue.paul18@gmail.com>2020-08-01 11:25:33 -0400
committerGitHub <noreply@github.com>2020-08-01 17:25:33 +0200
commit542df11bed89ebad786220f1162597353ecc277d (patch)
tree7ba00015f859f357be878a210accdba62ac2f67b
parentaba8c3753162320c7cc8a66913ad82f4f1fd0d8b (diff)
downloadminetest-542df11bed89ebad786220f1162597353ecc277d.tar.gz
minetest-542df11bed89ebad786220f1162597353ecc277d.tar.bz2
minetest-542df11bed89ebad786220f1162597353ecc277d.zip
Fix GCC class-memaccess warnings (#10239)
-rw-r--r--src/client/mapblock_mesh.cpp7
-rw-r--r--src/noise.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp
index 1020e35f5..2f96ca61f 100644
--- a/src/client/mapblock_mesh.cpp
+++ b/src/client/mapblock_mesh.cpp
@@ -419,7 +419,14 @@ static void getNodeVertexDirs(const v3s16 &dir, v3s16 *vertex_dirs)
u8 idx = (dir.X + 2 * dir.Y + 3 * dir.Z) & 7;
idx = (idx - 1) * 4;
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wclass-memaccess"
+#endif
memcpy(vertex_dirs, &vertex_dirs_table[idx], 4 * sizeof(v3s16));
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
}
static void getNodeTextureCoords(v3f base, const v3f &scale, const v3s16 &dir, float *u, float *v)
diff --git a/src/noise.cpp b/src/noise.cpp
index 5a1d989cb..e16564b05 100644
--- a/src/noise.cpp
+++ b/src/noise.cpp
@@ -424,7 +424,7 @@ float NoisePerlin3D(NoiseParams *np, float x, float y, float z, s32 seed)
Noise::Noise(NoiseParams *np_, s32 seed, u32 sx, u32 sy, u32 sz)
{
- memcpy(&np, np_, sizeof(np));
+ np = *np_;
this->seed = seed;
this->sx = sx;
this->sy = sy;