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:
authorCampbell Barton <ideasman42@gmail.com>2020-07-24 12:39:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-07-24 12:41:50 +0300
commit141deeefff5f68a3fd629f91ddda22ba49f9a4e0 (patch)
tree69c868946543f01e91b62629df5f0549b30f255f /source/blender/makesdna
parent22b8ac80d2857caa1fe77d6ec3c90b547b1152a7 (diff)
DNA: disable 'int8_t' since it's not properly supported
Currently negative values from this type will be changed if the int8_t changes to a int16_t for e.g.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/intern/dna_utils.c4
-rw-r--r--source/blender/makesdna/intern/makesdna.c15
2 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/makesdna/intern/dna_utils.c b/source/blender/makesdna/intern/dna_utils.c
index 97f4785374a..3cf5c52a4c6 100644
--- a/source/blender/makesdna/intern/dna_utils.c
+++ b/source/blender/makesdna/intern/dna_utils.c
@@ -235,7 +235,9 @@ void DNA_alias_maps(enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash
if (version_dir == DNA_RENAME_STATIC_FROM_ALIAS) {
const char *renames[][2] = {
- {"int8_t", "char"}, /* Note that a char is always unsigned in Blender. */
+ /* Disable 'int8_t' until we support 'signed char', since changing negative
+ * values to a different type isn't supported and will change the value. */
+ /* {"int8_t", "char"}, */
{"uint8_t", "uchar"},
{"int16_t", "short"},
{"uint16_t", "ushort"},
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 182296c0ba2..48258f39604 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -1530,12 +1530,21 @@ int main(int argc, char **argv)
#endif /* if 0 */
-/* even though DNA supports, 'long' shouldn't be used since it can be either 32 or 64bit,
- * use int or int64_t instead.
+/**
+ * Disable types:
+ *
+ * - 'long': even though DNA supports, 'long' shouldn't be used since it can be either 32 or 64bit,
+ * use int, int32_t or int64_t instead.
+ * - 'int8_t': as DNA doesn't yet support 'signed char' types,
+ * all char types are assumed to be unsigned.
+ * We should be able to support this, it's just not something which has been added yet.
+ *
* Only valid use would be as a runtime variable if an API expected a long,
- * but so far we dont have this happening. */
+ * but so far we don't have this happening.
+ */
#ifdef __GNUC__
# pragma GCC poison long
+# pragma GCC poison int8_t
#endif
#include "DNA_ID.h"