Robert Osfield wrote:
Hi Jason,
I've fixed the warning by changing an int to std::string::size_type, I
presume you didn't spot the warning because you're on a 32bit OS while
I'm working under 64bit. Alas fixing this warning and associated code
didn't solve the crash.
Ah, yes. I probably did make a few 32-bit assumptions, now that you
mention it. I've been trying to get better at this, but we're still
using 32-bit OS here at work, so it's been hard to practice.
On reviewing VBSPReader.cpp to fix this warning I noticed that you
declare all your variables at the top of each method. This is C style
coding that is best avoided as it can easily lead to uninitialized
variables. Best practice in C++ varable declaration is to move the
variable declaration to where it's first required and to always
initialize it if no default is otherwise provided.
Well, I fundamentally disagree with you on this (I've personally had a
lot more problems with declaring variables inline), but this is more of
a philosophical argument. It's your project, so I'll play by your
rules :-)
I've moved the declarations and added initializers to a couple of the
methods in VBSOReader.cpp These changes are your fix to
CBSPGeometry.cpp are checked in as revision 9241. Could review this
and particular look at the variable declaration changes, and use this
type in the rest of the code as there is a chance that an
uninitialized variable is the cause of this problem.
I took a look, the changes are fine with me. I'm pretty sure the
variables were initialized as they were, it's more likely to be a
32/64-bit problem. I admit I wasn't as careful as I should have been in
this regard. Unfortunately, something urgent came up at work today, so
I won't be able to make any more fixes. The next week and a half are
kind of full too, but I'll see if I can't find some time to look at it
soon. I've got a 64-bit Linux machine at home, too, so I'll make sure I
check it there before I send any more submissions.
--"J"
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org