diff options
| author | Sebastian Wüst <sebi@timewaster.de> | 2013-10-20 15:32:08 +0000 |
|---|---|---|
| committer | Sebastian Wüst <sebi@timewaster.de> | 2013-10-20 15:32:08 +0000 |
| commit | 82908f949129e1fcbf62002799ee7b1b77986eed (patch) | |
| tree | c02098dd7720cdf424f2793ecd3ddac2ea86b969 /src/libavoid/vpsc.cpp | |
| parent | changed text (diff) | |
| parent | Fix build errors with clang 3.3 and c++11 enabled. (diff) | |
| download | inkscape-82908f949129e1fcbf62002799ee7b1b77986eed.tar.gz inkscape-82908f949129e1fcbf62002799ee7b1b77986eed.zip | |
merge from trunk
(bzr r12417.1.24)
Diffstat (limited to 'src/libavoid/vpsc.cpp')
| -rw-r--r-- | src/libavoid/vpsc.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libavoid/vpsc.cpp b/src/libavoid/vpsc.cpp index 1646ddaaa..bdf01d51c 100644 --- a/src/libavoid/vpsc.cpp +++ b/src/libavoid/vpsc.cpp @@ -104,7 +104,7 @@ void IncSolver::copyResult() { for(Variables::const_iterator i=vs.begin();i!=vs.end();++i) { Variable* v=*i; v->finalPosition=v->position(); - COLA_ASSERT(v->finalPosition==v->finalPosition); + COLA_ASSERT(v->finalPosition==v->finalPosition);/// TODO: check! Possibly some error in this line... } } @@ -132,16 +132,16 @@ bool IncSolver::constraintGraphIsCyclic(const unsigned n, Variable* const vs[]) varmap[vs[i]]->out.insert(varmap[r]); } } - while(graph.size()>0) { + while(!graph.empty()) { node *u=NULL; vector<node*>::iterator i=graph.begin(); for(;i!=graph.end();++i) { u=*i; - if(u->in.size()==0) { + if(u->in.empty()) { break; } } - if(i==graph.end() && graph.size()>0) { + if(i==graph.end() && !graph.empty()) { //cycle found! return true; } else { @@ -189,16 +189,16 @@ bool IncSolver::blockGraphIsCyclic() { c=b->findMinOutConstraint(); } } - while(graph.size()>0) { + while(!graph.empty()) { node *u=NULL; vector<node*>::iterator i=graph.begin(); for(;i!=graph.end();++i) { u=*i; - if(u->in.size()==0) { + if(u->in.empty()) { break; } } - if(i==graph.end() && graph.size()>0) { + if(i==graph.end() && !graph.empty()) { //cycle found! return true; } else { @@ -287,7 +287,7 @@ bool IncSolver::satisfy() { v->unsatisfiable=true; continue; } - } catch(UnsatisfiableException e) { + } catch(UnsatisfiableException& e) { e.path.push_back(v); std::cerr << "Unsatisfiable:" << std::endl; for(std::vector<Constraint*>::iterator r=e.path.begin(); @@ -1162,10 +1162,10 @@ Constraint* Block::splitBetween(Variable* const vl, Variable* const vr, f<<" need to split between: "<<*vl<<" and "<<*vr<<endl; #endif Constraint *c=findMinLMBetween(vl, vr); + if(c!=NULL) { #ifdef LIBVPSC_LOGGING f<<" going to split on: "<<*c<<endl; #endif - if(c!=NULL) { split(lb,rb,c); deleted = true; } |
