[Bf-blender-cvs] [a0867f05a48] master: DNA: support structs with a size of 1 or 2 bytes.

Jacques Lucke noreply at git.blender.org
Fri Feb 5 16:26:26 CET 2021


Commit: a0867f05a48e2017a3b634cda5471c015af5bf35
Author: Jacques Lucke
Date:   Fri Feb 5 16:24:29 2021 +0100
Branches: master
https://developer.blender.org/rBa0867f05a48e2017a3b634cda5471c015af5bf35

DNA: support structs with a size of 1 or 2 bytes.

Before the smallest possible dna struct size was 4 bytes.

Differential Revision: https://developer.blender.org/D10287

===================================================================

M	source/blender/makesdna/intern/makesdna.c

===================================================================

diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 843e6935416..7624649bf78 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -1074,7 +1074,7 @@ static int calculate_struct_sizes(int firststruct, FILE *file_verify, const char
             }
           }
 
-          if (size_native % 4) {
+          if (size_native % 4 && !ELEM(size_native, 1, 2)) {
             fprintf(stderr,
                     "Sizeerror 4 in struct: %s (add %d bytes)\n",
                     types[structtype],



More information about the Bf-blender-cvs mailing list