summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>2018-03-28 17:14:31 +0000
committerFelipe CorrĂȘa da Silva Sanches <juca@members.fsf.org>2018-03-28 19:40:50 +0000
commit1673659da2aa1f33c63b73059ac78ac9a0f263e1 (patch)
treece890bfe460953c28b9b2d8f8ac8a94d25de895a /src
parentUpdate HACKING.txt. Move to top directory. (diff)
downloadinkscape-1673659da2aa1f33c63b73059ac78ac9a0f263e1.tar.gz
inkscape-1673659da2aa1f33c63b73059ac78ac9a0f263e1.zip
a bit more of warning cleanup
Diffstat (limited to 'src')
-rw-r--r--src/libnrtype/Layout-TNG-Compute.cpp1
-rw-r--r--src/live_effects/lpe-measure-segments.cpp29
-rw-r--r--src/object/sp-text.cpp2
-rw-r--r--src/splivarot.cpp3
-rw-r--r--src/ui/clipboard.cpp8
-rw-r--r--src/ui/dialog/align-and-distribute.cpp3
-rw-r--r--src/ui/interface.cpp2
-rw-r--r--src/ui/tools/eraser-tool.cpp2
-rw-r--r--src/ui/tools/measure-tool.cpp2
-rw-r--r--src/ui/tools/mesh-tool.cpp7
-rw-r--r--src/verbs.cpp2
11 files changed, 32 insertions, 29 deletions
diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp
index 2ef689a88..20b07d84b 100644
--- a/src/libnrtype/Layout-TNG-Compute.cpp
+++ b/src/libnrtype/Layout-TNG-Compute.cpp
@@ -1507,7 +1507,6 @@ bool Layout::Calculator::_findChunksForLine(ParagraphInfo const &para,
TRACE((" initial line_box_height (em size): %f\n", line_box_height->emSize() ));
UnbrokenSpanPosition span_pos;
- static int trys = 0;
for( ; ; ) {
// Get regions where one can place one line of text (can be more than one, if filling a
// donut for example).
diff --git a/src/live_effects/lpe-measure-segments.cpp b/src/live_effects/lpe-measure-segments.cpp
index 151403c5c..3350b0277 100644
--- a/src/live_effects/lpe-measure-segments.cpp
+++ b/src/live_effects/lpe-measure-segments.cpp
@@ -233,8 +233,7 @@ LPEMeasureSegments::createTextLabel(Geom::Point pos, size_t counter, double leng
}
Inkscape::XML::Document *xml_doc = document->getReprDoc();
Inkscape::XML::Node *rtext = NULL;
- double doc_w = document->getRoot()->width.value;
-
+
Glib::ustring lpobjid = this->lpeobj->getId();
Glib::ustring itemid = sp_lpe_item->getId();
Glib::ustring id = Glib::ustring("text-on-");
@@ -486,7 +485,7 @@ LPEMeasureSegments::createLine(Geom::Point start,Geom::Point end, Glib::ustring
} else if (elemref->parent != sp_lpe_item->parent) {
Inkscape::XML::Node *old_repr = elemref->getRepr();
Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc);
- SPObject * elemref_copy = sp_lpe_item->parent->appendChildRepr(copy);
+ sp_lpe_item->parent->appendChildRepr(copy);
Inkscape::GC::release(copy);
elemref->deleteObject(true);
copy->setAttribute("id", id.c_str());
@@ -612,7 +611,7 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
display_unit = "px";
}
doc_scale = Inkscape::Util::Quantity::convert( scaledoc[Geom::X], "px", display_unit.c_str() );
- if( doc_scale > 0 ) {
+ if (doc_scale > 0) {
doc_scale= 1.0/doc_scale;
} else {
doc_scale = 1.0;
@@ -672,19 +671,19 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
Geom::Point start = pathvector[i].pointAt(j);
Geom::Point end = pathvector[i].pointAt(j + 1);
Geom::Point next = Geom::Point(0,0);
- if(pathvector[i].closed() && pathvector[i].size() == j+1){
+ if (pathvector[i].closed() && pathvector[i].size() == j+1){
end = pathvector[i].pointAt(0);
next = pathvector[i].pointAt(1);
} else if (pathvector[i].size() > j + 1) {
next = pathvector[i].pointAt(j+2);
}
- if(hasMeassure(counter) && !Geom::are_near(start, end)) {
+ if (hasMeassure(counter) && !Geom::are_near(start, end)) {
Glib::ustring idprev = Glib::ustring("infoline-on-start-");
idprev += Glib::ustring::format(counter-1);
idprev += "-";
idprev += lpobjid;
- SPObject *elemref = NULL;
- if (elemref = document->getObjectById(idprev.c_str())) {
+ SPObject *elemref = document->getObjectById(idprev.c_str());
+ if (elemref){
SPPath* path = dynamic_cast<SPPath *>(elemref);
if (path) {
SPCurve* prevcurve = path->getCurve();
@@ -698,8 +697,8 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
idstart += Glib::ustring::format(counter);
idstart += "-";
idstart += lpobjid;
- elemref = NULL;
- if (elemref = document->getObjectById(idstart.c_str())) {
+ elemref = document->getObjectById(idstart.c_str());
+ if (elemref) {
SPPath* path = dynamic_cast<SPPath *>(elemref);
if (path) {
SPCurve* startcurve = path->getCurve();
@@ -713,8 +712,8 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
idend += Glib::ustring::format(counter);
idend += "-";
idend += lpobjid;
- elemref = NULL;
- if (elemref = document->getObjectById(idend.c_str())) {
+ elemref = document->getObjectById(idend.c_str());
+ if (elemref) {
SPPath* path = dynamic_cast<SPPath *>(elemref);
if (path) {
SPCurve* endcurve = path->getCurve();
@@ -728,8 +727,8 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
idnext += Glib::ustring::format(counter+1);
idnext += "-";
idnext += lpobjid;
- elemref = NULL;
- if (elemref = document->getObjectById(idnext.c_str())) {
+ elemref = document->getObjectById(idnext.c_str());
+ if (elemref) {
SPPath* path = dynamic_cast<SPPath *>(elemref);
if (path) {
SPCurve* nextcurve = path->getCurve();
@@ -766,7 +765,7 @@ LPEMeasureSegments::doBeforeEffect (SPLPEItem const* lpeitem)
items.push_back(Glib::ustring("ArrowDIN-start"));
items.push_back(Glib::ustring("ArrowDIN-end"));
}
- if ((Geom::are_near(prev, prev_stored, 0.01) && Geom::are_near(next, next_stored, 0.01) ||
+ if (((Geom::are_near(prev, prev_stored, 0.01) && Geom::are_near(next, next_stored, 0.01)) ||
fix_overlaps_degree == 180) &&
Geom::are_near(start, start_stored, 0.01) &&
Geom::are_near(end, end_stored, 0.01) &&
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index 326e540c4..b18242dff 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -442,7 +442,7 @@ unsigned SPText::_buildLayoutInput(SPObject *root, Inkscape::Text::Layout::Optio
if (style->shape_inside.set ) {
// Find union of all exclusion shapes
- Shape *exclusion_shape;
+ Shape *exclusion_shape = NULL;
if(style->shape_subtract.set) {
exclusion_shape = _buildExclusionShape();
}
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index ff5ea8d78..d8c5d929f 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -342,6 +342,9 @@ BoolOpErrors Inkscape::ObjectSet::pathBoolOp(bool_op bop, const bool skip_undo,
DocumentUndo::done(doc, verb, description);
}
break;
+ case DONE_NO_ACTION:
+ // Do nothing (?)
+ break;
}
return returnCode;
}
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index ce792383b..58a276090 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -1060,17 +1060,19 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop)
}
}
- for (int i = 0; i < text.length(); ++i)
+ for (unsigned int i = 0; i < text.length(); ++i)
it.prevCharacter();
+
it_next = layout->charIndexToIterator(layout->iteratorToCharIndex(it));
for (int i = 0; i < nr_blocks; ++i)
{
- for (int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j)
+ for (unsigned int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j)
it_next.nextCharacter();
+
sp_te_apply_style(tc->text, it, it_next, te_selected_style[i]);
te_update_layout_now_recursive(tc->text);
- for (int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j)
+ for (unsigned int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j)
it.nextCharacter();
}
}
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 045b4a98e..75c217af9 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -169,7 +169,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index)
Geom::Point mp = Geom::Point(a.mx0 * b->min()[Geom::X] + a.mx1 * b->max()[Geom::X],
a.my0 * b->min()[Geom::Y] + a.my1 * b->max()[Geom::Y]);
- if (sel_as_group)
+ if (sel_as_group) {
if (focus) {
// use bounding box of all selected elements except the "focused" element
Inkscape::ObjectSet copy;
@@ -180,6 +180,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index)
// use bounding box of all selected elements
b = selection->preferredBounds();
}
+ }
//Move each item in the selected list separately
bool changed = false;
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index 0be3ef684..4ae0f4a6d 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -1308,7 +1308,7 @@ static void
sp_ui_import_files(gchar *buffer)
{
gchar** l = g_uri_list_extract_uris(buffer);
- for (int i = 0; i< g_strv_length (l); i++) {
+ for (unsigned int i=0; i < g_strv_length(l); i++) {
gchar *f = g_filename_from_uri (l[i], NULL, NULL);
sp_ui_import_one_file_with_check(f, NULL);
g_free(f);
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp
index 07c9c118b..c95cc8b47 100644
--- a/src/ui/tools/eraser-tool.cpp
+++ b/src/ui/tools/eraser-tool.cpp
@@ -786,7 +786,7 @@ void EraserTool::set_to_accumulated() {
selection->raiseToTop(true);
selection->add(dup_clip);
selection->pathDiff(true);
- SPItem * clip = SP_ITEM(*(selection->items().begin()));
+ //SPItem * clip = SP_ITEM(*(selection->items().begin()));
}
}
}
diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp
index ba3e767b7..c2bc23d8b 100644
--- a/src/ui/tools/measure-tool.cpp
+++ b/src/ui/tools/measure-tool.cpp
@@ -613,7 +613,7 @@ bool MeasureTool::root_handler(GdkEvent* event)
}
} else {
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Util::Unit const * unit = desktop->getNamedView()->getDisplayUnit();
+ //Inkscape::Util::Unit const * unit = desktop->getNamedView()->getDisplayUnit();
for (size_t idx = 0; idx < measure_item.size(); ++idx) {
sp_canvas_item_destroy(measure_item[idx]);
}
diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp
index 703e57ac8..e94da4813 100644
--- a/src/ui/tools/mesh-tool.cpp
+++ b/src/ui/tools/mesh-tool.cpp
@@ -73,14 +73,14 @@ const std::string MeshTool::prefsPath = "/tools/mesh";
MeshTool::MeshTool()
: ToolBase(cursor_gradient_xpm)
+// TODO: Why are these connections stored as pointers?
+ , selcon(NULL)
+ , subselcon(NULL)
, cursor_addnode(false)
, node_added(false)
, show_handles(true)
, edit_fill(true)
, edit_stroke(true)
-// TODO: Why are these connections stored as pointers?
- , selcon(NULL)
- , subselcon(NULL)
{
// TODO: This value is overwritten in the root handler
this->tolerance = 6;
@@ -1060,7 +1060,6 @@ static void sp_mesh_new_default(MeshTool &rc) {
SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop;
Inkscape::Selection *selection = desktop->getSelection();
SPDocument *document = desktop->getDocument();
- ToolBase *ec = SP_EVENT_CONTEXT(&rc);
if (!selection->isEmpty()) {
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 38c6adae1..388992897 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -2058,7 +2058,7 @@ void ZoomVerb::perform(SPAction *action, void *data)
}
case SP_VERB_FLIP_VERTICAL:
{
- gint mul = 1 + Inkscape::UI::Tools::gobble_key_events( GDK_KEY_parenright, 0);
+ /* gint mul = 1 + */ Inkscape::UI::Tools::gobble_key_events( GDK_KEY_parenright, 0);
// While drawing with the pen/pencil tool, flip towards the end of the unfinished path
if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;