FastNoiseLite-0001-namespace-warnings.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. diff --git a/thirdparty/misc/FastNoiseLite.h b/thirdparty/misc/FastNoiseLite.h
  2. index ed97b0fcac..fb6dbcb92a 100644
  3. --- a/thirdparty/misc/FastNoiseLite.h
  4. +++ b/thirdparty/misc/FastNoiseLite.h
  5. @@ -52,6 +52,8 @@
  6. #include <cmath>
  7. +namespace fastnoiselite {
  8. +
  9. class FastNoiseLite
  10. {
  11. public:
  12. @@ -1609,6 +1611,12 @@ private:
  13. }
  14. }
  15. +// GCC raises warnings when integer overflows occur, which are needed for hashing here.
  16. +#if defined(__GNUC__) && !defined(__clang__)
  17. +#pragma GCC diagnostic push
  18. +#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
  19. +#endif
  20. +
  21. template <typename FNfloat>
  22. float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const
  23. {
  24. @@ -1763,6 +1771,9 @@ private:
  25. }
  26. }
  27. +#if defined(__GNUC__) && !defined(__clang__)
  28. +#pragma GCC diagnostic pop
  29. +#endif
  30. // Perlin Noise
  31. @@ -2583,4 +2594,6 @@ const T FastNoiseLite::Lookup<T>::RandVecs3D[] =
  32. -0.7870349638f, 0.03447489231f, 0.6159443543f, 0, -0.2015596421f, 0.6859872284f, 0.6991389226f, 0, -0.08581082512f, -0.10920836f, -0.9903080513f, 0, 0.5532693395f, 0.7325250401f, -0.396610771f, 0, -0.1842489331f, -0.9777375055f, -0.1004076743f, 0, 0.0775473789f, -0.9111505856f, 0.4047110257f, 0, 0.1399838409f, 0.7601631212f, -0.6344734459f, 0, 0.4484419361f, -0.845289248f, 0.2904925424f, 0
  33. };
  34. +} // namespace fastnoiselite
  35. +
  36. #endif