[mercator] 01/05: Add patch to fix C++11 const float compile issues

Olek Wojnar olek-guest at moszumanska.debian.org
Tue Jun 28 00:04:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

olek-guest pushed a commit to branch master
in repository mercator.

commit 312d3ed8b69d1ee7196a24ae62f2dbdec8f1c4b3
Author: Olek Wojnar <olek-dev at wojnar.org>
Date:   Sun Oct 18 17:23:47 2015 -0500

    Add patch to fix C++11 const float compile issues
---
 debian/changelog                                   |   8 ++
 .../fix-C++11-const-float-compile-issues.patch     | 147 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 debian/rules                                       |   1 +
 4 files changed, 157 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9ddd1e1..cd1b735 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mercator (0.3.3-2) unstable; urgency=high
+
+  * Add patch to fix C++11 const float compile issues (Closes: #802285)
+    - Patch forwarded upstream
+  * d/rules: Explicitly build using the C++11 standard
+
+ -- Olek Wojnar <olek-dev at wojnar.org>  Sun, 25 Oct 2015 01:13:33 -0500
+
 mercator (0.3.3-1) unstable; urgency=medium
 
   * New upstream release (prior packaging by Stephen Webb)
diff --git a/debian/patches/fix-C++11-const-float-compile-issues.patch b/debian/patches/fix-C++11-const-float-compile-issues.patch
new file mode 100644
index 0000000..ba50080
--- /dev/null
+++ b/debian/patches/fix-C++11-const-float-compile-issues.patch
@@ -0,0 +1,147 @@
+Description: Fix C++11 const float compile issues
+ Cherry-picked from upstream
+Origin: https://github.com/worldforge/mercator/commit/babba18379a584822c0785d66cec20b03d4431af
+Last-Update: 2015-10-25
+
+--- a/Mercator/BasePoint.cpp
++++ b/Mercator/BasePoint.cpp
+@@ -6,8 +6,8 @@
+ 
+ namespace Mercator { 
+ 
+-const float BasePoint::HEIGHT = 8.0;
+-const float BasePoint::ROUGHNESS = 1.25;
+-const float BasePoint::FALLOFF = 0.25;
++constexpr float BasePoint::HEIGHT;
++constexpr float BasePoint::ROUGHNESS;
++constexpr float BasePoint::FALLOFF;
+ 
+ } //namespace Mercator
+diff --git a/Mercator/BasePoint.h b/Mercator/BasePoint.h
+index 0077612..da0d243 100644
+--- a/Mercator/BasePoint.h
++++ b/Mercator/BasePoint.h
+@@ -27,11 +27,11 @@ class BasePoint {
+ 
+   public:
+     /// Default height at the base point.
+-    static const float HEIGHT;
++    static constexpr float HEIGHT = 8.0;
+     /// Default roughness at the base point.
+-    static const float ROUGHNESS;
++    static constexpr float ROUGHNESS = 1.25;
+     /// Default falloff at the base point.
+-    static const float FALLOFF;
++    static constexpr float FALLOFF = 0.25;
+ 
+     /// \brief Constructor
+     ///
+diff --git a/Mercator/Terrain.cpp b/Mercator/Terrain.cpp
+index 0f3de3b..696b53f 100644
+--- a/Mercator/Terrain.cpp
++++ b/Mercator/Terrain.cpp
+@@ -24,9 +24,9 @@
+ 
+ namespace Mercator {
+ 
+-const unsigned int Terrain::DEFAULT = 0x0000;
+-const unsigned int Terrain::SHADED = 0x0001;
+-const float Terrain::defaultLevel = 8.f;
++const unsigned int Terrain::DEFAULT;
++const unsigned int Terrain::SHADED;
++constexpr float Terrain::defaultLevel;
+ 
+ /// \brief Construct a new Terrain object with optional options and resolution.
+ ///
+diff --git a/Mercator/Terrain.h b/Mercator/Terrain.h
+index 0937e0a..bafb29b 100644
+--- a/Mercator/Terrain.h
++++ b/Mercator/Terrain.h
+@@ -54,9 +54,9 @@ class Terrain {
+     typedef std::map<const Effector *, Rect> Effectorstore;
+ 
+     /// \brief value provided for no flags set.
+-    static const unsigned int DEFAULT;
++    static const unsigned int DEFAULT = 0x0000;
+     /// \brief set if shaders are going to be used on this terrain.
+-    static const unsigned int SHADED;
++    static const unsigned int SHADED = 0x0001;
+     // More options go here as bit flags, and below should be a private
+     // test function
+   private:
+@@ -99,7 +99,7 @@ class Terrain {
+     }
+   public:
+     /// \brief Height value used when no data is available.
+-    static const float defaultLevel;
++    static constexpr float defaultLevel = 8.f;
+ 
+     explicit Terrain(unsigned int options = DEFAULT,
+                      unsigned int resolution = defaultResolution);
+diff --git a/tests/Buffertest.cpp b/tests/Buffertest.cpp
+index 60a3f27..cc2cf90 100644
+--- a/tests/Buffertest.cpp
++++ b/tests/Buffertest.cpp
+@@ -29,8 +29,8 @@ Segment::~Segment()
+ {
+ }
+ 
+-const float BasePoint::HEIGHT = 8.0;
+-const float BasePoint::ROUGHNESS = 1.25;
+-const float BasePoint::FALLOFF = 0.25;
++constexpr float BasePoint::HEIGHT;
++constexpr float BasePoint::ROUGHNESS;
++constexpr float BasePoint::FALLOFF;
+ 
+ }
+diff --git a/tests/Segmentperf.cpp b/tests/Segmentperf.cpp
+index 43ca27e..2398232 100644
+--- a/tests/Segmentperf.cpp
++++ b/tests/Segmentperf.cpp
+@@ -42,9 +42,9 @@ int main(int argc, char ** argv)
+ 
+ namespace Mercator {
+ 
+-const float BasePoint::HEIGHT = 8.0;
+-const float BasePoint::ROUGHNESS = 1.25;
+-const float BasePoint::FALLOFF = 0.25;
++constexpr float BasePoint::HEIGHT;
++constexpr float BasePoint::ROUGHNESS;
++constexpr float BasePoint::FALLOFF;
+ 
+ void Surface::populate()
+ {
+diff --git a/tests/Segmenttest.cpp b/tests/Segmenttest.cpp
+index 0c6debf..a8ed38e 100644
+--- a/tests/Segmenttest.cpp
++++ b/tests/Segmenttest.cpp
+@@ -39,9 +39,9 @@ int main()
+ 
+ namespace Mercator {
+ 
+-const float BasePoint::HEIGHT = 8.0;
+-const float BasePoint::ROUGHNESS = 1.25;
+-const float BasePoint::FALLOFF = 0.25;
++constexpr float BasePoint::HEIGHT;
++constexpr float BasePoint::ROUGHNESS;
++constexpr float BasePoint::FALLOFF;
+ 
+ void Surface::populate()
+ {
+diff --git a/tests/TerrainaddAreatest.cpp b/tests/TerrainaddAreatest.cpp
+index 7f3f96a..9f35465 100644
+--- a/tests/TerrainaddAreatest.cpp
++++ b/tests/TerrainaddAreatest.cpp
+@@ -155,9 +155,9 @@ void TerrainMod::removeFromSegment(Segment & s) const
+ {
+ }
+ 
+-const float BasePoint::HEIGHT = 8.0;
+-const float BasePoint::ROUGHNESS = 1.25;
+-const float BasePoint::FALLOFF = 0.25;
++constexpr float BasePoint::HEIGHT;
++constexpr float BasePoint::ROUGHNESS;
++constexpr float BasePoint::FALLOFF;
+ 
+ Effector::Effector()
+ {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0685c53
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-C++11-const-float-compile-issues.patch
diff --git a/debian/rules b/debian/rules
index f9532b2..77e4072 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,5 @@
 #!/usr/bin/make -f
+export DEB_CXXFLAGS_MAINT_APPEND = -std=c++11
 
 %:
 	dh $@ --parallel --with autoreconf

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mercator.git



More information about the Pkg-games-commits mailing list