diff options
author | Jacques Lucke <jacques@blender.org> | 2020-07-23 16:42:45 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-07-23 16:42:45 +0300 |
commit | 8d35dceb14612322a0b70b36b94a2b63893a72af (patch) | |
tree | a146fed51322e702c2cde5b0c17c06249a565423 /source | |
parent | ee98dc8d0fc8d25a2369e6da58d76652f324c8ea (diff) |
DNA: support fixed size integers
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8373
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/intern/dna_utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c index 6708365a4c8..97f4785374a 100644 --- a/source/blender/makesdna/intern/dna_utils.c +++ b/source/blender/makesdna/intern/dna_utils.c @@ -232,6 +232,21 @@ void DNA_alias_maps(enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash for (int i = 0; i < ARRAY_SIZE(data); i++) { BLI_ghash_insert(struct_map, (void *)data[i][elem_key], (void *)data[i][elem_val]); } + + if (version_dir == DNA_RENAME_STATIC_FROM_ALIAS) { + const char *renames[][2] = { + {"int8_t", "char"}, /* Note that a char is always unsigned in Blender. */ + {"uint8_t", "uchar"}, + {"int16_t", "short"}, + {"uint16_t", "ushort"}, + {"int32_t", "int"}, + {"uint32_t", "int"}, + }; + for (int i = 0; i < ARRAY_SIZE(renames); i++) { + BLI_ghash_insert(struct_map, (void *)renames[i][0], (void *)renames[i][1]); + } + } + *r_struct_map = struct_map; /* We know the direction of this, for local use. */ |