From 4896f57e118d7d0291f3e86c49b9fb9345ccfd59 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 28 May 2020 15:50:20 +0300 Subject: [PATCH] Silence compiler/linter warnings of declared but unused variables. They are a distraction. --- src/display/sp-canvas.cpp | 1 - src/extension/internal/svg.cpp | 3 --- src/helper/geom-pathstroke.cpp | 4 +--- src/helper/geom-pathvectorsatellites.cpp | 1 - src/live_effects/lpe-bspline.cpp | 4 ++-- src/util/units.cpp | 5 ----- 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 85155c1c5e..851d7c4898 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1750,7 +1750,6 @@ int SPCanvas::handle_motion(GtkWidget *widget, GdkEventMotion *event) } else { if (desktop && desktop->event_context && desktop->xrayMode()) { sp_reset_spliter(canvas); - Geom::Point prev_orig = canvas->_xray_orig; canvas->_xray_orig = desktop->point(true); canvas->_xray_orig *= desktop->current_zoom(); if (!SP_ACTIVE_DOCUMENT->is_yaxisdown()) { diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 86063ea5fc..c2a8833aad 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -398,9 +398,6 @@ static void insert_text_fallback( Inkscape::XML::Node *repr, SPDocument *origina // For round-tripping, xml:space (or 'white-space:pre') must be set. repr->setAttribute("xml:space", "preserve"); - Geom::Point text_anchor_point = text->layout.characterAnchorPoint(text->layout.begin()); - // std::cout << " text_anchor_point: " << text_anchor_point << std::endl; - double text_x = 0.0; double text_y = 0.0; sp_repr_get_double(repr, "x", &text_x); diff --git a/src/helper/geom-pathstroke.cpp b/src/helper/geom-pathstroke.cpp index 60b1b855a7..181c45715a 100644 --- a/src/helper/geom-pathstroke.cpp +++ b/src/helper/geom-pathstroke.cpp @@ -392,10 +392,8 @@ void extrapolate_join_internal(join_data jd, int alternative) // END TESTING Geom::Point center1 = circle1.center(); - Geom::Point center2 = circle2.center(); double side1 = tang1[Geom::X]*(startPt[Geom::Y]-center1[Geom::Y]) - tang1[Geom::Y]*(startPt[Geom::X]-center1[Geom::X]); - // double side2 = tang2[Geom::X]*( endPt[Geom::Y]-center2[Geom::Y]) - tang2[Geom::Y]*( endPt[Geom::X]-center2[Geom::X]); - // std::cout << " side1: " << side1 << " side2: " << side2 << std::endl; + // std::cout << " side1: " << side1 << std::endl; bool inc_ls = !circle1.center().isFinite(); bool out_ls = !circle2.center().isFinite(); diff --git a/src/helper/geom-pathvectorsatellites.cpp b/src/helper/geom-pathvectorsatellites.cpp index 8b4b2d05e3..0e7c4f1384 100644 --- a/src/helper/geom-pathvectorsatellites.cpp +++ b/src/helper/geom-pathvectorsatellites.cpp @@ -185,7 +185,6 @@ void PathVectorSatellites::updateSatelliteType(SatelliteType satellitetype, bool continue; } if (only_selected) { - Geom::Point satellite_point = _pathvector[i].pointAt(j); if (_satellites[i][j].selected) { _satellites[i][j].satellite_type = satellitetype; } diff --git a/src/live_effects/lpe-bspline.cpp b/src/live_effects/lpe-bspline.cpp index 1f5c1584fa..fa42189a3a 100644 --- a/src/live_effects/lpe-bspline.cpp +++ b/src/live_effects/lpe-bspline.cpp @@ -324,7 +324,7 @@ void sp_bspline_do_effect(SPCurve *curve, double helper_size, Geom::PathVector & if (path_it.closed()) { curve_n->closepath_current(); } - curve->append(curve_n, false); + curve->append(*curve_n, false); curve_n->reset(); delete curve_n; } @@ -466,7 +466,7 @@ void LPEBSpline::doBSplineFromWidget(SPCurve *curve, double weight_ammount) if (path_it.closed()) { curve_n->closepath_current(); } - curve->append(curve_n, false); + curve->append(*curve_n, false); curve_n->reset(); delete curve_n; } diff --git a/src/util/units.cpp b/src/util/units.cpp index bf41d05676..d88ff91c5c 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -51,11 +51,6 @@ enum UnitCode { }; // TODO: convert to constexpr in C++11, so that the above constants can be eliminated -inline unsigned make_unit_code(char a, char b) { - // this should work without the casts, but let's be 100% sure - // also ensure that the codes are in lowercase - return MAKE_UNIT_CODE(a,b); -} inline unsigned make_unit_code(char const *str) { if (!str || str[0] == 0) return 0; return MAKE_UNIT_CODE(str[0], str[1]); -- GitLab