From 6c08c8c541e1537958c0ef1bdbab931af692b7f5 Mon Sep 17 00:00:00 2001 From: joncruz Date: Sun, 4 May 2008 05:14:00 +0000 Subject: [PATCH] warning cleanup and fixed string free issue --- src/application/app-prototype.cpp | 4 +- src/dialogs/clonetiler.cpp | 2 +- src/dialogs/find.cpp | 2 +- src/dialogs/item-properties.cpp | 2 +- src/dom/cssreader.cpp | 8 +- src/dom/domimpl.cpp | 24 ++--- src/dom/domstring.cpp | 2 +- src/dom/io/base64stream.cpp | 2 +- src/dom/io/domstream.cpp | 6 +- src/io/base64stream.cpp | 2 +- src/libnr/nr-object.cpp | 6 +- src/libnr/nr-pixblock-line.cpp | 2 +- src/sp-item-group.cpp | 22 ++-- src/sp-tref.cpp | 160 +++++++++++++++--------------- src/sp-use.cpp | 4 +- src/ui/dialog/input.cpp | 26 ++--- src/widgets/sp-xmlview-tree.cpp | 2 +- src/widgets/spinbutton-events.cpp | 2 +- 18 files changed, 139 insertions(+), 139 deletions(-) diff --git a/src/application/app-prototype.cpp b/src/application/app-prototype.cpp index b94f5ea05..3af818824 100644 --- a/src/application/app-prototype.cpp +++ b/src/application/app-prototype.cpp @@ -14,11 +14,11 @@ namespace Inkscape { namespace NSApplication { -AppPrototype::AppPrototype() +AppPrototype::AppPrototype() { } -AppPrototype::AppPrototype(int argc, const char **argv) +AppPrototype::AppPrototype(int /*argc*/, const char **/*argv*/) { } diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index b0bc44bd7..1ce08bfdf 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -68,7 +68,7 @@ static win_data wd; // impossible original values to make sure they are read from prefs static gint x = -1000, y = -1000, w = 0, h = 0; -static gchar *prefs_path = "dialogs.clonetiler"; +static gchar const *prefs_path = "dialogs.clonetiler"; #define SB_MARGIN 1 #define VB_MARGIN 4 diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp index 93077bec1..6f9eca0d7 100644 --- a/src/dialogs/find.cpp +++ b/src/dialogs/find.cpp @@ -77,7 +77,7 @@ static win_data wd; // impossible original values to make sure they are read from prefs static gint x = -1000, y = -1000, w = 0, h = 0; -static gchar *prefs_path = "dialogs.find"; +static gchar const *prefs_path = "dialogs.find"; diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 390452a8a..2f93179e1 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -49,7 +49,7 @@ static win_data wd; // impossible original values to make sure they are read from prefs static gint x = -1000, y = -1000, w = 0, h = 0; -static gchar *prefs_path = "dialogs.object"; +static gchar const *prefs_path = "dialogs.object"; static void sp_item_widget_modify_selection (SPWidget *spw, Inkscape::Selection *selection, guint flags, GtkWidget *itemw); static void sp_item_widget_change_selection (SPWidget *spw, Inkscape::Selection *selection, GtkWidget *itemw); diff --git a/src/dom/cssreader.cpp b/src/dom/cssreader.cpp index 4bbcefb98..4e329d914 100644 --- a/src/dom/cssreader.cpp +++ b/src/dom/cssreader.cpp @@ -1094,7 +1094,7 @@ int CssReader::getSimpleSelector(int p0) * | {empty} * ; */ -int CssReader::getDeclaration(int p0, CSSStyleDeclaration &declarationList) +int CssReader::getDeclaration(int p0, CSSStyleDeclaration &/*declarationList*/) { int p = p0; @@ -1653,7 +1653,7 @@ static const char *fileNames[] = "inkscape.css", "meyerweb.css", NULL - }; + }; bool doTests() { @@ -1666,8 +1666,8 @@ bool doTests() printf("Test failed\n"); return false; } - } - return true; + } + return true; } int main(int argc, char **argv) diff --git a/src/dom/domimpl.cpp b/src/dom/domimpl.cpp index 663a8febc..e932cfd80 100644 --- a/src/dom/domimpl.cpp +++ b/src/dom/domimpl.cpp @@ -82,7 +82,7 @@ DOMImplementationSourceImpl::~DOMImplementationSourceImpl() * */ DOMImplementation *DOMImplementationSourceImpl::getDOMImplementation( - const DOMString &features) + const DOMString &/*features*/) { return domImpl; } @@ -91,7 +91,7 @@ DOMImplementation *DOMImplementationSourceImpl::getDOMImplementation( * */ DOMImplementationList DOMImplementationSourceImpl::getDOMImplementationList( - const DOMString &features) + const DOMString &/*features*/) { return domImplList; } @@ -124,8 +124,8 @@ DOMImplementationImpl::~DOMImplementationImpl() /** * */ -bool DOMImplementationImpl::hasFeature(const DOMString& feature, - const DOMString& version) +bool DOMImplementationImpl::hasFeature(const DOMString& /*feature*/, + const DOMString& /*version*/) { return false; } @@ -163,8 +163,8 @@ DocumentPtr DOMImplementationImpl::createDocument( /** * */ -DOMObject *DOMImplementationImpl::getFeature(const DOMString& feature, - const DOMString& version) +DOMObject *DOMImplementationImpl::getFeature(const DOMString& /*feature*/, + const DOMString& /*version*/) { return NULL; @@ -514,8 +514,8 @@ void NodeImpl::normalize() /** * */ -bool NodeImpl::isSupported(const DOMString& feature, - const DOMString& version) +bool NodeImpl::isSupported(const DOMString& /*feature*/, + const DOMString& /*version*/) { //again, no idea return false; @@ -891,8 +891,8 @@ bool NodeImpl::isEqualNode(const NodePtr nodeArg) /** * */ -DOMObject *NodeImpl::getFeature(const DOMString &feature, - const DOMString &version) +DOMObject *NodeImpl::getFeature(const DOMString &/*feature*/, + const DOMString &/*version*/) { //dont know return NULL; @@ -1083,8 +1083,8 @@ NodeImpl::NodeImpl(DocumentImplPtr owner, const DOMString &nodeName) /** * */ -NodeImpl::NodeImpl(DocumentImplPtr owner, const DOMString &theNamespaceURI, - const DOMString &qualifiedName) : Node() +NodeImpl::NodeImpl(DocumentImplPtr owner, const DOMString &/*theNamespaceURI*/, + const DOMString &qualifiedName) : Node() { init(); ownerDocument = owner; diff --git a/src/dom/domstring.cpp b/src/dom/domstring.cpp index 34629edb6..eb00afa8e 100644 --- a/src/dom/domstring.cpp +++ b/src/dom/domstring.cpp @@ -146,7 +146,7 @@ DOMString &DOMString::assign(const std::string &str) } -void DOMString::erase(unsigned long pos, unsigned long count) +void DOMString::erase(unsigned long /*pos*/, unsigned long count) { std::vector::iterator iter = chars.begin(); chars.erase(iter, iter + count); diff --git a/src/dom/io/base64stream.cpp b/src/dom/io/base64stream.cpp index 2cab2b3f4..509c67d6d 100644 --- a/src/dom/io/base64stream.cpp +++ b/src/dom/io/base64stream.cpp @@ -188,7 +188,7 @@ int Base64InputStream::get() //# B A S E 6 4 O U T P U T S T R E A M //######################################################################### -static char *base64encode = +static char const *base64encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** diff --git a/src/dom/io/domstream.cpp b/src/dom/io/domstream.cpp index 6f8dc634d..bc3810de0 100644 --- a/src/dom/io/domstream.cpp +++ b/src/dom/io/domstream.cpp @@ -72,11 +72,11 @@ void pipeStream(InputStream &source, OutputStream &dest) //# F O R M A T T E D P R I N T I N G //######################################################################### -static char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; +static char const *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; static int dprintInt(Writer &outs, long arg, int base, - int flag, int width, int precision) + int flag, int width, int /*precision*/) { DOMString buf; @@ -217,7 +217,7 @@ static int dprintDouble(Writer &outs, double val, * XML entities. */ static int dprintString(Writer &outs, const DOMString &str, - int flags, int width, int precision) + int flags, int /*width*/, int /*precision*/) { int len = str.size(); if (flags == '#') diff --git a/src/io/base64stream.cpp b/src/io/base64stream.cpp index e9f8fe2a2..c90f3760b 100644 --- a/src/io/base64stream.cpp +++ b/src/io/base64stream.cpp @@ -166,7 +166,7 @@ int Base64InputStream::get() //# B A S E 6 4 O U T P U T S T R E A M //######################################################################### -static char *base64encode = +static char const *base64encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; /** diff --git a/src/libnr/nr-object.cpp b/src/libnr/nr-object.cpp index 12f57bd81..7ecdd75c3 100644 --- a/src/libnr/nr-object.cpp +++ b/src/libnr/nr-object.cpp @@ -137,11 +137,11 @@ static void nr_object_class_init(NRObjectClass *c) c->cpp_ctor = NRObject::invoke_ctor; } -static void nr_object_init (NRObject *object) +static void nr_object_init (NRObject */*object*/) { } -static void nr_object_finalize (NRObject *object) +static void nr_object_finalize (NRObject */*object*/) { } @@ -237,7 +237,7 @@ static void nr_active_object_class_init(NRActiveObjectClass *c) object_class->cpp_ctor = NRObject::invoke_ctor; } -static void nr_active_object_init(NRActiveObject *object) +static void nr_active_object_init(NRActiveObject */*object*/) { } diff --git a/src/libnr/nr-pixblock-line.cpp b/src/libnr/nr-pixblock-line.cpp index 5e025c7eb..eb8b404b4 100644 --- a/src/libnr/nr-pixblock-line.cpp +++ b/src/libnr/nr-pixblock-line.cpp @@ -13,7 +13,7 @@ #include void -nr_pixblock_draw_line_rgba32 (NRPixBlock *d, long x0, long y0, long x1, long y1, short first, unsigned long rgba) +nr_pixblock_draw_line_rgba32 (NRPixBlock *d, long x0, long y0, long x1, long y1, short /*first*/, unsigned long rgba) { long deltax, deltay, xinc1, xinc2, yinc1, yinc2; long den, num, numadd, numpixels; diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 6ec5256ee..acdf8aa36 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -125,7 +125,7 @@ sp_group_class_init (SPGroupClass *klass) item_class->show = sp_group_show; item_class->hide = sp_group_hide; item_class->snappoints = sp_group_snappoints; - + lpe_item_class->update_patheffect = sp_group_update_patheffect; } @@ -470,7 +470,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) SPItem *item = (SPItem *) doc->getObjectByRepr(repr); sp_item_write_transform(item, repr, item->transform, NULL, false); - + Inkscape::GC::release(repr); if (children && SP_IS_ITEM (item)) *children = g_slist_prepend (*children, item); @@ -478,7 +478,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) items = g_slist_remove (items, items->data); } - if (do_done) + if (do_done) sp_document_done (doc, SP_VERB_NONE, _("Ungroup")); } @@ -625,7 +625,7 @@ void CGroup::onChildRemoved(Inkscape::XML::Node */*child*/) { _group->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void CGroup::onUpdate(SPCtx *ctx, unsigned int flags) { +void CGroup::onUpdate(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx, cctx; ictx = (SPItemCtx *) ctx; @@ -687,9 +687,9 @@ void CGroup::onModified(guint flags) { } void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned const flags) { - + NR::Maybe dummy_bbox = NR::Nothing(); - + GSList *l = _group->childList(false, SPObject::ActionBBox); while (l) { SPObject *o = SP_OBJECT (l->data); @@ -697,10 +697,10 @@ void CGroup::calculateBBox(NRRect *bbox, NR::Matrix const &transform, unsigned c SPItem *child = SP_ITEM(o); NR::Matrix const ct(child->transform * transform); sp_item_invoke_bbox_full(child, &dummy_bbox, ct, flags, FALSE); - } + } l = g_slist_remove (l, o); } - + *bbox = NRRect(dummy_bbox); } @@ -710,7 +710,7 @@ void CGroup::onPrint(SPPrintContext *ctx) { SPObject *o = SP_OBJECT (l->data); if (SP_IS_ITEM(o)) { sp_item_invoke_print (SP_ITEM (o), ctx); - } + } l = g_slist_remove (l, o); } } @@ -722,7 +722,7 @@ gint CGroup::getItemCount() { len++; } } - + return len; } @@ -802,7 +802,7 @@ void CGroup::onOrderChanged (Inkscape::XML::Node *child, Inkscape::XML::Node *, } static void -sp_group_update_patheffect (SPLPEItem *lpeitem, bool write) +sp_group_update_patheffect (SPLPEItem *lpeitem, bool /*write*/) { #ifdef GROUP_VERBOSE g_message("sp_group_update_patheffect: %p\n", lpeitem); diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 1f1cb4351..0c6da3518 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -4,7 +4,7 @@ * SVG implementation - All character data within the referenced * element, including character data enclosed within additional markup, * will be rendered. - * + * * This file was created based on skeleton.cpp */ /* @@ -108,11 +108,11 @@ sp_tref_class_init(SPTRefClass *tref_class) sp_object_class->set = sp_tref_set; sp_object_class->update = sp_tref_update; sp_object_class->modified = sp_tref_modified; - + gobject_class->finalize = sp_tref_finalize; - + SPItemClass *item_class = (SPItemClass *) tref_class; - + item_class->bbox = sp_tref_bbox; item_class->description = sp_tref_description; } @@ -121,13 +121,13 @@ static void sp_tref_init(SPTRef *tref) { new (&tref->attributes) TextTagAttributes; - + tref->href = NULL; tref->uriOriginalRef = new SPTRefReference(SP_OBJECT(tref)); new (&tref->_delete_connection) sigc::connection(); new (&tref->_changed_connection) sigc::connection(); - - tref->_changed_connection = + + tref->_changed_connection = tref->uriOriginalRef->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_tref_href_changed), tref)); } @@ -169,7 +169,7 @@ static void sp_tref_release(SPObject *object) { SPTRef *tref = SP_TREF(object); - + tref->attributes.~TextTagAttributes(); tref->_delete_connection.disconnect(); @@ -192,9 +192,9 @@ sp_tref_set(SPObject *object, unsigned int key, gchar const *value) { debug("0x%p %s(%u): '%s'",object, sp_attribute_name(key),key,value ? value : ""); - + SPTRef *tref = SP_TREF(object); - + if (tref->attributes.readSingleAttribute(key, value)) { // x, y, dx, dy, rotate object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } else if (key == SP_ATTR_XLINK_HREF) { // xlink:href @@ -204,16 +204,16 @@ sp_tref_set(SPObject *object, unsigned int key, gchar const *value) tref->href = NULL; tref->uriOriginalRef->detach(); } else if ((tref->href && strcmp(value, tref->href) != 0) || (!tref->href)) { - + // Value has changed - + if ( tref->href ) { g_free(tref->href); tref->href = NULL; } - + tref->href = g_strdup(value); - + try { tref->uriOriginalRef->attach(Inkscape::URI(value)); tref->uriOriginalRef->updateObserver(); @@ -221,11 +221,11 @@ sp_tref_set(SPObject *object, unsigned int key, gchar const *value) g_warning("%s", e.what()); tref->uriOriginalRef->detach(); } - + // No matter what happened, an update should be in order SP_OBJECT(tref)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } - + } else { // default if (((SPObjectClass *) tref_parent_class)->set) { ((SPObjectClass *) tref_parent_class)->set(object, key, value); @@ -242,7 +242,7 @@ static void sp_tref_update(SPObject *object, SPCtx *ctx, guint flags) { debug("0x%p",object); - + SPTRef *tref = SP_TREF(object); if (((SPObjectClass *) tref_parent_class)->update) { @@ -252,8 +252,8 @@ sp_tref_update(SPObject *object, SPCtx *ctx, guint flags) if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } - - flags &= SP_OBJECT_MODIFIED_CASCADE; + + flags &= SP_OBJECT_MODIFIED_CASCADE; SPObject *child = tref->stringChild; if (child) { @@ -262,7 +262,7 @@ sp_tref_update(SPObject *object, SPCtx *ctx, guint flags) } } - + } static void @@ -273,7 +273,7 @@ sp_tref_modified(SPObject *object, guint flags) if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } - + flags &= SP_OBJECT_MODIFIED_CASCADE; SPObject *child = tref_obj->stringChild; @@ -293,16 +293,16 @@ static Inkscape::XML::Node * sp_tref_write(SPObject *object, Inkscape::XML::Node *repr, guint flags) { debug("0x%p",object); - + SPTRef *tref = SP_TREF(object); - + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(object)); repr = xml_doc->createElement("svg:tref"); } - + tref->attributes.writeTo(repr); - + if (tref->uriOriginalRef->getURI()) { gchar *uri_string = tref->uriOriginalRef->getURI()->toString(); debug("uri_string=%s", uri_string); @@ -353,16 +353,16 @@ static gchar * sp_tref_description(SPItem *item) { SPTRef *tref = SP_TREF(item); - + SPObject *referred = tref->getObjectReferredTo(); - + if (tref && tref->getObjectReferredTo()) { char *child_desc; - + if (SP_IS_ITEM(referred)) { child_desc = sp_item_description(SP_ITEM(referred)); } else { - child_desc = ""; + child_desc = g_strdup(""); } char *ret = g_strdup_printf( @@ -385,25 +385,25 @@ sp_tref_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPTRef *tref) { // Save a pointer to the original object being referred to SPObject *refRoot = tref->getObjectReferredTo(); - + tref->_delete_connection.disconnect(); - + if (tref->stringChild) { sp_object_detach(SP_OBJECT(tref), tref->stringChild); tref->stringChild = NULL; } - + // Ensure that we are referring to a legitimate object if (tref->href && refRoot && sp_tref_reference_allowed(tref, refRoot)) { - + // Update the text being referred to (will create a new string child) - sp_tref_update_text(tref); - + sp_tref_update_text(tref); + // Restore the delete connection now that we're done messing with stuff - tref->_delete_connection = SP_OBJECT(refRoot)->connectDelete(sigc::bind(sigc::ptr_fun(&sp_tref_delete_self), tref)); + tref->_delete_connection = SP_OBJECT(refRoot)->connectDelete(sigc::bind(sigc::ptr_fun(&sp_tref_delete_self), tref)); } - - } + + } } @@ -422,12 +422,12 @@ sp_tref_delete_self(SPObject */*deleted*/, SPTRef *self) SPObject * SPTRef::getObjectReferredTo(void) { SPObject *referredObject = NULL; - + if (uriOriginalRef) { referredObject = SP_OBJECT(uriOriginalRef->getObject()); } - - return referredObject; + + return referredObject; } @@ -438,7 +438,7 @@ bool sp_tref_reference_allowed(SPTRef *tref, SPObject *possible_ref) { bool allowed = false; - + if (tref && possible_ref) { if (tref != possible_ref) { bool ancestor = false; @@ -446,12 +446,12 @@ sp_tref_reference_allowed(SPTRef *tref, SPObject *possible_ref) if (possible_ref == obj) { ancestor = true; break; - } + } } allowed = !ancestor; } } - + return allowed; } @@ -461,13 +461,13 @@ sp_tref_reference_allowed(SPTRef *tref, SPObject *possible_ref) * iterators and layout (or if there is no tref). */ bool -sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, +sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, SPObject *end_item, Glib::ustring::iterator &end) { bool fully_contained = false; - + if (start_item && end_item) { - + // If neither the beginning or the end is a tref then we return true (whether there // is a tref in the innards or not, because if there is one then it must be totally // contained) @@ -475,7 +475,7 @@ sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, && !(SP_IS_STRING(end_item) && SP_IS_TREF(SP_OBJECT_PARENT(end_item)))) { fully_contained = true; } - + // Both the beginning and end are trefs; but in this case, the string iterators // must be at the right places else if ((SP_IS_STRING(start_item) && SP_IS_TREF(SP_OBJECT_PARENT(start_item))) @@ -485,7 +485,7 @@ sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, fully_contained = true; } } - + // If the beginning is a string that is a child of a tref, the iterator has to be // at the beginning of the item else if ((SP_IS_STRING(start_item) && SP_IS_TREF(SP_OBJECT_PARENT(start_item))) @@ -494,7 +494,7 @@ sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, fully_contained = true; } } - + // Same, but the for the end else if (!(SP_IS_STRING(start_item) && SP_IS_TREF(SP_OBJECT_PARENT(start_item))) && (SP_IS_STRING(end_item) && SP_IS_TREF(SP_OBJECT_PARENT(end_item)))) { @@ -503,7 +503,7 @@ sp_tref_fully_contained(SPObject *start_item, Glib::ustring::iterator &start, } } } - + return fully_contained; } @@ -515,23 +515,23 @@ sp_tref_update_text(SPTRef *tref) // Get the character data that will be used with this tref Glib::ustring charData = ""; build_string_from_root(SP_OBJECT_REPR(tref->getObjectReferredTo()), &charData); - + if (tref->stringChild) { sp_object_detach(SP_OBJECT(tref), tref->stringChild); tref->stringChild = NULL; } - + // Create the node and SPString to be the tref's child Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_OBJECT_DOCUMENT(tref)); - + Inkscape::XML::Node *newStringRepr = xml_doc->createTextNode(charData.c_str()); tref->stringChild = SP_OBJECT(g_object_new(sp_repr_type_lookup(newStringRepr), NULL)); - + // Add this SPString as a child of the tref sp_object_attach(SP_OBJECT(tref), tref->stringChild, tref->lastChild()); sp_object_unref(tref->stringChild, NULL); sp_object_invoke_build(tref->stringChild, SP_OBJECT(tref)->document, newStringRepr, TRUE); - + Inkscape::GC::release(newStringRepr); } } @@ -546,13 +546,13 @@ static void build_string_from_root(Inkscape::XML::Node *root, Glib::ustring *retString) { if (root && retString) { - + // Stop and concatenate when a SPString is found if (root->type() == Inkscape::XML::TEXT_NODE) { *retString += (root->content()); - + debug("%s", retString->c_str()); - + // Otherwise, continue searching down the tree (with the assumption that no children nodes // of a SPString are actually legal) } else { @@ -561,7 +561,7 @@ build_string_from_root(Inkscape::XML::Node *root, Glib::ustring *retString) build_string_from_root(childNode, retString); } } - } + } } /** @@ -574,56 +574,56 @@ SPObject * sp_tref_convert_to_tspan(SPObject *obj) { SPObject * new_tspan = NULL; - + //////////////////// // BASE CASE //////////////////// if (SP_IS_TREF(obj)) { - + SPTRef *tref = SP_TREF(obj); - + if (tref && tref->stringChild) { Inkscape::XML::Node *tref_repr = SP_OBJECT_REPR(tref); Inkscape::XML::Node *tref_parent = sp_repr_parent(tref_repr); - + SPDocument *document = SP_OBJECT(tref)->document; Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); - + Inkscape::XML::Node *new_tspan_repr = xml_doc->createElement("svg:tspan"); - + // Add the new tspan element just after the current tref tref_parent->addChild(new_tspan_repr, tref_repr); Inkscape::GC::release(new_tspan_repr); - + new_tspan = document->getObjectByRepr(new_tspan_repr); - + // Create a new string child for the tspan Inkscape::XML::Node *new_string_repr = SP_OBJECT_REPR(tref->stringChild)->duplicate(xml_doc); - new_tspan_repr->addChild(new_string_repr, NULL); - + new_tspan_repr->addChild(new_string_repr, NULL); + //SPObject * new_string_child = document->getObjectByRepr(new_string_repr); - + // Merge style from the tref SPStyle *new_tspan_sty = SP_OBJECT_STYLE(new_tspan); SPStyle const *tref_sty = SP_OBJECT_STYLE(tref); sp_style_merge_from_dying_parent(new_tspan_sty, tref_sty); sp_style_merge_from_parent(new_tspan_sty, new_tspan->parent->style); - - + + SP_OBJECT(new_tspan)->updateRepr(); - + // Hold onto our SPObject and repr for now. sp_object_ref(SP_OBJECT(tref), NULL); Inkscape::GC::anchor(tref_repr); - + // Remove ourselves, not propagating delete events to avoid a // chain-reaction with other elements that might reference us. SP_OBJECT(tref)->deleteObject(false); - + // Give the copy our old id and let go of our old repr. new_tspan_repr->setAttribute("id", tref_repr->attribute("id")); Inkscape::GC::release(tref_repr); - + // Establish the succession and let go of our object. SP_OBJECT(tref)->setSuccessor(new_tspan); sp_object_unref(SP_OBJECT(tref), NULL); @@ -642,15 +642,15 @@ sp_tref_convert_to_tspan(SPObject *obj) while (l) { SPObject *child = SP_OBJECT (l->data); l = g_slist_remove (l, child); - + // Note that there may be more than one conversion happening here, so if it's not a // tref being passed into this function, the returned value can't be specifically known new_tspan = sp_tref_convert_to_tspan(child); - + sp_object_unref (SP_OBJECT (child), obj); } } - + return new_tspan; } diff --git a/src/sp-use.cpp b/src/sp-use.cpp index bc64c5ebc..ec37ef391 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -576,7 +576,7 @@ sp_use_update(SPObject *object, SPCtx *ctx, unsigned flags) if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { for (SPItemView *v = SP_ITEM(object)->display; v != NULL; v = v->next) { - nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); + nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); } } @@ -634,7 +634,7 @@ sp_use_modified(SPObject *object, guint flags) if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { for (SPItemView *v = SP_ITEM(object)->display; v != NULL; v = v->next) { - nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); + nr_arena_group_set_style(NR_ARENA_GROUP(v->arenaitem), SP_OBJECT_STYLE(object)); } } diff --git a/src/ui/dialog/input.cpp b/src/ui/dialog/input.cpp index b76b14e25..25f123797 100644 --- a/src/ui/dialog/input.cpp +++ b/src/ui/dialog/input.cpp @@ -1,7 +1,7 @@ /* XPM */ -static char * core_xpm[] = { +static char const * core_xpm[] = { "16 16 4 1", " c None", ". c #808080", @@ -25,7 +25,7 @@ static char * core_xpm[] = { " "}; /* XPM */ -static char *eraser[] = { +static char const *eraser[] = { /* columns rows colors chars-per-pixel */ "16 16 5 1", " c black", @@ -53,7 +53,7 @@ static char *eraser[] = { }; /* XPM */ -static char *mouse[] = { +static char const *mouse[] = { /* columns rows colors chars-per-pixel */ "16 16 3 1", " c black", @@ -79,7 +79,7 @@ static char *mouse[] = { }; /* XPM */ -static char *pen[] = { +static char const *pen[] = { /* columns rows colors chars-per-pixel */ "16 16 3 1", " c black", @@ -105,7 +105,7 @@ static char *pen[] = { }; /* XPM */ -static char *sidebuttons[] = { +static char const *sidebuttons[] = { /* columns rows colors chars-per-pixel */ "16 16 4 1", " c black", @@ -132,7 +132,7 @@ static char *sidebuttons[] = { }; /* XPM */ -static char *tablet[] = { +static char const *tablet[] = { /* columns rows colors chars-per-pixel */ "16 16 3 1", " c black", @@ -158,7 +158,7 @@ static char *tablet[] = { }; /* XPM */ -static char *tip[] = { +static char const *tip[] = { /* columns rows colors chars-per-pixel */ "16 16 5 1", " c black", @@ -186,7 +186,7 @@ static char *tip[] = { }; /* XPM */ -static char *button_none[] = { +static char const *button_none[] = { /* columns rows colors chars-per-pixel */ "8 8 3 1", " c black", @@ -203,7 +203,7 @@ static char *button_none[] = { "XXXXXXXX" }; /* XPM */ -static char *button_off[] = { +static char const *button_off[] = { /* columns rows colors chars-per-pixel */ "8 8 4 1", " c black", @@ -221,7 +221,7 @@ static char *button_off[] = { "oooooooo" }; /* XPM */ -static char *button_on[] = { +static char const *button_on[] = { /* columns rows colors chars-per-pixel */ "8 8 3 1", " c black", @@ -239,7 +239,7 @@ static char *button_on[] = { }; /* XPM */ -static char * axis_none_xpm[] = { +static char const * axis_none_xpm[] = { "24 8 3 1", " c None", ". c #000000", @@ -253,7 +253,7 @@ static char * axis_none_xpm[] = { " .++++++++++++++++++. ", " "}; /* XPM */ -static char * axis_off_xpm[] = { +static char const * axis_off_xpm[] = { "24 8 4 1", " c None", ". c #808080", @@ -268,7 +268,7 @@ static char * axis_off_xpm[] = { " .++++++++++++++++++. ", " "}; /* XPM */ -static char * axis_on_xpm[] = { +static char const * axis_on_xpm[] = { "24 8 3 1", " c None", ". c #000000", diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp index b2d1a2531..5057e724a 100644 --- a/src/widgets/sp-xmlview-tree.cpp +++ b/src/widgets/sp-xmlview-tree.cpp @@ -88,7 +88,7 @@ static const Inkscape::XML::NodeEventVector pi_repr_events = { static GtkCTreeClass * parent_class = NULL; GtkWidget * -sp_xmlview_tree_new (Inkscape::XML::Node * repr, void * factory, void * data) +sp_xmlview_tree_new (Inkscape::XML::Node * repr, void * /*factory*/, void * /*data*/) { SPXMLViewTree * tree; diff --git a/src/widgets/spinbutton-events.cpp b/src/widgets/spinbutton-events.cpp index 14ac51422..4b60ce812 100644 --- a/src/widgets/spinbutton-events.cpp +++ b/src/widgets/spinbutton-events.cpp @@ -23,7 +23,7 @@ gboolean -spinbutton_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data) +spinbutton_focus_in (GtkWidget *w, GdkEventKey */*event*/, gpointer /*data*/) { gdouble *ini; -- 2.30.2