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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-01-09 20:53:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-09 20:53:59 +0300
commit8a924899a9e95e33ccdf1568a7b38d355bb91a38 (patch)
tree71eda63ea023940cef6c7725609c500596953e3a /source
parent296d125e2596ecd11be32617b32d29b085b26863 (diff)
Byte swap doubles on file read
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/versioning_legacy.c8
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c29
2 files changed, 8 insertions, 29 deletions
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c
index ff390809a9b..f2d42849bcc 100644
--- a/source/blender/blenloader/intern/versioning_legacy.c
+++ b/source/blender/blenloader/intern/versioning_legacy.c
@@ -1787,14 +1787,6 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main)
ma = ma->id.next;
}
- /* this should have been done loooong before! */
-#if 0 /* deprecated in 2.5+ */
- while (ob) {
- if (ob->ipowin == 0)
- ob->ipowin = ID_OB;
- ob = ob->id.next;
- }
-#endif
for (sc = main->screen.first; sc; sc = sc->id.next) {
ScrArea *sa;
for (sa = sc->areabase.first; sa; sa = sa->next) {
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 16fbcbebe50..cea61656abb 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -1168,10 +1168,10 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
}
}
else {
- /* non-struct field type */
+ /* non-struct field type */
if (ispointer(name)) {
if (oldsdna->pointerlen == 8) {
-
+
mul = DNA_elem_array_size(name);
cpo = cur;
while (mul--) {
@@ -1186,20 +1186,14 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
}
}
else {
-
- if (spc[0] == SDNA_TYPE_SHORT ||
- spc[0] == SDNA_TYPE_USHORT)
- {
-
- /* exception: variable called blocktype/ipowin: derived from ID_ */
+ if (ELEM(spc[0], SDNA_TYPE_SHORT, SDNA_TYPE_USHORT)) {
+
+ /* exception: variable called blocktype: derived from ID_ */
bool skip = false;
if (name[0] == 'b' && name[1] == 'l') {
if (strcmp(name, "blocktype") == 0) skip = true;
}
- else if (name[0] == 'i' && name[1] == 'p') {
- if (strcmp(name, "ipowin") == 0) skip = true;
- }
-
+
if (skip == false) {
mul = DNA_elem_array_size(name);
cpo = cur;
@@ -1211,11 +1205,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
}
}
}
- else if ( (spc[0] == SDNA_TYPE_INT ||
- spc[0] == SDNA_TYPE_LONG ||
- spc[0] == SDNA_TYPE_ULONG ||
- spc[0] == SDNA_TYPE_FLOAT))
- {
+ else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT, SDNA_TYPE_LONG, SDNA_TYPE_ULONG)) {
mul = DNA_elem_array_size(name);
cpo = cur;
@@ -1229,9 +1219,7 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
cpo += 4;
}
}
- else if ( (spc[0] == SDNA_TYPE_INT64) ||
- (spc[0] == SDNA_TYPE_UINT64))
- {
+ else if (ELEM(spc[0], SDNA_TYPE_INT64, SDNA_TYPE_UINT64, SDNA_TYPE_DOUBLE)) {
mul = DNA_elem_array_size(name);
cpo = cur;
while (mul--) {
@@ -1243,7 +1231,6 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
cpo += 8;
}
}
- /* FIXME: no conversion for SDNA_TYPE_DOUBLE? */
}
}
cur += elen;