From 816331ffe13fafc75693c455ca7018fa841fcfab Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Wed, 13 Mar 2013 18:30:15 +0100 Subject: cppcheck (bzr r12201) --- src/io/inkjar.cpp | 2 +- src/live_effects/lpe-angle_bisector.cpp | 2 -- src/live_effects/lpe-dynastroke.cpp | 2 +- src/live_effects/lpe-extrude.cpp | 4 ++-- src/live_effects/lpe-recursiveskeleton.cpp | 5 +---- src/live_effects/lpe-ruler.cpp | 9 ++++----- 6 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/io/inkjar.cpp b/src/io/inkjar.cpp index 20b164b99..4af140737 100644 --- a/src/io/inkjar.cpp +++ b/src/io/inkjar.cpp @@ -311,7 +311,7 @@ guint8 *JarFile::get_uncompressed_file(guint32 compressed_size, guint32 crc, in_a -= nbytes; #ifdef DEBUG - std::printf("%d bytes written\n", out_a); + std::printf("%u bytes written\n", out_a); #endif } lseek(fd, eflen, SEEK_CUR); diff --git a/src/live_effects/lpe-angle_bisector.cpp b/src/live_effects/lpe-angle_bisector.cpp index 91f779ef3..2f57b710b 100644 --- a/src/live_effects/lpe-angle_bisector.cpp +++ b/src/live_effects/lpe-angle_bisector.cpp @@ -61,8 +61,6 @@ LPEAngleBisector::doEffect_path (std::vector const & path_in) { using namespace Geom; - std::vector path_out; - // we assume that the path has >= 3 nodes ptA = path_in[0].pointAt(1); Point B = path_in[0].initialPoint(); diff --git a/src/live_effects/lpe-dynastroke.cpp b/src/live_effects/lpe-dynastroke.cpp index 467fdfd9c..a5295d269 100644 --- a/src/live_effects/lpe-dynastroke.cpp +++ b/src/live_effects/lpe-dynastroke.cpp @@ -152,7 +152,7 @@ LPEDynastroke::doEffect_pwd2 (Geom::Piecewise > const & p double angle_rad = angle*M_PI/180.;//TODO: revert orientation?... Piecewise w; - std::vector corners = find_corners(m); + // std::vector corners = find_corners(m); DynastrokeMethod stroke_method = method.get_value(); if (roundness==1.) { diff --git a/src/live_effects/lpe-extrude.cpp b/src/live_effects/lpe-extrude.cpp index 7f5a00cf8..8b3f4714a 100644 --- a/src/live_effects/lpe-extrude.cpp +++ b/src/live_effects/lpe-extrude.cpp @@ -124,9 +124,9 @@ LPEExtrude::doEffect_pwd2 (Geom::Piecewise > const & pwd2 } std::vector connector_pts; - if (rts.size() < 1) { + if (rts.empty()) { connector_pts = cusps; - } else if (cusps.size() < 1) { + } else if (cusps.empty()) { connector_pts = rts; } else { connector_pts = rts; diff --git a/src/live_effects/lpe-recursiveskeleton.cpp b/src/live_effects/lpe-recursiveskeleton.cpp index 906c430c1..452139344 100644 --- a/src/live_effects/lpe-recursiveskeleton.cpp +++ b/src/live_effects/lpe-recursiveskeleton.cpp @@ -49,8 +49,6 @@ LPERecursiveSkeleton::doEffect_pwd2 (Geom::Piecewise > co using namespace Geom; Piecewise > output; - std::vector > > pre_output; - double prop_scale = 1.0; D2 > patternd2 = make_cuts_independent(pwd2_in); @@ -90,8 +88,7 @@ LPERecursiveSkeleton::doEffect_pwd2 (Geom::Piecewise > co Piecewise > n = rot90(derivative(uskeleton)); n = force_continuity(remove_short_cuts(n,.1)); - double scaling = 1; - scaling = (uskeleton.domain().extent() - toffset)/pattBndsX->extent(); + double scaling = (uskeleton.domain().extent() - toffset)/pattBndsX->extent(); // TODO investigate why pattWidth is not being used: double pattWidth = pattBndsX->extent() * scaling; diff --git a/src/live_effects/lpe-ruler.cpp b/src/live_effects/lpe-ruler.cpp index 88743548b..fefdad95a 100644 --- a/src/live_effects/lpe-ruler.cpp +++ b/src/live_effects/lpe-ruler.cpp @@ -80,11 +80,10 @@ LPERuler::ruler_mark(Geom::Point const &A, Geom::Point const &n, MarkType const { using namespace Geom; - gboolean success; double real_mark_length = mark_length; - success = sp_convert_distance(&real_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + sp_convert_distance(&real_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); double real_minor_mark_length = minor_mark_length; - success = sp_convert_distance(&real_minor_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + sp_convert_distance(&real_minor_mark_length, unit, &sp_unit_get_by_id(SP_UNIT_PX)); n_major = real_mark_length * n; n_minor = real_minor_mark_length * n; @@ -134,10 +133,10 @@ LPERuler::doEffect_pwd2 (Geom::Piecewise > const & pwd2_i std::vector s_cuts; double real_mark_distance = mark_distance; - gboolean success = sp_convert_distance(&real_mark_distance, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + sp_convert_distance(&real_mark_distance, unit, &sp_unit_get_by_id(SP_UNIT_PX)); double real_offset = offset; - success = sp_convert_distance(&real_offset, unit, &sp_unit_get_by_id(SP_UNIT_PX)); + sp_convert_distance(&real_offset, unit, &sp_unit_get_by_id(SP_UNIT_PX)); for (double s = real_offset; s