Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32bits support? #45

Closed
AllanHasegawa opened this issue Apr 17, 2014 · 1 comment
Closed

32bits support? #45

AllanHasegawa opened this issue Apr 17, 2014 · 1 comment

Comments

@AllanHasegawa
Copy link
Contributor

The documentation for the ".octreenodes" files says that "children base address" and "data address" are of type "size_t", then it says it is a 64bit number, and it may not be. In 32bits systems, a "size_t" may be 32bits. Actually, it's the size of an unsigned it.

I tested compiling the code using both 32 bits and 64 bits modes and got different ".octreenodes" for each mode. The main problem is that they are not compatible, and just part of the children nodes are saved. Below I'm posting a hexdump of the start of a file saved running the 32 bit version. As can be seem, a "data address" and a "children base address" both uses 32bits each, followed by 32bits of "child offsets" (it's just 4 children offsets instead of 8). ("ff" are the -1s, I think)

0000000: 0100 0000 0000 0000 ffff ffff 0100 0000  ................
0000010: 0000 0000 ffff ffff 0100 0000 0000 0000  ................
0000020: ffff ffff 0100 0000 0000 0000 ffff ffff  ................
0000030: 0100 0000 0000 0000 ffff ffff 0100 0000  ................

Not sure if it was intentional (32bits aren't actually supported), just reporting.

Also, VOXELDATA_SIZE (line) on my system (Gentoo 64bits, with Clang 3.4) is of size 22bytes, or 176bits. Which is different than 64+64+(8*8)bits, or 24bytes (the size of the "Node" class). Still not sure if its a problem or not. I was looking at the function "writeVoxelData" and thought it was the function saving each node, well, it's late here.

@Forceflow
Copy link
Owner

(super-late reply, something was wrong in my github notification settings)

That is indeed a consequence of only supporting 64-bit. I should just change all those size_t's to uint64, but it's force of habit :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants