[Bf-blender-cvs] [1a39904b645] workspaces: Cleanup: Deduplicate macro code, comments, redundant struct definitions

Julian Eisel noreply at git.blender.org
Wed May 31 13:51:59 CEST 2017


Commit: 1a39904b645bf7e26481701eeacca0f52af0f9f6
Author: Julian Eisel
Date:   Wed May 31 13:41:43 2017 +0200
Branches: workspaces
https://developer.blender.org/rB1a39904b645bf7e26481701eeacca0f52af0f9f6

Cleanup: Deduplicate macro code, comments, redundant struct definitions

===================================================================

M	source/blender/blenkernel/BKE_workspace.h
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/makesdna/DNA_defs.h
M	source/blender/makesdna/DNA_workspace_types.h

===================================================================

diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h
index 224a1f50429..e7eaf72dd15 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -28,10 +28,6 @@
 #include "BLI_compiler_attrs.h"
 
 struct bScreen;
-struct ListBase;
-struct Main;
-struct WorkSpace;
-struct WorkSpaceDataRelation;
 
 typedef struct WorkSpace WorkSpace;
 typedef struct WorkSpaceInstanceHook WorkSpaceInstanceHook;
@@ -47,6 +43,7 @@ typedef struct WorkSpaceLayout WorkSpaceLayout;
  */
 #define USE_WORKSPACE_MODE
 
+
 /* -------------------------------------------------------------------- */
 /* Create, delete, init */
 
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9ffc510e6a1..966cbce62db 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -53,7 +53,9 @@
 
 /* allow readfile to use deprecated functionality */
 #define DNA_DEPRECATED_ALLOW
-/* allow using DNA struct members that are marked as private for read/write */
+/* Allow using DNA struct members that are marked as private for read/write.
+ * Note: Each header that uses this needs to define its own way of handling
+ * it. There's no generic implementation, direct use does nothing. */
 #define DNA_PRIVATE_READ_WRITE_ALLOW
 
 #include "DNA_anim_types.h"
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 87e159ca3ea..82d2e37dce0 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -102,7 +102,9 @@
 
 /* allow writefile to use deprecated functionality (for forward compatibility code) */
 #define DNA_DEPRECATED_ALLOW
-/* allow using DNA struct members that are marked as private for read/write */
+/* Allow using DNA struct members that are marked as private for read/write.
+ * Note: Each header that uses this needs to define its own way of handling
+ * it. There's no generic implementation, direct use does nothing. */
 #define DNA_PRIVATE_READ_WRITE_ALLOW
 
 #include "DNA_anim_types.h"
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index fc9dd8f06a9..bfa8da02707 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -44,6 +44,12 @@
 #  endif
 #endif
 
+#ifdef __GNUC__
+#  define DNA_PRIVATE_ATTR __attribute__ ((deprecated))
+#else
+#  define DNA_PRIVATE_ATTR
+#endif
+
 
 /* poison pragma */
 #ifdef DNA_DEPRECATED_ALLOW
diff --git a/source/blender/makesdna/DNA_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
index 27c06b77851..56221242fbf 100644
--- a/source/blender/makesdna/DNA_workspace_types.h
+++ b/source/blender/makesdna/DNA_workspace_types.h
@@ -37,12 +37,7 @@
 #  define DNA_PRIVATE_WORKSPACE
 #else
 #  ifndef DNA_PRIVATE_WORKSPACE
-#    ifdef __GNUC__
-#      define DNA_PRIVATE_WORKSPACE __attribute__ ((deprecated))
-#    else
-       /* TODO, msvc & others */
-#      define DNA_PRIVATE_WORKSPACE
-#    endif
+#    define DNA_PRIVATE_WORKSPACE DNA_PRIVATE_ATTR
 #  endif
 #endif




More information about the Bf-blender-cvs mailing list