Ben Fowler wrote:
Around line 50:
42 Inkscape::XML::Node * defs; 43 44 for (int i = 0; patheffects[i] != NULL && i < 128; i++) { 45 gchar * patheffect = patheffects[i]; 46 47 // This is weird, they should all be references... but anyway 48 if (patheffect[0] != '#') continue; 49 50 Inkscape::XML::Node * prefs = sp_repr_lookup_child(defs, "id", &(patheffect[1])); 51 if (prefs == NULL) { 52 53 continue; 54 }
I get a warning about use of uninitialised variable 'defs', and I guess I didn't have my shredded wheat today, because I can't seem to work out whether this warning counts for anything. Should defs be initialised to NULL?
Ben
No, the first argument is the context node. It is the node whose children you will be searching. I suspect that it should be set to Inkscape::XML::Node * defs = path;
Or just forget 'defs' and use 'path' in the function.
It's a Good Warning! ;-)
bob