diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
| commit | 5a4fb2325f60d292b47330f540b26a3279341c90 (patch) | |
| tree | d2aa7967be25450b83e625025366c618101ae49f /src/libavoid | |
| parent | The Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff) | |
| parent | Remove Snap menu item and improve grid menu item text (diff) | |
| download | inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip | |
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/libavoid')
| -rw-r--r-- | src/libavoid/connector.cpp | 10 | ||||
| -rw-r--r-- | src/libavoid/makefile | 17 | ||||
| -rw-r--r-- | src/libavoid/makepath.cpp | 2 | ||||
| -rw-r--r-- | src/libavoid/orthogonal.cpp | 14 | ||||
| -rw-r--r-- | src/libavoid/router.cpp | 11 | ||||
| -rw-r--r-- | src/libavoid/vertices.h | 2 | ||||
| -rw-r--r-- | src/libavoid/vpsc.cpp | 18 |
7 files changed, 27 insertions, 47 deletions
diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp index 3dbd941a4..8dcb66f2d 100644 --- a/src/libavoid/connector.cpp +++ b/src/libavoid/connector.cpp @@ -286,7 +286,7 @@ void ConnRef::common_updateEndPoint(const unsigned int type, const ConnEnd& conn } VertInf *altered = NULL; - VertInf *partner = NULL; + // VertInf *partner = NULL; bool isShape = false; if (type == (unsigned int) VertID::src) @@ -302,7 +302,7 @@ void ConnRef::common_updateEndPoint(const unsigned int type, const ConnEnd& conn _srcVert->visDirections = connEnd.directions(); altered = _srcVert; - partner = _dstVert; + // partner = _dstVert; } else // if (type == (unsigned int) VertID::tar) { @@ -317,7 +317,7 @@ void ConnRef::common_updateEndPoint(const unsigned int type, const ConnEnd& conn _dstVert->visDirections = connEnd.directions(); altered = _dstVert; - partner = _srcVert; + // partner = _srcVert; } // XXX: Seems to be faster to just remove the edges and recreate @@ -1736,7 +1736,8 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly, !reversedY); } else - { + { /// \todo FIXME: this whole branch was not doing anything + /* int turnDirA = vecDir(a0, a1, a2); int turnDirB = vecDir(b0, b1, b2); bool reversed = (side1 != -turnDirA); @@ -1761,6 +1762,7 @@ CrossingsInfoPair countRealCrossings(Avoid::Polygon& poly, } VertID vID(b1.id, true, b1.vn); //(*pointOrders)[b1].addPoints(&b1, &a1, reversed); + */ } } } diff --git a/src/libavoid/makefile b/src/libavoid/makefile deleted file mode 100644 index e4f83a52d..000000000 --- a/src/libavoid/makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - - - -OBJEXT = o - -# Explicit so that it's the default rule. -all: - cd .. && $(MAKE) libavoid/all - -clean %.a %.$(OBJEXT): - cd .. && $(MAKE) libavoid/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) diff --git a/src/libavoid/makepath.cpp b/src/libavoid/makepath.cpp index 4e15dbca9..774e0d7f5 100644 --- a/src/libavoid/makepath.cpp +++ b/src/libavoid/makepath.cpp @@ -82,7 +82,7 @@ class ANode // it back into a heap) when getting the next node to examine. This way we // get better complexity -- logarithmic pushs and pops to the heap. // -bool operator<(const ANode &a, const ANode &b) +static bool operator<(const ANode &a, const ANode &b) { if (a.f != b.f) { diff --git a/src/libavoid/orthogonal.cpp b/src/libavoid/orthogonal.cpp index e0a30b246..b5ef8d7e8 100644 --- a/src/libavoid/orthogonal.cpp +++ b/src/libavoid/orthogonal.cpp @@ -204,12 +204,6 @@ class ShiftSegment }; typedef std::list<ShiftSegment> ShiftSegmentList; -bool cmpShiftSegment(const ShiftSegment& u, const ShiftSegment& v) -{ - return u < v; -} - - struct Node; struct CmpNodePos { bool operator()(const Node* u, const Node* v) const; }; @@ -488,7 +482,7 @@ Event **events; // Used for quicksort. Must return <0, 0, or >0. -int compare_events(const void *a, const void *b) +static int compare_events(const void *a, const void *b) { Event *ea = *(Event**) a; Event *eb = *(Event**) b; @@ -1516,7 +1510,7 @@ extern void generateStaticOrthogonalVisGraph(Router *router) const int pass = 1; processEventVert(router, scanline, segments, events[i], pass); } - COLA_ASSERT(scanline.size() == 0); + COLA_ASSERT(scanline.empty()); for (unsigned i = 0; i < totalEvents; ++i) { delete events[i]; @@ -1595,7 +1589,7 @@ extern void generateStaticOrthogonalVisGraph(Router *router) const int pass = 1; processEventHori(router, scanline, vertSegments, events[i], pass); } - COLA_ASSERT(scanline.size() == 0); + COLA_ASSERT(scanline.empty()); for (unsigned i = 0; i < totalEvents; ++i) { delete events[i]; @@ -1885,7 +1879,7 @@ static void buildOrthogonalChannelInfo(Router *router, processShiftEvent(router, scanline, segmentList, events[i], dim, pass); } - COLA_ASSERT(scanline.size() == 0); + COLA_ASSERT(scanline.empty()); for (unsigned i = 0; i < totalEvents; ++i) { delete events[i]; diff --git a/src/libavoid/router.cpp b/src/libavoid/router.cpp index ab13a981b..55098b9d8 100644 --- a/src/libavoid/router.cpp +++ b/src/libavoid/router.cpp @@ -58,13 +58,17 @@ class ActionInfo { } ActionInfo(ActionType t, ShapeRef *s) : type(t), - objPtr(s) + objPtr(s), + newPoly(), + firstMove(0) { COLA_ASSERT(type != ConnChange); } ActionInfo(ActionType t, ConnRef *c) : type(t), - objPtr(c) + objPtr(c), + newPoly(), + firstMove(0) { COLA_ASSERT(type == ConnChange); } @@ -789,7 +793,6 @@ void Router::improveCrossings(void) } // Determine if this pair cross. Avoid::Polygon& jRoute = (*j)->routeRef(); - CrossingsInfoPair crossingInfo = std::make_pair(0, 0); bool meetsPenaltyCriteria = false; for (size_t jInd = 1; jInd < jRoute.size(); ++jInd) { @@ -1430,7 +1433,6 @@ bool Router::existsOrthogonalPathOverlap(void) { // Determine if this pair overlap Avoid::Polygon jRoute = (*j)->displayRoute(); - CrossingsInfoPair crossingInfo = std::make_pair(0, 0); for (size_t jInd = 1; jInd < jRoute.size(); ++jInd) { const bool finalSegment = ((jInd + 1) == jRoute.size()); @@ -1464,7 +1466,6 @@ bool Router::existsOrthogonalTouchingCorners(void) { // Determine if this pair overlap Avoid::Polygon jRoute = (*j)->displayRoute(); - CrossingsInfoPair crossingInfo = std::make_pair(0, 0); for (size_t jInd = 1; jInd < jRoute.size(); ++jInd) { const bool finalSegment = ((jInd + 1) == jRoute.size()); diff --git a/src/libavoid/vertices.h b/src/libavoid/vertices.h index b07c87f95..619692c23 100644 --- a/src/libavoid/vertices.h +++ b/src/libavoid/vertices.h @@ -129,7 +129,7 @@ class VertInfList unsigned int shapesSize(void) const; void stats(FILE *fp = stderr) { - fprintf(fp, "Conns %d, shapes %d\n", _connVertices, + fprintf(fp, "Conns %u, shapes %u\n", _connVertices, _shapeVertices); } private: 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; } |
