[Bf-blender-cvs] [6a03199b50e] master: Cleanup: use '_pad' convention for padding in all DNA structs
Campbell Barton
noreply at git.blender.org
Wed Feb 27 05:33:32 CET 2019
Commit: 6a03199b50e02d57a50eb24441ef7be0b7e965ac
Author: Campbell Barton
Date: Wed Feb 27 15:07:50 2019 +1100
Branches: master
https://developer.blender.org/rB6a03199b50e02d57a50eb24441ef7be0b7e965ac
Cleanup: use '_pad' convention for padding in all DNA structs
Avoids mixing these in with regular variables in code-completion.
Use char for pad members except for 'void *', to make size clearer.
Removed/shrink a few redundant padding vars which were >= 8 bytes.
===================================================================
M source/blender/blenloader/intern/writefile.c
M source/blender/makesdna/DNA_ID.h
M source/blender/makesdna/DNA_action_types.h
M source/blender/makesdna/DNA_anim_types.h
M source/blender/makesdna/DNA_armature_types.h
M source/blender/makesdna/DNA_brush_types.h
M source/blender/makesdna/DNA_cachefile_types.h
M source/blender/makesdna/DNA_camera_types.h
M source/blender/makesdna/DNA_cloth_types.h
M source/blender/makesdna/DNA_collection_types.h
M source/blender/makesdna/DNA_color_types.h
M source/blender/makesdna/DNA_constraint_types.h
M source/blender/makesdna/DNA_curve_types.h
M source/blender/makesdna/DNA_customdata_types.h
M source/blender/makesdna/DNA_dynamicpaint_types.h
M source/blender/makesdna/DNA_effect_types.h
M source/blender/makesdna/DNA_fileglobal_types.h
M source/blender/makesdna/DNA_freestyle_types.h
M source/blender/makesdna/DNA_gpu_types.h
M source/blender/makesdna/DNA_image_types.h
M source/blender/makesdna/DNA_ipo_types.h
M source/blender/makesdna/DNA_key_types.h
M source/blender/makesdna/DNA_lattice_types.h
M source/blender/makesdna/DNA_layer_types.h
M source/blender/makesdna/DNA_light_types.h
M source/blender/makesdna/DNA_lightprobe_types.h
M source/blender/makesdna/DNA_linestyle_types.h
M source/blender/makesdna/DNA_mask_types.h
M source/blender/makesdna/DNA_material_types.h
M source/blender/makesdna/DNA_mesh_types.h
M source/blender/makesdna/DNA_meshdata_types.h
M source/blender/makesdna/DNA_meta_types.h
M source/blender/makesdna/DNA_modifier_types.h
M source/blender/makesdna/DNA_node_types.h
M source/blender/makesdna/DNA_object_fluidsim_types.h
M source/blender/makesdna/DNA_object_force_types.h
M source/blender/makesdna/DNA_particle_types.h
M source/blender/makesdna/DNA_rigidbody_types.h
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesdna/DNA_screen_types.h
M source/blender/makesdna/DNA_sequence_types.h
M source/blender/makesdna/DNA_shader_fx_types.h
M source/blender/makesdna/DNA_smoke_types.h
M source/blender/makesdna/DNA_sound_types.h
M source/blender/makesdna/DNA_space_types.h
M source/blender/makesdna/DNA_texture_types.h
M source/blender/makesdna/DNA_tracking_types.h
M source/blender/makesdna/DNA_view2d_types.h
M source/blender/makesdna/DNA_view3d_types.h
M source/blender/makesdna/DNA_windowmanager_types.h
M source/blender/makesdna/DNA_world_types.h
===================================================================
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 235f9b2a799..24784684f41 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3783,10 +3783,10 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
char subvstr[8];
/* prevent mem checkers from complaining */
- memset(fg.pad, 0, sizeof(fg.pad));
+ memset(fg._pad, 0, sizeof(fg._pad));
memset(fg.filename, 0, sizeof(fg.filename));
memset(fg.build_hash, 0, sizeof(fg.build_hash));
- fg.pad1 = NULL;
+ fg._pad1 = NULL;
current_screen_compat(mainvar, is_undo, &screen, &scene, &view_layer);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 1d9518f657e..fa519ec8011 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -73,7 +73,7 @@ typedef struct IDProperty {
char name[64];
/* saved is used to indicate if this struct has been saved yet.
- * seemed like a good idea as a pad var was needed anyway :) */
+ * seemed like a good idea as a '_pad' var was needed anyway :) */
int saved;
/** Note, alignment for 64 bits. */
IDPropertyData data;
@@ -145,7 +145,7 @@ typedef struct IDOverrideStaticPropertyOperation {
/* Type of override. */
short operation;
short flag;
- short pad_s1[2];
+ char _pad0[4];
/* Sub-item references, if needed (for arrays or collections only).
* We need both reference and local values to allow e.g. insertion into collections (constraints, modifiers...).
@@ -208,7 +208,7 @@ typedef struct IDOverrideStatic {
ListBase properties;
short flag;
- short pad[3];
+ char _pad[6];
/* Read/write data. */
/* Temp ID storing extra override data (used for differential operations only currently).
@@ -249,7 +249,7 @@ typedef struct ID {
int us;
int icon_id;
int recalc;
- int pad;
+ char _pad[4];
IDProperty *properties;
/** Reference linked ID which this one overrides. */
@@ -329,7 +329,7 @@ typedef struct PreviewImage {
/** Runtime data. */
short tag;
- char pad[2];
+ char _pad[2];
} PreviewImage;
#define PRV_DEFERRED_DATA(prv) \
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index a52145a0416..ddea6f64dba 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -86,7 +86,7 @@ typedef struct bMotionPath {
struct GPUVertBuf *points_vbo;
struct GPUBatch *batch_line;
struct GPUBatch *batch_points;
- void *pad;
+ void *_pad;
} bMotionPath;
/* bMotionPath->flag */
@@ -120,7 +120,7 @@ typedef struct bAnimVizSettings {
short path_viewflag;
/** #eMotionPaths_BakeFlag. */
short path_bakeflag;
- char pad[6];
+ char _pad[6];
/** Start and end frames of path-calculation range. */
int path_sf, path_ef;
@@ -185,7 +185,7 @@ struct Mat4;
typedef struct bPoseChannel_Runtime {
int bbone_segments;
- char pad[4];
+ char _pad[4];
/* Rest and posed matrices for segments. */
struct Mat4 *bbone_rest_mats;
@@ -231,7 +231,7 @@ typedef struct bPoseChannel {
char selectflag;
char drawflag;
char bboneflag DNA_DEPRECATED;
- char pad0[4];
+ char _pad0[4];
/** Set on read file or rebuild pose. */
struct Bone *bone;
@@ -257,7 +257,7 @@ typedef struct bPoseChannel {
struct bPoseChannel *custom_tx;
float custom_scale;
- char pad1[4];
+ char _pad1[4];
/** Transforms - written in by actions or transform. */
float loc[3];
@@ -275,7 +275,7 @@ typedef struct bPoseChannel {
float rotAxis[3], rotAngle;
/** #eRotationModes - rotation representation to use. */
short rotmode;
- short pad;
+ char _pad[2];
/** Matrix result of loc/quat/size, and where we put deform in, see next line */
float chan_mat[4][4];
@@ -460,10 +460,11 @@ typedef struct bPose {
*/
bPoseChannel **chan_array;
- short flag, pad;
+ short flag;
+ char _pad[2];
/** Proxy layer: copy from armature, gets synced. */
unsigned int proxy_layer;
- int pad1;
+ char _pad1[4];
/** Local action time of this pose. */
float ctime;
@@ -660,7 +661,7 @@ typedef struct bAction {
* (if 0, will be set to whatever ID first evaluates it).
*/
int idroot;
- int pad;
+ char _pad[4];
} bAction;
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index a05b52d0f49..1ea4f15b8d5 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -247,7 +247,7 @@ typedef struct FMod_Limits {
rctf rect;
/** Settings for limiting. */
int flag;
- int pad;
+ char _pad[4];
} FMod_Limits;
/* limiting flags */
@@ -538,7 +538,7 @@ typedef struct FPoint {
float vec[2];
/** Selection info. */
int flag;
- int pad;
+ char _pad[4];
} FPoint;
/* 'Function-Curve' - defines values over time for a given setting (fcu) */
@@ -567,7 +567,7 @@ typedef struct FCurve {
/* value cache + settings */
/** Value stored from last time curve was evaluated (not threadsafe, debug display only!). */
float curval;
- char pad2[4];
+ char _pad2[4];
/** User-editable settings for this curve. */
short flag;
/** Value-extending mode for this curve (does not cover). */
@@ -575,7 +575,7 @@ typedef struct FCurve {
/** Auto-handle smoothing mode. */
char auto_smoothing;
- char pad[3];
+ char _pad[3];
/* RNA - data link */
/** If applicable, the index of the RNA-array item to get. */
@@ -707,7 +707,7 @@ typedef struct NlaStrip {
/** Strip extrapolation mode (time-based mixing). */
short extendmode;
- short pad1;
+ char _pad1[2];
/** Type of NLA strip. */
short type;
@@ -717,7 +717,7 @@ typedef struct NlaStrip {
/** Settings. */
int flag;
- int pad2;
+ char _pad2[4];
} NlaStrip;
/* NLA Strip Blending Mode */
@@ -812,7 +812,7 @@ typedef struct NlaTrack {
/** Settings for this track. */
int flag;
/** Index of the track in the stack
- * \note not really useful, but we need a pad var anyways! */
+ * \note not really useful, but we need a '_pad' var anyways! */
int index;
/** Short user-description of this track - MAX_ID_NAME-2. */
@@ -935,7 +935,7 @@ typedef struct KeyingSet {
/** (eInsertKeyFlags) for each flag set, the relevant keyingflag bit overrides the default. */
short keyingoverride;
- char pad[6];
+ char _pad[6];
} KeyingSet;
/* KeyingSet settings */
@@ -1050,7 +1050,7 @@ typedef struct AnimData {
/* settings for animation evaluation */
/** User-defined settings. */
int flag;
- int pad;
+ char _pad[4];
/* settings for active action evaluation (based on NLA strip settings) */
/** Accumulation mode for active action. */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 8c8552400ac..b6016c3748d 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -122,7 +122,7 @@ typedef struct bArmature {
int drawtype;
/** How vertex deformation is handled in the ge. */
int gevertdeformer;
- int pad;
+ char _pad[4];
short deformflag;
short pathflag;
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 584a43aad35..e0d39fe72a4 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -44,7 +44,8 @@ typedef struct BrushClone {
/** Offset of clone image from canvas. */
float offset[2];
/** Transparency for drawing of clone image. */
- float alpha, pad;
+ float alpha;
+ char _pad[4];
} BrushClone;
@@ -82,7 +83,7 @@ typedef struct BrushGpencilSettings {
float fill_threshold;
/** Number of pixel to consider the leak is too small (x 2). */
short fill_leak;
- char pad_1[6];
+ char _pad1[6];
/** Number of simplify steps. */
int fill_simplylvl;
@@ -249,7 +250,7 @@ typedef struct Brush {
/** Source for fill tool color gradient application. */
char gradient_fill_mode;
- char pad;
+ char _pad;
/** Projection shape (sphere, circle). */
char falloff_shape;
float falloff_angle;
@@ -321,7 +322,7 @@ typedef struct Palette {
ListBase colors;
int active_color;
- int pad;
+ char _pad[4];
} Palette;
typedef struct PaintCurvePoint {
diff --git a/source/blender/makesdna/DNA_cachefile_types.h b/source/blender/makesdna/DNA_cachefile_types.h
index d0152d1d4e2..e226519bba0 100644
--- a/source/blender/makesdna/DNA_cachefile_types.h
+++ b/source/blender/makesdna/DNA_cachefile_types.h
@@ -77,7 +77,7 @@ typedef struct CacheFile {
short flag;
short draw_flag;
- char padding[4];
+ char _pad[4];
} CacheFile;
#ifdef __cplusplus
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index b28f5d1b262..0af69384c54 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -46,7 +46,7 @@ typedef struct CameraStereoSettings {
short convergence_mode;
short pivot;
short flag;
- short pad;
+ char _pad[2];
/* Cut-off angle at which interocular distance start to fade down. */
float pole_merge_angle_from;
/* Cut-off angle at which interocular distance stops to fade down. */
@@ -103,7 +103,7 @@ typedef struct Camera {
struct ListBase bg_images;
char sensor_fit;
- char pad[7];
+ char _pad[7];
/* Stereo settings */
struct CameraStereoSettings stereo;
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 5f4a124ea04..9ab873e1264 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -105,7 +105,7 @@ typedef struct ClothSimSettings {
float bending_damping;
/** Size of voxel grid cells for continuum dynamics. */
float voxel_cell_size;
- int pad;
+ char _pad[4];
/** Number of time steps per frame. */
int stepsPerFrame;
@@ -131,7 +131,7 @@ typedef struct ClothSimSettings {
short presets;
short reset;
- char pad0[4];
+ char _pad0[4];
struct EffectorWeights *effector_weights;
short bending_model;
@@ -171,12 +171,12 @@ typedef struct ClothCollSettings {
short self_loop_count DNA_DEPRECATED
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list