Skip to content

Commit

Permalink
Test C boolean ints as != 0 rather than > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
wkschwartz committed Apr 13, 2015
1 parent 792a892 commit 141dccb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pigosat.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,7 @@ func (p *Pigosat) FailedAssumption(lit Literal) bool {
return false
}
defer p.ready(true)()
failed := C.picosat_failed_assumption(p.p, C.int(lit)) > 0
return failed
return C.picosat_failed_assumption(p.p, C.int(lit)) != 0
}

// Returns a list of failed assumption in the last call to
Expand Down Expand Up @@ -357,7 +356,7 @@ func (p *Pigosat) litArrayToSlice(litPtr *C.int) []Literal {
// to true (positive). This can speed up the computation.
func (p *Pigosat) MaxSatisfiableAssumptions() []Literal {
defer p.ready(false)()
if C.picosat_inconsistent(p.p) > 0 {
if C.picosat_inconsistent(p.p) != 0 {
return []Literal{}
}
litPtr := C.picosat_maximal_satisfiable_subset_of_assumptions(p.p)
Expand Down Expand Up @@ -396,7 +395,7 @@ func (p *Pigosat) MaxSatisfiableAssumptions() []Literal {
// to true (positive). This might speed up the computation.
func (p *Pigosat) NextMaxSatisfiableAssumptions() []Literal {
defer p.ready(false)()
if C.picosat_inconsistent(p.p) > 0 {
if C.picosat_inconsistent(p.p) != 0 {
return []Literal{}
}
litPtr := C.picosat_next_maximal_satisfiable_subset_of_assumptions(p.p)
Expand Down

0 comments on commit 141dccb

Please sign in to comment.