summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-10-22 14:50:54 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-10-22 14:50:54 +0000
commit2a512b54b57ae53464601b38b05eab6f6c3cf3c4 (patch)
tree77810d64bec56ecf825e4206c8dc82655eafdff8 /src
parentFix for Bug #1022543 (Ctrl+C increments the documents count). (diff)
downloadinkscape-2a512b54b57ae53464601b38b05eab6f6c3cf3c4.tar.gz
inkscape-2a512b54b57ae53464601b38b05eab6f6c3cf3c4.zip
cppcheck
(bzr r12713)
Diffstat (limited to 'src')
-rw-r--r--src/libdepixelize/priv/point.h4
-rw-r--r--src/libvpsc/solve_VPSC.cpp12
-rw-r--r--src/sp-rect.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/libdepixelize/priv/point.h b/src/libdepixelize/priv/point.h
index dc28a2b84..53babd9dc 100644
--- a/src/libdepixelize/priv/point.h
+++ b/src/libdepixelize/priv/point.h
@@ -30,8 +30,8 @@ namespace Tracer {
template<class T>
struct Point
{
- Point() : visible(true) {}
- Point(T x, T y) : visible(true), x(x), y(y) {}
+ Point() : smooth(false), visible(true) {}
+ Point(T x, T y) : smooth(false), visible(true), x(x), y(y) {}
Point(T x, T y, bool smooth) : smooth(smooth), visible(true), x(x), y(y) {}
Point operator+(const Point &rhs) const
diff --git a/src/libvpsc/solve_VPSC.cpp b/src/libvpsc/solve_VPSC.cpp
index f9bed649c..83cb517b6 100644
--- a/src/libvpsc/solve_VPSC.cpp
+++ b/src/libvpsc/solve_VPSC.cpp
@@ -301,16 +301,16 @@ bool Solver::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 {
@@ -358,16 +358,16 @@ bool Solver::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 {
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index ff5e81f95..b327f0b83 100644
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
@@ -113,7 +113,7 @@ void SPRect::set(unsigned key, gchar const *value) {
void SPRect::update(SPCtx* ctx, unsigned int flags) {
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- SPItemCtx const *ictx = (SPItemCtx const *) ctx;
+ SPItemCtx const *ictx = reinterpret_cast<SPItemCtx const *>(ctx);
double const w = ictx->viewport.width();
double const h = ictx->viewport.height();