From d463240d8fd961d45b47ba96e0d93c37e1719da7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 21 Nov 2012 09:55:55 +1100 Subject: code cleanup: quiet warnings with gcc. (bzr r11888) --- src/libavoid/makepath.cpp | 2 +- src/libavoid/orthogonal.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libavoid') 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..772fc9668 100644 --- a/src/libavoid/orthogonal.cpp +++ b/src/libavoid/orthogonal.cpp @@ -204,7 +204,7 @@ class ShiftSegment }; typedef std::list ShiftSegmentList; -bool cmpShiftSegment(const ShiftSegment& u, const ShiftSegment& v) +static bool cmpShiftSegment(const ShiftSegment& u, const ShiftSegment& v) { return u < v; } @@ -488,7 +488,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; -- cgit v1.2.3 From cfe9c94712a2ff6849b123672e51b603f20e76ae Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 10 Jan 2013 23:30:09 -0800 Subject: Warning and dead code cleanup. (bzr r12014) --- src/libavoid/orthogonal.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/libavoid') diff --git a/src/libavoid/orthogonal.cpp b/src/libavoid/orthogonal.cpp index 772fc9668..d0a899252 100644 --- a/src/libavoid/orthogonal.cpp +++ b/src/libavoid/orthogonal.cpp @@ -204,12 +204,6 @@ class ShiftSegment }; typedef std::list ShiftSegmentList; -static bool cmpShiftSegment(const ShiftSegment& u, const ShiftSegment& v) -{ - return u < v; -} - - struct Node; struct CmpNodePos { bool operator()(const Node* u, const Node* v) const; }; -- cgit v1.2.3 From 9c54e4ae9e74a13735989977a477141c7a5535cf Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Wed, 26 Jun 2013 11:18:52 -0400 Subject: Add render rack gear extension from bug#1174800, modify gears location to render sub-menu Fixed bugs: - https://launchpad.net/bugs/1174800 (bzr r12391) --- src/libavoid/makefile | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/libavoid/makefile (limited to 'src/libavoid') 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) -- cgit v1.2.3 From 8bdeca099355f46c4f112144474ca470889dc668 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Fri, 27 Sep 2013 22:05:56 +0200 Subject: cppcheck: performance + variable type (bzr r12603) --- src/libavoid/vertices.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libavoid') 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: -- cgit v1.2.3 From f05ed28b81f4b89f394eb21eee94418e78bd10a8 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Mon, 7 Oct 2013 19:33:54 +0200 Subject: cppcheck: initialisation (bzr r12668) --- src/libavoid/router.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libavoid') diff --git a/src/libavoid/router.cpp b/src/libavoid/router.cpp index ab13a981b..35f921bb4 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); } -- cgit v1.2.3 From d3f86d34d0d92505a798f8c9b83ca12dfcbf50ab Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 13 Oct 2013 17:24:57 +0200 Subject: cppcheck (bzr r12680) --- src/libavoid/connector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libavoid') diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp index 3dbd941a4..cf8cfa11a 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 -- cgit v1.2.3 From 76137247c241a931292bd559e6575c34bd877d9f Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 13 Oct 2013 18:12:29 +0200 Subject: cppcheck (bzr r12681) --- src/libavoid/orthogonal.cpp | 6 +++--- src/libavoid/vpsc.cpp | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/libavoid') diff --git a/src/libavoid/orthogonal.cpp b/src/libavoid/orthogonal.cpp index d0a899252..b5ef8d7e8 100644 --- a/src/libavoid/orthogonal.cpp +++ b/src/libavoid/orthogonal.cpp @@ -1510,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]; @@ -1589,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]; @@ -1879,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/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::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::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::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< Date: Sun, 27 Oct 2013 20:04:05 +0100 Subject: fix warning and add comments about fixing code (bzr r12735) --- src/libavoid/connector.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libavoid') diff --git a/src/libavoid/connector.cpp b/src/libavoid/connector.cpp index cf8cfa11a..8dcb66f2d 100644 --- a/src/libavoid/connector.cpp +++ b/src/libavoid/connector.cpp @@ -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); + */ } } } -- cgit v1.2.3 From df67b742113481755ffa8e43e8716b111d9e5916 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 28 Feb 2014 19:28:59 -0800 Subject: Remove unused shadowed variables. (bzr r13078) --- src/libavoid/router.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/libavoid') diff --git a/src/libavoid/router.cpp b/src/libavoid/router.cpp index 35f921bb4..55098b9d8 100644 --- a/src/libavoid/router.cpp +++ b/src/libavoid/router.cpp @@ -793,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) { @@ -1434,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()); @@ -1468,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()); -- cgit v1.2.3