[Bf-committers] msvc6 build freezes when selecting bone in pose mode

bjornmose bjornmose at gmx.net
Wed Oct 12 21:46:23 CEST 2005

Subject with more details : msvc6 build freezes when selecting bone in 
pose mode with visible IPO space, on msvc7 IPO space is drawn with weird 

Hi Ton 'n all

Took me a night of printf() /*yeah, msvc6 debugger did not help this 
time */ debugging to find:

Some old ( 2.38 ) files with IPO chanels in armatures showed that, 
sometimes ( reproducable per file )
in  editipo.c, make_editipo(void)  the G.sipo->ipo->cur sruct is all 
zeros so that in line 887:
if(rf->xmin<rf->xmax && rf->ymin<rf->ymax) G.v2d->cur= *rf;
fails and G.v2d->cur is not initialized because there is no
else ipo_default_v2d_cur(G.sipo->blocktype, &G.v2d->cur);
which would give nice default values in this case.

I'm not sure if this is a 'top of the iceberg' fix for problems located 
deep down in readfile.c. Anyway since make_editipo(void) promises to 
care for it all in any case i think that 'if' must have an 'else'.

Just for fun the rest of the error mechanism:
Later in drawip.c , drawscroll() we find
fac= (ipogrid_startx-G.v2d->cur.xmin)/(G.v2d->cur.xmax-G.v2d->cur.xmin);
msvc6 evaluates this (in realese mode) to fac = -infinty! (having a zero 
a few lines later we see
while(fac < hor.xmax) {
following the math rule: what ever i multiply or add to -infinity it 
stays -infinity and constructs a nice never ending loop.

msvc6 in debug mode and msvc7 don't freeze because they evaluate fac to 
NAN and while (NAN < anything) evaluates to false. However IPO space is 
not drawn nicly since all the scaling magic is simply skipped.

Thanks for reading,
Jens Ole Wund (bjornmose)

More information about the Bf-committers mailing list