Merge remote-tracking branch 'origin/master' into blender2.8
[blender.git] / source / blender / makesdna / DNA_sdna_types.h
index b3419a77aabd9020c282988225fee67f6ac11cc2..27d18e496345069ffaf4d05532012bd7c081089c 100644 (file)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#ifndef DNA_SDNA_H
-#define DNA_SDNA_H
 /**
  * \file DNA_sdna_types.h
  * \ingroup DNA
  */
 
+#ifndef __DNA_SDNA_TYPES_H__
+#define __DNA_SDNA_TYPES_H__
+
 #
 #
 typedef struct SDNA {
-       char *data;                     /* full copy of 'encoded' data */
+       const char *data;       /* full copy of 'encoded' data (when data_alloc is set, otherwise borrowed). */
        int datalen;            /* length of data */
+       bool data_alloc;
 
        int nr_names;           /* total number of struct members */
-       const char **names;             /* struct member names */
+       const char **names;     /* struct member names */
 
        int pointerlen;         /* size of a pointer in bytes */
 
        int nr_types;           /* number of basic types + struct types */
-       char **types;           /* type names */
+       const char **types;     /* type names */
        short *typelens;        /* type lengths */
 
        int nr_structs;         /* number of struct types */
-       short **structs;        /* sp= structs[a] is the address of a struct definintion
-                                                  sp[0] is struct type number, sp[1] amount of members
-
-                                                  (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
-                                                  type and name numbers respectively */
+       short **structs;        /* sp = structs[a] is the address of a struct definition
+                            * sp[0] is struct type number, sp[1] amount of members
+                            *
+                            * (sp[2], sp[3]), (sp[4], sp[5]), .. are the member
+                            * type and name numbers respectively */
 
        struct GHash *structs_map; /* ghash for faster lookups,
-                                                                 requires WITH_DNA_GHASH to be used for now */
-
-               /* wrong place for this really, its a simple
-                * cache for findstruct_nr.
-                */
-       int lastfind;
+                                   * requires WITH_DNA_GHASH to be used for now */
 } SDNA;
 
 #
 #
 typedef struct BHead {
        int code, len;
-       void *old;
+       const void *old;
        int SDNAnr, nr;
 } BHead;
 #
@@ -80,14 +77,8 @@ typedef struct BHead4 {
 #
 typedef struct BHead8 {
        int code, len;
-#if defined(WIN32) && !defined(FREE_WINDOWS)
-       /* This is a compiler type! */
-       __int64 old;
-#else
-       long long old;
-#endif 
+       int64_t old;
        int SDNAnr, nr;
 } BHead8;
 
 #endif
-