[Bf-blender-cvs] [525364be31a] master: Cleanup: reduce indirect DNA header inclusion

Campbell Barton noreply at git.blender.org
Tue Dec 15 02:49:36 CET 2020


Commit: 525364be31aafa547f4b17b9947074ed5a5b2570
Author: Campbell Barton
Date:   Tue Dec 15 10:47:58 2020 +1100
Branches: master
https://developer.blender.org/rB525364be31aafa547f4b17b9947074ed5a5b2570

Cleanup: reduce indirect DNA header inclusion

Remove DNA headers, using forward declarations where possible.

Also removed duplicate header, header including it's self
and unnecessary inclusion of libc system headers from BKE header.

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

M	source/blender/blenkernel/BKE_boids.h
M	source/blender/blenkernel/BKE_collision.h
M	source/blender/blenkernel/BKE_cryptomatte.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_effect.h
M	source/blender/blenkernel/BKE_freestyle.h
M	source/blender/blenkernel/BKE_idprop.h
M	source/blender/blenkernel/BKE_layer.h
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/BKE_pointcache.h
M	source/blender/blenkernel/BKE_sequencer_offscreen.h
M	source/blender/blenkernel/BKE_shader_fx.h
M	source/blender/blenkernel/BKE_simulation.h
M	source/blender/blenkernel/BKE_studiolight.h
M	source/blender/blenkernel/BKE_text_suggestions.h
M	source/blender/blenkernel/intern/anim_data.c
M	source/blender/blenkernel/intern/boids.c
M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/gpencil_curve.c
M	source/blender/blenkernel/intern/gpencil_geom.c
M	source/blender/blenkernel/intern/idprop_utils.c
M	source/blender/blenkernel/intern/idtype.c
M	source/blender/blenkernel/intern/image.c
M	source/blender/blenkernel/intern/lib_id.c
M	source/blender/blenkernel/intern/lib_remap.c
M	source/blender/blenkernel/intern/modifier.c
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_update.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/particle_child.c
M	source/blender/blenkernel/intern/particle_distribute.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenkernel/intern/screen.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenkernel/particle_private.h
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_290.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M	source/blender/draw/intern/draw_cache_impl_particles.c
M	source/blender/editors/armature/editarmature_undo.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_add_monkey.c
M	source/blender/editors/gpencil/gpencil_add_stroke.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_data.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/editors/gpencil/gpencil_merge.c
M	source/blender/editors/gpencil/gpencil_ops_versioning.c
M	source/blender/editors/gpencil/gpencil_sculpt_paint.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/gpencil/gpencil_vertex_ops.c
M	source/blender/editors/gpencil/gpencil_vertex_paint.c
M	source/blender/editors/include/ED_info.h
M	source/blender/editors/include/ED_uvedit.h
M	source/blender/editors/interface/interface_eyedropper_gpencil_color.c
M	source/blender/editors/mesh/editmesh_select_similar.c
M	source/blender/editors/mesh/editmesh_undo.c
M	source/blender/editors/metaball/editmball_undo.c
M	source/blender/editors/object/object_bake.c
M	source/blender/editors/physics/rigidbody_constraint.c
M	source/blender/editors/physics/rigidbody_object.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/space_outliner/tree/tree_display_libraries.cc
M	source/blender/editors/space_outliner/tree/tree_display_view_layer.cc
M	source/blender/editors/undo/memfile_undo.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c
M	source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c
M	source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
M	source/blender/imbuf/intern/jpeg.c
M	source/blender/imbuf/intern/metadata.c
M	source/blender/imbuf/intern/png.c
M	source/blender/io/alembic/exporter/abc_writer_hair.cc
M	source/blender/io/alembic/intern/alembic_capi.cc
M	source/blender/makesdna/DNA_movieclip_types.h
M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_sequence_types.h
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesdna/DNA_workspace_types.h
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/makesrna/intern/rna_brush.c
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/modifiers/intern/MOD_shapekey.c
M	source/blender/modifiers/intern/MOD_smooth.c
M	source/blender/modifiers/intern/MOD_solidify.c
M	source/blender/modifiers/intern/MOD_solidify_extrude.c
M	source/blender/modifiers/intern/MOD_solidify_nonmanifold.c
M	source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
M	source/blender/nodes/intern/node_socket.cc
M	source/blender/python/generic/idprop_py_api.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/render/intern/texture_pointdensity.c
M	source/blender/sequencer/intern/effects.c
M	source/blender/simulation/SIM_mass_spring.h
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/blenkernel/BKE_boids.h b/source/blender/blenkernel/BKE_boids.h
index c9e6f0e7346..71a4d35767f 100644
--- a/source/blender/blenkernel/BKE_boids.h
+++ b/source/blender/blenkernel/BKE_boids.h
@@ -23,13 +23,16 @@
  * \ingroup bke
  */
 
