[Bf-committers] 64 bits coding
Ton Roosendaal
ton at blender.org
Sun Apr 29 13:19:41 CEST 2007
Hi,
I've reviewed all code in source/blender/ for 64 bits fitness (by using
gcc warnings). The current state seems to be pretty good, also for
.blend projects using > 4 GB. Although that statement should get
evidence once. :)
What I didn't check yet was the game engine, and all libraries in
intern and extern.
Nevertheless, the ban on 64 bits has been relieved, and I look forward
to stress tests! :)
Here are a couple of issues we need to solve:
----------- Casting ---------
General: how to cast int->pointer and pointer->int for cases where you
want it? We have plenty of callback functions using 'void *' as general
in/out.
The weird thing is that gcc accepts this by casting via long, example:
int a= 0;
void *b;
b= (void *)(long)a; /* no warning! */
a= (long)b; /* no warning! */
------------ Subsurf code ------------
blenkernel, subsurf_ccg.c
- void pointers (like CCGFaceHDL) are mixed up with indices.
It seems the vert/edge/face 'HDL' variables are always indices, not
pointers ever. Very confusing...
- struct UvMapVert has a mysterious element 'f' which is an index but
also being multiplied with 4...?
- strange index multiplications you find all over in this file (*4)
-------------- Hash tables -----------
blenlib, BLI_ghash.c edgehash.c, BLI_heap.c
- make API wrappers for int index hashes? Will solve plenty of warnings
-Ton-
------------------------------------------------------------------------
--
Ton Roosendaal Blender Foundation ton at blender.org
http://www.blender.org
More information about the Bf-committers
mailing list