[Bf-blender-cvs] CVS commit: blender/source/blender/src editmesh.c editmesh_tools.c editscreen.c
Ton Roosendaal
ton at blender.org
Thu Jul 14 15:12:29 CEST 2005
ton (Ton Roosendaal) 2005/07/14 15:12:29 CEST
Modified files:
blender/source/blender/src editmesh.c editmesh_tools.c
editscreen.c
Log:
Fix for a *very* nasty bug... somewhere in the ancient past - I tracked it
back to 1.4 - comparing pointers apparently gave warnings or errors... I
don't really have a memory of that. Could be the Irix compiler.
What it was used for is sorting edges in arrays or hash lists, like:
if( ((long)v1) > ((long)v2) )
long is defined to be pointer size, so that should work 32/64 bits, where
it not that the long cast makes the value SIGNED! :)
Ken Hughes discovered this... noting that when his system uses a calloc, the
returned pointer had an uncommon address making the long negative.
It was a very hard bug to track, since (apparently) most OS's have an address
space being still in the lower part of an long...
Anyhoo; I have removed a couple of (long) casts from pointer comparing now,
need to get compile feedback if that's compliant for all our OS's.
If so, quite a lot of such hacks have to be removed from our code, or make
them casting to an unsigned long...
This has been confirmed to fix bugs #2709 and #2710. Thanks Ken!
Revision Changes Path
1.140 +2 -2 blender/source/blender/src/editmesh.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/src/editmesh.c.diff?r1=1.139&r2=1.140&cvsroot=bf-blender>
1.58 +5 -5 blender/source/blender/src/editmesh_tools.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/src/editmesh_tools.c.diff?r1=1.57&r2=1.58&cvsroot=bf-blender>
1.103 +2 -2 blender/source/blender/src/editscreen.c
<http://projects.blender.org/viewcvs/viewcvs.cgi/blender/source/blender/src/editscreen.c.diff?r1=1.102&r2=1.103&cvsroot=bf-blender>
More information about the Bf-blender-cvs
mailing list