-#include "DNA_boid_types.h"
-#include "DNA_particle_types.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+struct BoidSettings;
+struct BoidState;
+struct Object;
+struct ParticleData;
+struct ParticleSettings;
+struct ParticleSimulationData;
 struct RNG;
 
 typedef struct BoidBrainData {
@@ -50,13 +53,13 @@ typedef struct BoidBrainData {
 void boids_precalc_rules(struct ParticleSettings *part, float cfra);
 void boid_brain(BoidBrainData *bbd, int p, struct ParticleData *pa);
 void boid_body(BoidBrainData *bbd, struct ParticleData *pa);
-void boid_default_settings(BoidSettings *boids);
-BoidRule *boid_new_rule(int type);
-BoidState *boid_new_state(BoidSettings *boids);
-BoidState *boid_duplicate_state(BoidSettings *boids, BoidState *state);
-void boid_free_settings(BoidSettings *boids);
-BoidSettings *boid_copy_settings(const BoidSettings *boids);
-BoidState *boid_get_current_state(BoidSettings *boids);
+void boid_default_settings(struct BoidSettings *boids);
+struct BoidRule *boid_new_rule(int type);
+struct BoidState *boid_new_state(struct BoidSettings *boids);
+struct BoidState *boid_duplicate_state(struct BoidSettings *boids, struct BoidState *state);
+void boid_free_settings(struct BoidSettings *boids);
+struct BoidSettings *boid_copy_settings(const struct BoidSettings *boids);
+struct BoidState *boid_get_current_state(struct BoidSettings *boids);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index 3a5328a33e2..a10a4e3c7fd 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -22,23 +22,13 @@
  * \ingroup bke
  */
 
-#include <float.h>
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* types */
-#include "BKE_collision.h"
-#include "DNA_cloth_types.h"
-
-#include "BLI_kdopbvh.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 struct Collection;
 struct CollisionModifierData;
+struct BVHTree;
 struct Depsgraph;
 struct MVert;
 struct MVertTri;
@@ -113,11 +103,11 @@ typedef struct FaceCollPair {
 // used in modifier.c from collision.c
 /////////////////////////////////////////////////
 
-BVHTree *bvhtree_build_from_mvert(const struct MVert *mvert,
-                                  const struct MVertTri *tri,
-                                  int tri_num,
-                                  float epsilon);
-void bvhtree_update_from_mvert(BVHTree *bvhtree,
+struct BVHTree *bvhtree_build_from_mvert(const struct MVert *mvert,
+                                         const struct MVertTri *tri,
+                                         int tri_num,
+                                         float epsilon);
+void bvhtree_update_from_mvert(struct BVHTree *bvhtree,
                                const struct MVert *mvert,
                                const struct MVert *mvert_moving,
                                const struct MVertTri *tri,
diff --git a/source/blender/blenkernel/BKE_cryptomatte.h b/source/blender/blenkernel/BKE_cryptomatte.h
index c3c17f72cae..71b15e47203 100644
--- a/source/blender/blenkernel/BKE_cryptomatte.h
+++ b/source/blender/blenkernel/BKE_cryptomatte.h
@@ -25,8 +25,6 @@
 
 #include "BLI_sys_types.h"
 
-#include "DNA_layer_types.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index dcb4a993da1..881b93fe709 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -22,7 +22,9 @@
  * \ingroup bke
  */
 
-#include "DNA_scene_types.h"
+#include "BLI_sys_types.h"
+
+#include "DNA_listBase.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -318,8 +320,8 @@ void BKE_curve_deform_coords(const struct Object *ob_curve,
                              const short flag,
                              const short defaxis);
 
-void BKE_curve_deform_coords_with_editmesh(const Object *ob_curve,
-                                           const Object *ob_target,
+void BKE_curve_deform_coords_with_editmesh(const struct Object *ob_curve,
+                                           const struct Object *ob_target,
                                            float (*vert_coords)[3],
                                            const int vert_coords_len,
                                            const int defgrp_index,
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 0585f67703c..3cba47afc46 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -22,8 +22,6 @@
  * \ingroup bke
  */
 
-#include "DNA_modifier_types.h"
-
 #include "BLI_utildefines.h"
 
 #ifdef __cplusplus
@@ -147,7 +145,7 @@ float effector_falloff(struct EffectorCache *eff,
                        struct EffectorData *efd,
                        struct EffectedPoint *point,
                        struct EffectorWeights *weights);
-int closest_point_on_surface(SurfaceModifierData *surmd,
+int closest_point_on_surface(struct SurfaceModifierData *surmd,
                              const float co[3],
                              float surface_co[3],
                              float surface_nor[3],
diff --git a/source/blender/blenkernel/BKE_freestyle.h b/source/blender/blenkernel/BKE_freestyle.h
index 47f0b547d83..5e29665d728 100644
--- a/source/blender/blenkernel/BKE_freestyle.h
+++ b/source/blender/blenkernel/BKE_freestyle.h
@@ -23,8 +23,6 @@
  * \ingroup bke
  */
 
-#include "DNA_scene_types.h"
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -39,28 +37,31 @@ typedef struct FreestyleModuleSettings FreestyleModuleSettings;
 typedef struct FreestyleSettings FreestyleSettings;
 
 /* FreestyleConfig */
-void BKE_freestyle_config_init(FreestyleConfig *config);
-void BKE_freestyle_config_free(FreestyleConfig *config, const bool do_id_user);
-void BKE_freestyle_config_copy(FreestyleConfig *new_config,
-                               const FreestyleConfig *config,
+void BKE_freestyle_config_init(struct FreestyleConfig *config);
+void BKE_freestyle_config_free(struct FreestyleConfig *config, const bool do_id_user);
+void BKE_freestyle_config_copy(struct FreestyleConfig *new_config,
+                               const struct FreestyleConfig *config,
                                const int flag);
 
 /* FreestyleConfig.modules */
-FreestyleModuleConfig *BKE_freestyle_module_add(FreestyleConfig *config);
-bool BKE_freestyle_module_delete(FreestyleConfig *config, FreestyleModuleConfig *module_conf);
-bool BKE_freestyle_module_move(FreestyleConfig *config,
-                               FreestyleModuleConfig *module_conf,
+struct FreestyleModuleConfig *BKE_freestyle_module_add(struct FreestyleConfig *config);
+bool BKE_freestyle_module_delete(struct FreestyleConfig *config,
+                                 struct FreestyleModuleConfig *module_conf);
+bool BKE_freestyle_module_move(struct FreestyleConfig *config,
+                               struct FreestyleModuleConfig *module_conf,
                                int direction);
 
 /* FreestyleConfig.linesets */
-FreestyleLineSet *BKE_freestyle_lineset_add(struct Main *bmain,
-                                            FreestyleConfig *config,
-                                            const char *name);
-bool BKE_freestyle_lineset_delete(FreestyleConfig *config, FreestyleLineSet *lineset);
-FreestyleLineSet *BKE_freestyle_lineset_get_active(FreestyleConfig *config);
-short BKE_freestyle_lineset_get_active_index(FreestyleConfig *config);
-void BKE_freestyle_lineset_set_active_index(FreestyleConfig *config, short index);
-void BKE_freestyle_lineset_unique_name(FreestyleConfig *config, FreestyleLineSet *lineset);
+struct FreestyleLineSet *BKE_freestyle_lineset_add(struct Main *bmain,
+                                                   struct FreestyleConfig *config,
+                                                   const char *name);
+bool BKE_freestyle_lineset_delete(struct FreestyleConfig *config,
+                                  struct FreestyleLineSet *lineset);
+struct FreestyleLineSet *BKE_freestyle_lineset_get_active(struct FreestyleConfig *config);
+short BKE_freestyle_lineset_get_active_index(struct FreestyleConfig *config);
+void BKE_freestyle_lineset_set_active_index(struct FreestyleConfig *config, short index);
+void BKE_freestyle_lineset_unique_name(struct FreestyleConfig *config,
+                                       struct FreestyleLineSet *lineset);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 9c250240e5e..bcf35bf1197 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -20,8 +20,6 @@
  * \ingroup bke
  */
 
-#include "DNA_ID.h"
-
 #include "BLI_compiler_attrs.h"
 
 #ifdef __cplusplus
@@ -57,9 +55,9 @@ typedef union IDPropertyTemplate {
 
 /* ----------- Property Array Type ---------- */
 
-IDProperty *IDP_NewIDPArray(const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
-IDProperty *IDP_CopyIDPArray(const IDProperty *array, const int flag) ATTR_WARN_UNUSED_RESULT
-    ATTR_NONNULL();
+struct IDProperty *IDP_NewIDPArray(const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+struct IDProperty *IDP_CopyIDPArray(const struct IDProperty *array,
+                                    const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
 /* shallow copies item */
 void IDP_SetIndexArray(struct IDProperty *prop, int index, struct IDProperty *item) ATTR_NONNULL();
@@ -74,7 +72,9 @@ void IDP_ResizeArray(struct IDProperty *prop, int newlen);
 void IDP_FreeArray(struct IDProperty *prop);
 
 /* ---------- String Type ------------ */
-IDProperty *IDP_NewString(const char *st, const char *name, int maxlen) ATTR_WARN_UNUSED_RESULT
+struct IDProperty *IDP_NewString(const char *st,
+                                 const char *name,
+                                 int maxlen)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list