Cleanup: add trailing commas to structs

Needed for clang formatting to workaround bug/limit, see: T53211
This commit is contained in:
2019-01-07 00:06:58 +11:00
parent f10a88ae8d
commit e305560f13
42 changed files with 131 additions and 118 deletions

View File

@@ -334,7 +334,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
.effectedF = effectedF,
.numEffectedV = numEffectedV,
.numEffectedE = numEffectedE,
.numEffectedF = numEffectedF
.numEffectedF = numEffectedF,
};
{
@@ -677,7 +677,7 @@ static void ccgSubSurf__calcSubdivLevel(
.numEffectedV = numEffectedV,
.numEffectedE = numEffectedE,
.numEffectedF = numEffectedF,
.curLvl = curLvl
.curLvl = curLvl,
};
{

View File

@@ -3128,7 +3128,7 @@ bool BKE_animsys_nla_remap_keyframe_value(struct NlaKeyframingContext *context,
}
/* Find the evaluation channel for the NLA stack below current strip. */
NlaEvalChannelKey key = { .ptr = *prop_ptr, .prop = prop };
NlaEvalChannelKey key = { .ptr = *prop_ptr, .prop = prop, };
NlaEvalData *nlaeval = &context->nla_channels;
NlaEvalChannel *nec = nlaevalchan_verify_key(nlaeval, NULL, &key);
int real_index = nlaevalchan_validate_index(nec, index);

View File

@@ -2641,7 +2641,7 @@ void BKE_armature_cached_bbone_deformation_update(Object *object)
ArmatureBBoneDefmatsData data = {
.pdef_info_array = pdef_info_array,
.dualquats = dualquats,
.use_quaternion = use_quaternion
.use_quaternion = use_quaternion,
};
BLI_task_parallel_listbase(&pose->chanbase,
&data,

View File

@@ -1064,13 +1064,15 @@ static bool cloth_bvh_objcollisions_nearcheck(ClothModifierData * clmd, Collisio
{
*collisions = (CollPair *)MEM_mallocN(sizeof(CollPair) * numresult, "collision array");
ColDetectData data = {.clmd = clmd,
.collmd = collmd,
.overlap = overlap,
.collisions = *collisions,
.culling = culling,
.use_normal = use_normal,
.collided = false};
ColDetectData data = {
.clmd = clmd,
.collmd = collmd,
.overlap = overlap,
.collisions = *collisions,
.culling = culling,
.use_normal = use_normal,
.collided = false,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -1083,10 +1085,12 @@ static bool cloth_bvh_objcollisions_nearcheck(ClothModifierData * clmd, Collisio
static bool cloth_bvh_selfcollisions_nearcheck(ClothModifierData * clmd, CollPair *collisions,
int numresult, BVHTreeOverlap *overlap)
{
SelfColDetectData data = {.clmd = clmd,
.overlap = overlap,
.collisions = collisions,
.collided = false};
SelfColDetectData data = {
.clmd = clmd,
.overlap = overlap,
.collisions = collisions,
.collided = false,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);

View File

@@ -1580,7 +1580,7 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface
DynamicPaintSetInitColorData data = {
.surface = surface,
.mloop = mloop, .mlooptri = mlooptri, .mloopuv = mloopuv, .pool = pool,
.scene_color_manage = scene_color_manage
.scene_color_manage = scene_color_manage,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -1595,7 +1595,7 @@ static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface
DynamicPaintSetInitColorData data = {
.surface = surface,
.mlooptri = mlooptri, .mloopuv = mloopuv,
.scene_color_manage = scene_color_manage
.scene_color_manage = scene_color_manage,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -1756,7 +1756,7 @@ static void dynamicPaint_applySurfaceDisplace(DynamicPaintSurface *surface, Mesh
if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) {
MVert *mvert = result->mvert;
DynamicPaintModifierApplyData data = {.surface = surface, .mvert = mvert};
DynamicPaintModifierApplyData data = { .surface = surface, .mvert = mvert, };
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = (sData->total_points > 10000);
@@ -1903,7 +1903,7 @@ static Mesh *dynamicPaint_Modifier_apply(
/* paint is stored on dry and wet layers, so mix final color first */
float (*fcolor)[4] = MEM_callocN(sizeof(*fcolor) * sData->total_points, "Temp paint color");
DynamicPaintModifierApplyData data = {.surface = surface, .fcolor = fcolor};
DynamicPaintModifierApplyData data = { .surface = surface, .fcolor = fcolor, };
{
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -2007,7 +2007,7 @@ static Mesh *dynamicPaint_Modifier_apply(
else if (surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
MVert *mvert = result->mvert;
DynamicPaintModifierApplyData data = {.surface = surface, .mvert = mvert};
DynamicPaintModifierApplyData data = { .surface = surface, .mvert = mvert, };
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = (sData->total_points > 1000);
@@ -2481,7 +2481,7 @@ static int dynamic_paint_find_neighbour_pixel(
DynamicPaintFindIslandBorderData bdata = {
.vert_to_looptri_map = vert_to_looptri_map,
.w = w, .h = h, .px = px, .py = py,
.best_index = NOT_FOUND, .best_weight = 1.0f
.best_index = NOT_FOUND, .best_weight = 1.0f,
};
float pixel[2];
@@ -3236,7 +3236,7 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
return;
}
DynamicPaintOutputSurfaceImageData data = {.surface = surface, .ibuf = ibuf};
DynamicPaintOutputSurfaceImageData data = { .surface = surface, .ibuf = ibuf, };
switch (surface->type) {
case MOD_DPAINT_SURFACE_T_PAINT:
switch (output_layer) {
@@ -4191,7 +4191,7 @@ static int dynamicPaint_paintMesh(Depsgraph *depsgraph, DynamicPaintSurface *sur
.scene = scene, .timescale = timescale, .c_index = c_index,
.mesh = mesh, .mvert = mvert, .mloop = mloop, .mlooptri = mlooptri,
.brush_radius = brush_radius, .avg_brushNor = avg_brushNor, .brushVelocity = brushVelocity,
.treeData = &treeData
.treeData = &treeData,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -5351,7 +5351,7 @@ static void dynamicPaint_doBorderStep(DynamicPaintSurface *surface)
/* Don't use prevPoint, relying on the condition that neighbors are never border pixels. */
DynamicPaintEffectData data = {
.surface = surface
.surface = surface,
};
ParallelRangeSettings settings;
@@ -5907,7 +5907,7 @@ static int dynamicPaint_doStep(
return 0;
if (dynamic_paint_surface_needs_dry_dissolve(surface)) {
DynamicPaintDissolveDryData data = {.surface = surface, .timescale = timescale};
DynamicPaintDissolveDryData data = { .surface = surface, .timescale = timescale, };
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = (sData->total_points > 1000);

View File

@@ -126,7 +126,7 @@ void BKE_keyconfig_pref_set_select_mouse(UserDef *userdef, int value, bool overr
wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(userdef, WM_KEYCONFIG_STR_DEFAULT);
IDProperty *idprop = IDP_GetPropertyFromGroup(kpt->prop, "select_mouse");
if (!idprop) {
IDPropertyTemplate tmp = { .i = value };
IDPropertyTemplate tmp = { .i = value, };
IDP_AddToGroup(kpt->prop, IDP_New(IDP_INT, &tmp, "select_mouse"));
}
else if (override) {

View File

@@ -696,7 +696,7 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag, con
}
/* Update ID refcount, remap pointers to self in new ID. */
struct IDCopyLibManagementData data = {.id_src = id, .id_dst = *r_newid, .flag = flag};
struct IDCopyLibManagementData data = {.id_src = id, .id_dst = *r_newid, .flag = flag,};
BKE_library_foreach_ID_link(bmain, *r_newid, id_copy_libmanagement_cb, &data, IDWALK_NOP);
/* Do not make new copy local in case we are copying outside of main...

View File

@@ -1465,7 +1465,7 @@ void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle,
.x_px_ofs = x_inv * 0.5f,
.y_px_ofs = y_inv * 0.5f,
.width = width,
.buffer = buffer
.buffer = buffer,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);

View File

@@ -324,7 +324,7 @@ void BKE_mesh_calc_normals_poly(
MeshCalcNormalsData data = {
.mpolys = mpolys, .mloop = mloop, .mverts = mverts,
.pnors = pnors, .lnors_weighted = lnors_weighted, .vnors = vnors
.pnors = pnors, .lnors_weighted = lnors_weighted, .vnors = vnors,
};
/* Compute poly normals, and prepare weighted loop normals. */

View File

@@ -291,9 +291,10 @@ Mesh *BKE_multires_create_mesh(
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
Mesh *deformed_mesh = mesh_get_eval_deform(depsgraph, scene, ob_eval, CD_MASK_BAREMESH);
ModifierEvalContext modifier_ctx = {
.depsgraph = depsgraph,
.object = ob_eval,
.flag = MOD_APPLY_USECACHE | MOD_APPLY_IGNORE_SIMPLIFY};
.depsgraph = depsgraph,
.object = ob_eval,
.flag = MOD_APPLY_USECACHE | MOD_APPLY_IGNORE_SIMPLIFY,
};
const ModifierTypeInfo *mti = modifierType_getInfo(mmd->modifier.type);
Mesh *result = mti->applyModifier(&mmd->modifier, &modifier_ctx, deformed_mesh);
@@ -1180,7 +1181,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, DerivedMesh *dm
.gridOffset = gridOffset,
.gridSize = gridSize,
.dGridSize = dGridSize,
.dSkip = dSkip
.dSkip = dSkip,
};
BLI_task_parallel_range(0, totpoly, &data, multires_disp_run_cb, &settings);

View File

@@ -1012,9 +1012,10 @@ bool multiresModifier_reshapeFromDeformModifier(
multires_mesh, &num_deformed_verts);
/* Apply deformation modifier on the multires, */
const ModifierEvalContext modifier_ctx = {
.depsgraph = depsgraph,
.object = object,
.flag = MOD_APPLY_USECACHE | MOD_APPLY_IGNORE_SIMPLIFY};
.depsgraph = depsgraph,
.object = object,
.flag = MOD_APPLY_USECACHE | MOD_APPLY_IGNORE_SIMPLIFY,
};
modwrap_deformVerts(
md, &modifier_ctx, multires_mesh, deformed_verts,
multires_mesh->totvert);
@@ -1183,16 +1184,18 @@ bool multiresModifier_reshapeFromCCG(
multires_reshape_ensure_grids(coarse_mesh, top_level);
/* Construct context. */
ReshapeFromCCGTaskData data = {
.reshape_ctx = {
.subdiv = subdiv,
.coarse_mesh = coarse_mesh,
.mdisps = mdisps,
.grid_paint_mask = grid_paint_mask,
.top_grid_size = BKE_subdiv_grid_size_from_level(top_level),
.top_level = top_level},
.face_ptex_offset = BKE_subdiv_face_ptex_offset_get(subdiv),
.key = &key,
.grids = subdiv_ccg->grids};
.reshape_ctx = {
.subdiv = subdiv,
.coarse_mesh = coarse_mesh,
.mdisps = mdisps,
.grid_paint_mask = grid_paint_mask,
.top_grid_size = BKE_subdiv_grid_size_from_level(top_level),
.top_level = top_level,
},
.face_ptex_offset = BKE_subdiv_face_ptex_offset_get(subdiv),
.key = &key,
.grids = subdiv_ccg->grids,
};
/* Initialize propagation to higher levels. */
MultiresPropagateData propagate_data;
multires_reshape_propagate_prepare(

View File

@@ -910,7 +910,7 @@ static void sculptsession_bm_to_me_update_data_only(Object *ob, bool reorder)
}
if (reorder)
BM_log_mesh_elems_reorder(ss->bm, ss->bm_log);
BM_mesh_bm_to_me(NULL, ss->bm, ob->data, (&(struct BMeshToMeshParams){.calc_object_remap = false}));
BM_mesh_bm_to_me(NULL, ss->bm, ob->data, (&(struct BMeshToMeshParams){.calc_object_remap = false,}));
}
}
}

View File

@@ -3474,7 +3474,7 @@ static ImBuf *do_render_strip_uncached(
if (BLI_linklist_index(state->scene_parents, seq->scene) != -1) {
break;
}
LinkNode scene_parent = {.next = state->scene_parents, .link = seq->scene};
LinkNode scene_parent = { .next = state->scene_parents, .link = seq->scene, };
state->scene_parents = &scene_parent;
/* end check */

View File

@@ -410,7 +410,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
nearest.index = -1;
nearest.dist_sq = FLT_MAX;
ShrinkwrapCalcCBData data = {.calc = calc, .tree = calc->tree};
ShrinkwrapCalcCBData data = { .calc = calc, .tree = calc->tree, };
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = (calc->numVerts > BKE_MESH_OMP_LIMIT);
@@ -676,7 +676,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
/* After successfully build the trees, start projection vertices. */
ShrinkwrapCalcCBData data = {
.calc = calc, .tree = calc->tree, .aux_tree = aux_tree,
.proj_axis = proj_axis, .local2aux = &local2aux
.proj_axis = proj_axis, .local2aux = &local2aux,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
@@ -852,7 +852,7 @@ static bool target_project_solve_point_tri(
x[2] = (dot_v3v3(tmp, r_hit_no) < 0) ? -dist : dist;
/* Solve the equations iteratively. */
TargetProjectTriData tri_data = { .vtri_co = vtri_co, .vtri_no = vtri_no, .point_co = point_co };
TargetProjectTriData tri_data = { .vtri_co = vtri_co, .vtri_no = vtri_no, .point_co = point_co, };
sub_v3_v3v3(tri_data.n0_minus_n2, vtri_no[0], vtri_no[2]);
sub_v3_v3v3(tri_data.n1_minus_n2, vtri_no[1], vtri_no[2]);
@@ -1268,7 +1268,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
nearest.dist_sq = FLT_MAX;
/* Find the nearest vertex */
ShrinkwrapCalcCBData data = {.calc = calc, .tree = calc->tree};
ShrinkwrapCalcCBData data = { .calc = calc, .tree = calc->tree, };
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);
settings.use_threading = (calc->numVerts > BKE_MESH_OMP_LIMIT);

View File

@@ -896,7 +896,7 @@ static void obstacles_from_mesh(
.tree = &treeData, .obstacle_map = obstacle_map,
.has_velocity = has_velocity, .vert_vel = vert_vel,
.velocityX = velocityX, .velocityY = velocityY, .velocityZ = velocityZ,
.num_obstacles = num_obstacles
.num_obstacles = num_obstacles,
};
ParallelRangeSettings settings;
BLI_parallel_range_settings_defaults(&settings);

View File

@@ -865,8 +865,8 @@ static void subdiv_ccg_recalc_inner_grid_normals(SubdivCCG *subdiv_ccg)
CCGKey key;
BKE_subdiv_ccg_key_top_level(&key, subdiv_ccg);
RecalcInnerNormalsData data = {
.subdiv_ccg = subdiv_ccg,
.key = &key
.subdiv_ccg = subdiv_ccg,
.key = &key,
};
RecalcInnerNormalsTLSData tls_data = {NULL};
ParallelRangeSettings parallel_range_settings;

View File

@@ -1598,7 +1598,7 @@ ImBuf *BKE_tracking_stabilize_frame(MovieClip *clip,
TrackingStabilizeFrameInterpolationData data = {
.ibuf = ibuf, .tmpibuf = tmpibuf, .mat = mat,
.interpolation = interpolation
.interpolation = interpolation,
};
ParallelRangeSettings settings;