diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2015-02-08 09:29:49 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2015-02-08 09:29:49 +0000 |
| commit | 91ca2718bc979f20ec5e7e08f1a691edfb10752f (patch) | |
| tree | 93ff12bc87d305e57be0cef89926f28b60d3ceb1 /src | |
| parent | Fixing dead assignment and uninitialized argument value. (diff) | |
| download | inkscape-91ca2718bc979f20ec5e7e08f1a691edfb10752f.tar.gz inkscape-91ca2718bc979f20ec5e7e08f1a691edfb10752f.zip | |
Commenting dead assignments.
(bzr r13909)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/object-edit.cpp | 24 | ||||
| -rw-r--r-- | src/ui/tools/flood-tool.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/gradient-toolbar.cpp | 9 |
3 files changed, 24 insertions, 13 deletions
diff --git a/src/ui/object-edit.cpp b/src/ui/object-edit.cpp index fb99dfd59..c3bc2d52c 100644 --- a/src/ui/object-edit.cpp +++ b/src/ui/object-edit.cpp @@ -296,13 +296,15 @@ RectKnotHolderEntityWH::set_internal(Geom::Point const &p, Geom::Point const &or // closer to the diagonal and in same-sign quarters, change both using ratio s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-ratio, -1)), state); minx = s[Geom::X] - origin[Geom::X]; - miny = s[Geom::Y] - origin[Geom::Y]; + // Dead assignment: Value stored to 'miny' is never read + //miny = s[Geom::Y] - origin[Geom::Y]; rect->height.computed = MAX(h_orig + minx / ratio, 0); } else { // closer to the horizontal, change only width, height is h_orig s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-1, 0)), state); minx = s[Geom::X] - origin[Geom::X]; - miny = s[Geom::Y] - origin[Geom::Y]; + // Dead assignment: Value stored to 'miny' is never read + //miny = s[Geom::Y] - origin[Geom::Y]; rect->height.computed = MAX(h_orig, 0); } rect->width.computed = MAX(w_orig + minx, 0); @@ -312,13 +314,15 @@ RectKnotHolderEntityWH::set_internal(Geom::Point const &p, Geom::Point const &or if (miny != 0 && fabs(minx/miny) > 0.5 * ratio && (SGN(minx) == SGN(miny))) { // closer to the diagonal and in same-sign quarters, change both using ratio s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-ratio, -1)), state); - minx = s[Geom::X] - origin[Geom::X]; + // Dead assignment: Value stored to 'minx' is never read + //minx = s[Geom::X] - origin[Geom::X]; miny = s[Geom::Y] - origin[Geom::Y]; rect->width.computed = MAX(w_orig + miny * ratio, 0); } else { // closer to the vertical, change only height, width is w_orig s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(0, -1)), state); - minx = s[Geom::X] - origin[Geom::X]; + // Dead assignment: Value stored to 'minx' is never read + //minx = s[Geom::X] - origin[Geom::X]; miny = s[Geom::Y] - origin[Geom::Y]; rect->width.computed = MAX(w_orig, 0); } @@ -388,14 +392,16 @@ RectKnotHolderEntityXY::knot_set(Geom::Point const &p, Geom::Point const &origin // closer to the diagonal and in same-sign quarters, change both using ratio s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-ratio, -1)), state); minx = s[Geom::X] - origin[Geom::X]; - miny = s[Geom::Y] - origin[Geom::Y]; + // Dead assignment: Value stored to 'miny' is never read + //miny = s[Geom::Y] - origin[Geom::Y]; rect->y.computed = MIN(origin[Geom::Y] + minx / ratio, opposite_y); rect->height.computed = MAX(h_orig - minx / ratio, 0); } else { // closer to the horizontal, change only width, height is h_orig s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-1, 0)), state); minx = s[Geom::X] - origin[Geom::X]; - miny = s[Geom::Y] - origin[Geom::Y]; + // Dead assignment: Value stored to 'miny' is never read + //miny = s[Geom::Y] - origin[Geom::Y]; rect->y.computed = MIN(origin[Geom::Y], opposite_y); rect->height.computed = MAX(h_orig, 0); } @@ -406,14 +412,16 @@ RectKnotHolderEntityXY::knot_set(Geom::Point const &p, Geom::Point const &origin if (miny != 0 && fabs(minx/miny) > 0.5 *ratio && (SGN(minx) == SGN(miny))) { // closer to the diagonal and in same-sign quarters, change both using ratio s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(-ratio, -1)), state); - minx = s[Geom::X] - origin[Geom::X]; + // Dead assignment: Value stored to 'minx' is never read + //minx = s[Geom::X] - origin[Geom::X]; miny = s[Geom::Y] - origin[Geom::Y]; rect->x.computed = MIN(origin[Geom::X] + miny * ratio, opposite_x); rect->width.computed = MAX(w_orig - miny * ratio, 0); } else { // closer to the vertical, change only height, width is w_orig s = snap_knot_position_constrained(p, Inkscape::Snapper::SnapConstraint(p_handle, Geom::Point(0, -1)), state); - minx = s[Geom::X] - origin[Geom::X]; + // Dead assignment: Value stored to 'minx' is never read + //minx = s[Geom::X] - origin[Geom::X]; miny = s[Geom::Y] - origin[Geom::Y]; rect->x.computed = MIN(origin[Geom::X], opposite_x); rect->width.computed = MAX(w_orig, 0); diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index e4c4e855d..f9b64e4fd 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -1097,8 +1097,8 @@ bool FloodTool::item_handler(SPItem* item, GdkEvent* event) { desktop->applyCurrentOrToolStyle(item, "/tools/paintbucket", false); DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object")); - - ret = TRUE; + // Dead assignment: Value stored to 'ret' is never read + //ret = TRUE; } break; diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index ea009c048..7ce04403b 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -167,13 +167,15 @@ gboolean gr_vector_list(GtkWidget *combo_box, SPDesktop *desktop, bool selection if (gr_selected == NULL) { gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, _("No gradient"), 1, NULL, 2, NULL, -1); - sensitive = FALSE; + // Dead assignment: Value stored to 'sensitive' is never read + //sensitive = FALSE; } if (gr_multi) { gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, _("Multiple gradients"), 1, NULL, 2, NULL, -1); - sensitive = FALSE; + // Dead assignment: Value stored to 'sensitive' is never read + //sensitive = FALSE; } guint idx = 0; @@ -786,7 +788,8 @@ static gboolean update_stop_list( GtkWidget *stop_combo, SPGradient *gradient, S gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, label.c_str(), 1, pb, 2, stop, -1); - sensitive = FALSE; + // Dead assignment: Value stored to 'sensitive' is never read + //sensitive = FALSE; } } |
