Warning / bug in nodepath.cpp

I was going through some files, and cleaning up the minor warnings we get with -Wall. However, some are not minor! (-Wall is good. -Wall is our friend!)
Anyway, there is a warning that 'xn' and 'xp' are used unitialized in nodepath.cpp at line 2081. There are several places in SP/Ink code where apparently the author expects an uninitialized double to be 0.0, and I thought this was one of them. On closer inspection, the troublesome code is the following. At the indicated line, if xn and xp are 0.0, that would make the condition always false. It would be, and probably is, the same as an '#IF 0'. I doubt if that is the intention. What should we do?
Bob
node_request (SPKnot *knot, NRPoint *p, guint state, gpointer data) { SPPathNode * n; double yn, xn, yp, xp; double an, ap, na, pa; double d_an, d_ap, d_na, d_pa; gboolean collinear = FALSE; NRPoint c; NRPoint pr;
n = (SPPathNode *) data;
if (state & GDK_CONTROL_MASK) { // constrained motion
##### THIS LINE #######: if (state & GDK_MOD1_MASK && !(xn == 0 && xp == 0)) { // sliding on handles, only if at least one of the... // calculate relative distances of control points yn = n->n.pos.y - n->pos.y; xn = n->n.pos.x - n->pos.x; if (xn < 0) { xn = -xn; yn = -yn; } // limit the ....
participants (1)
-
Bob Jamison