DNA: remove endian switching long checks
authorCampbell Barton <ideasman42@gmail.com>
Sat, 9 Jan 2016 20:45:10 +0000 (07:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 9 Jan 2016 20:47:08 +0000 (07:47 +1100)
This wasn't correct, and long was only ever used in cases we can now ignore.

source/blender/makesdna/DNA_genfile.h
source/blender/makesdna/intern/dna_genfile.c

index 9a6c714469226546f484864b6059c20e7aadb2aa..0af26fb1972e324e939bd4850d1389c10a3cbdd6 100644 (file)
@@ -48,11 +48,11 @@ typedef enum eSDNA_Type {
        SDNA_TYPE_SHORT    = 2,
        SDNA_TYPE_USHORT   = 3,
        SDNA_TYPE_INT      = 4,
-       SDNA_TYPE_LONG     = 5,
-       SDNA_TYPE_ULONG    = 6,
+       SDNA_TYPE_LONG     = 5,  /* deprecated (use as int) */
+       SDNA_TYPE_ULONG    = 6,  /* deprecated (use as int) */
        SDNA_TYPE_FLOAT    = 7,
        SDNA_TYPE_DOUBLE   = 8,
-       /* ,SDNA_TYPE_VOID = 9 */ /* nothing uses yet */
+       /* ,SDNA_TYPE_VOID = 9 */
        SDNA_TYPE_INT64    = 10,
        SDNA_TYPE_UINT64   = 11
 } eSDNA_Type;
index cea61656abb377237433bad8f51f4c9e02b4a1bd..f50e38d0390d45100a8b9d95b62a78729585baa1 100644 (file)
@@ -1205,7 +1205,10 @@ void DNA_struct_switch_endian(SDNA *oldsdna, int oldSDNAnr, char *data)
                                                }
                                        }
                                }
-                               else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT, SDNA_TYPE_LONG, SDNA_TYPE_ULONG)) {
+                               else if (ELEM(spc[0], SDNA_TYPE_INT, SDNA_TYPE_FLOAT)) {
+                                       /* note, intentionally ignore long/ulong here these could be 4 or 8 bits,
+                                        * but turns out we only used for runtime vars and
+                                        * only once for a struct type thats no longer used. */
 
                                        mul = DNA_elem_array_size(name);
                                        cpo = cur;