Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-06-21 14:52:23 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-21 14:52:23 +0400
commitff998e15a75a1f38db1e3fc91f7f0ef6664e4e45 (patch)
tree5540573fa941b7be67b701ccb9956cc90a7eb801 /source/blender/makesdna/intern
parentc250ab893c0b0086011d44848b66e53adcff8cad (diff)
Fixes for 8vytes scalar types used in DNA (int64 and double)
- makesdna wasn't checking whether such scalars are aligned to 8 bytes. Now it should be handled correct. - Some scalars in Object structure weren't 8 bytes aligned, which lead to some incorrectly loaded files. Fixed by adding void *pad. It's a bit tricky part of patch, but can't see clearer way to make alignment correct Usually ints/chars were used for padding, but in this case there are some leading pointer properties before int64 properties and using pointer as a padding resolves alignment on both 32 and 64 bit platforms. Using pointers as padding weren't needed before, because all types were correctly aligned independent of whether pointers are 4 or 8 bytes. This fixes #31774: Empty offset Y parameter is resetting
Diffstat (limited to 'source/blender/makesdna/intern')
-rw-r--r--source/blender/makesdna/intern/makesdna.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index b0f8f02ae9f..09cb22683a7 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -798,7 +798,11 @@ static int calculate_structlens(int firststruct)
}
}
- /* 2-4 aligned/ */
+ /* 2-4-8 aligned/ */
+ if (type < firststruct && typelens[type] > 4 && (len % 8)) {
+ printf("Align 8 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len % 8);
+ dna_error = 1;
+ }
if (typelens[type] > 3 && (len % 4) ) {
printf("Align 4 error in struct: %s %s (add %d padding bytes)\n", types[structtype], cp, len % 4);
dna_error = 1;