summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authornoguchi-k <55966120+noguchi-k@users.noreply.github.com>2019-12-14 03:53:03 +0900
committerAdam J. Stewart <ajstewart426@gmail.com>2019-12-13 12:53:03 -0600
commit3e5c926a95fa45196a3bdb892f8f1cc076c4543e (patch)
tree9f36b178bd1421c158d0529f2c8fba47d5c1507c /var
parent481a920fe89ea7f0e518b8cf815f966715b20ca3 (diff)
downloadspack-3e5c926a95fa45196a3bdb892f8f1cc076c4543e.tar.gz
spack-3e5c926a95fa45196a3bdb892f8f1cc076c4543e.tar.bz2
spack-3e5c926a95fa45196a3bdb892f8f1cc076c4543e.tar.xz
spack-3e5c926a95fa45196a3bdb892f8f1cc076c4543e.zip
gmodel: fix error (#14140)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gmodel/fix_gmodel.cpp.patch54
-rw-r--r--var/spack/repos/builtin/packages/gmodel/package.py5
2 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/gmodel/fix_gmodel.cpp.patch b/var/spack/repos/builtin/packages/gmodel/fix_gmodel.cpp.patch
new file mode 100644
index 0000000000..c4e1cae15e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/gmodel/fix_gmodel.cpp.patch
@@ -0,0 +1,54 @@
+--- spack-src/gmodel.cpp.org 2019-12-13 10:43:51.578849661 +0900
++++ spack-src/gmodel.cpp 2019-12-13 10:54:55.467737618 +0900
+@@ -30,9 +30,9 @@
+ /* PLANE = */ "Physical Surface",
+ /* RULED = */ "Physical Surface",
+ /* VOLUME = */ "Physical Volume",
+- /* LOOP = */ 0,
+- /* SHELL = */ 0,
+- /* GROUP = */ 0};
++ /* LOOP = */ nullptr,
++ /* SHELL = */ nullptr,
++ /* GROUP = */ nullptr};
+
+ int const type_dims[NTYPES] = {
+ /* POINT = */ 0,
+@@ -63,11 +63,6 @@
+ return v.at(std::size_t(i));
+ }
+
+-template <typename T>
+-static int size(std::vector<T> const& v) {
+- return int(v.size());
+-}
+-
+ int is_entity(int t) { return t <= VOLUME; }
+
+ int is_face(int t) { return t == PLANE || t == RULED; }
+@@ -452,7 +447,7 @@
+ auto loop = new_loop();
+ add_use(loop, FORWARD, start);
+ add_use(loop, FORWARD, right.middle);
+- ObjPtr end = 0;
++ ObjPtr end = nullptr;
+ switch (start->type) {
+ case LINE: {
+ end = new_line2(std::dynamic_pointer_cast<Point>(left.end),
+@@ -492,7 +487,7 @@
+ break;
+ }
+ default:
+- end = 0;
++ end = nullptr;
+ break;
+ }
+ add_use(loop, REVERSE, end);
+@@ -508,7 +503,7 @@
+ middle = new_ruled2(loop);
+ break;
+ default:
+- middle = 0;
++ middle = nullptr;
+ break;
+ }
+ return Extruded{middle, end};
diff --git a/var/spack/repos/builtin/packages/gmodel/package.py b/var/spack/repos/builtin/packages/gmodel/package.py
index fecf45a967..01883da6ee 100644
--- a/var/spack/repos/builtin/packages/gmodel/package.py
+++ b/var/spack/repos/builtin/packages/gmodel/package.py
@@ -18,3 +18,8 @@ class Gmodel(CMakePackage):
url = "https://github.com/ibaned/gmodel/archive/v2.1.0.tar.gz"
version('2.1.0', sha256='80df0c6dc413a9ffa0f0e7b65118b05b643ba3e1bfcac28fb91d2d3ad017fda0')
+
+ # fix error [-Werror,-Wzero-as-null-pointer-constant]
+ # fix error [-Werror,-Wunused-template]
+ # Ref: https://github.com/ibaned/gmodel/commit/6b81ec190cf2ce9a6554a99cb6d759b023393cdd
+ patch('fix_gmodel.cpp.patch')