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<