diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-03 11:21:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 11:21:20 +0200 |
commit | bf8da106511f2ceac194c7fdc891f7d3b7cd7e5f (patch) | |
tree | c628e66a6755a92ae90d620c2cb088e721636f61 | |
parent | 262018df1e1faabf55d18b0a8e3fbb3641f9247e (diff) | |
parent | e41e2a110373a251cd0664f077ada6f344e5c8fd (diff) |
Merge pull request #60663 from Geometror/fix-fnlite-gcc-warning
-rw-r--r-- | thirdparty/noise/FastNoiseLite.h | 9 | ||||
-rw-r--r-- | thirdparty/noise/patches/FastNoiseLite.patch | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/thirdparty/noise/FastNoiseLite.h b/thirdparty/noise/FastNoiseLite.h index 8015bf636a..a213f0888e 100644 --- a/thirdparty/noise/FastNoiseLite.h +++ b/thirdparty/noise/FastNoiseLite.h @@ -1611,6 +1611,12 @@ private: } } +// GCC raises warnings when integer overflows occur, which are needed for hashing here. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations" +#endif + template <typename FNfloat> float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const { @@ -1765,6 +1771,9 @@ private: } } +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif // Perlin Noise diff --git a/thirdparty/noise/patches/FastNoiseLite.patch b/thirdparty/noise/patches/FastNoiseLite.patch index 41ec943077..3c835c7b06 100644 --- a/thirdparty/noise/patches/FastNoiseLite.patch +++ b/thirdparty/noise/patches/FastNoiseLite.patch @@ -430,3 +430,26 @@ { x *= frequency; y *= frequency; +@@ -1611,6 +1611,12 @@ private: + } + } + ++// GCC raises warnings when integer overflows occur, which are needed for hashing here. ++#if defined(__GNUC__) && !defined(__clang__) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations" ++#endif ++ + template <typename FNfloat> + float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const + { +@@ -1765,6 +1771,9 @@ private: + } + } + ++#if defined(__GNUC__) && !defined(__clang__) ++#pragma GCC diagnostic pop ++#endif + + // Perlin Noise +
\ No newline at end of file |