Skip to content

Commit cc4a9d3

Browse files
clang: allow to compile
1 parent 7fe7420 commit cc4a9d3

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

coprocessor-src/BoundedVariableEliminationParallel.cc

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -960,9 +960,9 @@ void BoundedVariableElimination::parallelBVE(CoprocessorData& data)
960960
lastTouched.resize(data.nVars());
961961
VarOrderBVEHeapLt comp(data, config.opt_bve_heap);
962962
Heap<VarOrderBVEHeapLt> newheap(comp);
963-
#ifdef __APPLE__
963+
#if defined(__APPLE__) || defined(__clang__)
964964
BVEWorkData *workData = new BVEWorkData[ controller.size() ];
965-
MethodFree mf(workData);
965+
MethodArrayFree<BVEWorkData> mf(workData);
966966
#else
967967
BVEWorkData workData[ controller.size() ];
968968
#endif
@@ -1022,14 +1022,7 @@ void BoundedVariableElimination::parallelBVE(CoprocessorData& data)
10221022
}
10231023
if (config.opt_bve_verbose > 0) { cerr << "c parallel bve with " << controller.size() << " threads on " << QSize << " variables" << endl; }
10241024
pthread_rwlock_t mutex = allocatorRWLock.getValue(); // FIXME reicht hier auch eine reference?
1025-
#ifndef __APPLE__ // Does not work on OS-X
1026-
assert(mutex.__data.__nr_readers == 0);
1027-
assert(mutex.__data.__readers_wakeup == 0);
1028-
assert(mutex.__data.__writer_wakeup == 0);
1029-
assert(mutex.__data.__nr_readers_queued == 0);
1030-
assert(mutex.__data.__writer == 0);
1031-
assert(mutex.__data.__lock == 0);
1032-
#endif
1025+
10331026
controller.runJobs(jobs);
10341027

10351028
if (!data.ok()) {

core/SolverTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct Lit {
6868
int x;
6969

7070
// Use this as a constructor:
71-
friend Lit mkLit(Var var, bool sign = false);
71+
friend Lit mkLit(Var var, bool sign);
7272

7373
bool operator == (Lit p) const { return x == p.x; }
7474
bool operator != (Lit p) const { return x != p.x; }
@@ -78,7 +78,7 @@ struct Lit {
7878
};
7979

8080

81-
inline Lit mkLit(Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
81+
inline Lit mkLit(Var var, bool sign=false) { Lit p; p.x = var + var + (int)sign; return p; }
8282
inline Lit operator ~(Lit p) { Lit q; q.x = p.x ^ 1; return q; }
8383
inline Lit operator ^(Lit p, bool b) { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
8484
inline bool sign(Lit p) { return p.x & 1; }
@@ -474,7 +474,7 @@ class Clause
474474
bool isShared() { return header.shared == 0 ? false : true; }
475475
//setting the shared to true... means the clause is shared or coming from a shared pool
476476
void setShared() { header.shared = 1; }
477-
void initShCleanDelay(unsigned i) { i > 1 ? header.shCleanDelay = 1 : header.shCleanDelay = i; }
477+
void initShCleanDelay(unsigned i) {header.shCleanDelay = i > 1 ? 1 : i; }
478478
void decShCleanDelay() { if (header.shCleanDelay > 0) header.shCleanDelay--; }
479479
unsigned getShCleanDelay() { return header.shCleanDelay; }
480480
#endif

0 commit comments

Comments
 (0)