]> git.pld-linux.org Git - packages/Yap.git/commitdiff
- add build fixes from fedora auto/th/Yap-6.2.2-5
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 18 Oct 2016 17:23:02 +0000 (19:23 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 18 Oct 2016 17:23:02 +0000 (19:23 +0200)
- rel 5

Friend-function-template-defined-in-a-class-cannot-b.patch [new file with mode: 0644]
Off-by-one-error-when-initializing-yap_flags.patch [new file with mode: 0644]
Yap.spec

diff --git a/Friend-function-template-defined-in-a-class-cannot-b.patch b/Friend-function-template-defined-in-a-class-cannot-b.patch
new file mode 100644 (file)
index 0000000..6a018c8
--- /dev/null
@@ -0,0 +1,62 @@
+From 92d5303c23fcc698233b754fc8f180df1fa2aa9b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Thu, 12 Feb 2015 17:37:57 +0100
+Subject: [PATCH] Friend function template defined in a class cannot be used
+ without ADL
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC 5.0 stopped searching friend function templates without ADL.
+
+The Clause_new() function can be kept a friend but must be defined out
+of scope of the Clause class, or the callers must use fully
+qualificated name (Clause::Clause_new()) and the method must be
+changed from friend to static.
+
+So far my poor C++ knowledge.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ packages/swi-minisat2/C/Solver.C      | 4 ++--
+ packages/swi-minisat2/C/SolverTypes.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/packages/swi-minisat2/C/Solver.C b/packages/swi-minisat2/C/Solver.C
+index 2de3e6d..1bcdbff 100644
+--- a/packages/swi-minisat2/C/Solver.C
++++ b/packages/swi-minisat2/C/Solver.C
+@@ -120,7 +120,7 @@ bool Solver::addClause(vec<Lit>& ps)
+         uncheckedEnqueue(ps[0]);
+         return ok = (propagate() == NULL);
+     }else{
+-        Clause* c = Clause_new(ps, false);
++        Clause* c = Clause::Clause_new(ps, false);
+         clauses.push(c);
+         attachClause(*c);
+     }
+@@ -599,7 +599,7 @@ lbool Solver::search(int nof_conflicts, int nof_learnts)
+             if (learnt_clause.size() == 1){
+                 uncheckedEnqueue(learnt_clause[0]);
+             }else{
+-                Clause* c = Clause_new(learnt_clause, true);
++                Clause* c = Clause::Clause_new(learnt_clause, true);
+                 learnts.push(c);
+                 attachClause(*c);
+                 claBumpActivity(*c);
+diff --git a/packages/swi-minisat2/C/SolverTypes.h b/packages/swi-minisat2/C/SolverTypes.h
+index 47e3023..919b60b 100644
+--- a/packages/swi-minisat2/C/SolverTypes.h
++++ b/packages/swi-minisat2/C/SolverTypes.h
+@@ -119,7 +119,7 @@ public:
+     // -- use this function instead:
+     template<class V>
+-    friend Clause* Clause_new(const V& ps, bool learnt = false) {
++    static Clause* Clause_new(const V& ps, bool learnt = false) {
+         assert(sizeof(Lit)      == sizeof(uint32_t));
+         assert(sizeof(float)    == sizeof(uint32_t));
+         void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size()));
+-- 
+1.9.3
+
diff --git a/Off-by-one-error-when-initializing-yap_flags.patch b/Off-by-one-error-when-initializing-yap_flags.patch
new file mode 100644 (file)
index 0000000..a376743
--- /dev/null
@@ -0,0 +1,41 @@
+From fa8f0f7b2d107770ae4d37bc77c902eafc59c86c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Mon, 7 Jan 2013 17:31:08 +0100
+Subject: [PATCH] Off-by-one error when initializing yap_flags
+
+The yap_flags_field of all_heap_codes structure is of type
+Int[LAST_FLAG], thus the loop should iterate from 0 to LAST_FLAG - 1.
+---
+ C/init.c     | 2 +-
+ C/stdpreds.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/C/init.c b/C/init.c
+index dda09cc..8f01864 100755
+--- a/C/init.c
++++ b/C/init.c
+@@ -1348,7 +1348,7 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
+   Yap_InitTime ();
+   /* InitAbsmi must be done before InitCodes */
+   /* This must be done before initialising predicates */
+-  for (i = 0; i <= LAST_FLAG; i++) {
++  for (i = 0; i < LAST_FLAG; i++) {
+     yap_flags[i] = 0;
+   }
+ #ifdef MPW
+diff --git a/C/stdpreds.c b/C/stdpreds.c
+index a4c0e86..8a4183f 100755
+--- a/C/stdpreds.c
++++ b/C/stdpreds.c
+@@ -3637,7 +3637,7 @@ p_access_yap_flags(void)
+     return(FALSE);            
+   }
+   flag = IntOfTerm(tflag);
+-  if (flag < 0 || flag > NUMBER_OF_YAP_FLAGS) {
++  if (flag < 0 || flag >= NUMBER_OF_YAP_FLAGS) {
+     return(FALSE);
+   }
+ #ifdef TABLING
+-- 
+1.7.11.7
+
index 9576ea6af06f7619ce2b3dd22aef4953f8117fff..f12420fa812ab68bf37651789baccb2f5b79eb95 100644 (file)
--- a/Yap.spec
+++ b/Yap.spec
@@ -3,7 +3,7 @@ Summary:        Prolog Compiler
 Summary(pl.UTF-8):     Kompilator Prologu
 Name:          Yap
 Version:       6.2.2
-Release:       4
+Release:       5
 License:       Artistic
 Group:         Development/Languages
 #Source0Download: http://www.dcc.fc.up.pt/~vsc/Yap/downloads.html
@@ -12,6 +12,8 @@ Source0:      http://www.dcc.fc.up.pt/~vsc/Yap/yap-%{version}.tar.gz
 Patch0:                %{name}-acdirs.patch
 Patch1:                %{name}-nolibs.patch
 Patch2:                %{name}-info.patch
+Patch3:                Friend-function-template-defined-in-a-class-cannot-b.patch
+Patch4:                Off-by-one-error-when-initializing-yap_flags.patch
 URL:           http://www.dcc.fc.up.pt/~vsc/Yap/
 BuildRequires: autoconf >= 2.50
 BuildRequires: automake
@@ -58,6 +60,8 @@ Statyczna biblioteka dla kompilatora prologu YAP.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 cp -f /usr/share/automake/config.sub .
This page took 0.1154 seconds and 4 git commands to generate.