Howdy,
I grabbed Inkscape 0.40 last night. I've been enjoyin' Inkscape for a little bit now, tryin' to hack a few things into the code (selectable ruler metrics, etc.). I figured it was time to port what modifications I'd been working on to the 0.40 tree.
I'm using GCC (g++/libstdc++) 3.4.3 and Fedora Rawhide (post Core 3).
In nodepath.cpp, I was getting the following compile errors:
nodepath.cpp: In function `void node_ctrl_grabbed(SPKnot*, guint, void*)': nodepath.cpp:2220: error: no matching function for call to Radial::Radial(Radial)' nodepath.h:38: note: candidates are: Radial::Radial(const NR::Point&) nodepath.h:34: note: Radial::Radial(Radial&) nodepath.cpp:2222: error: no matching function for call to Radial::Radial(Radial)' nodepath.h:38: note: candidates are: Radial::Radial(const NR::Point&) nodepath.h:34: note: Radial::Radial(Radial&) make[2]: *** [nodepath.o] Error 1
In examining the code, the problem was with a few anonymous objects when calculating the origin of the grabbed control.
The offensive code is:
// remember the origin of the control if (n->p.knot == knot) { n->p.origin = Radial(n->p.pos - n->pos); } else if (n->n.knot == knot) { n->n.origin = Radial(n->n.pos - n->pos); } else { g_assert_not_reached(); }
n->p.origin is of type Radial; and n->p.pos, n->n.pos, and n->pos are of type NR::Point.
The creation of the anonymous Radial object with the subtraction of Points as the constructor argument seems to be working... The problem seems to be with the assignment of the resulting anonymous Radial object to n->{p,n}.origin.
Translating the current code to pseudo-constructor-syntax (which is more along the lines of what the compiler actually compiles) results in: Radial origin(Radial(Point pos1 - Point pos2)) But since the Radial class has Radial::Radial(NR::Point const &), the following should suffice: Radial origin(Point pos1 - Point pos2) ... thus dropping the superfluous anonymous Radial.
There are two solutions: A) create a pass-by-value Radial constructor, so we can properly pass the anonymous Radial, or B) drop the superfluous anonymous Radial in favor of the assignment being translated into the Radial::Radial(NR::Point const &) constructor.
Attached is a patch that drops the anonymous Radial object in favor of C++ assignment/constructor magic.
Now Inkscape 0.40 compiles and functions without complaint on my system.