Cleanup: use function style casts, remove void function argument

Also remove redundant parenthesis.
This commit is contained in:
Campbell Barton
2023-07-06 10:29:02 +10:00
parent c65fa57b0b
commit 6a79639ef7
57 changed files with 123 additions and 123 deletions

View File

@@ -40,7 +40,7 @@ struct HeapNode_Chunk {
* \note keep type in sync with nodes_num in heap_node_alloc_chunk.
*/
#define HEAP_CHUNK_DEFAULT_NUM \
((uint)((MEM_SIZE_OPTIMAL((1 << 16) - sizeof(struct HeapNode_Chunk))) / sizeof(HeapNode)))
(uint)(MEM_SIZE_OPTIMAL((1 << 16) - sizeof(struct HeapNode_Chunk)) / sizeof(HeapNode))
struct Heap {
uint size;

View File

@@ -61,7 +61,7 @@ void DespeckleOperation::execute_pixel(float output[4], int x, int y, void * /*d
input_operation_->read(color_org, x2, y2, nullptr);
#define TOT_DIV_ONE 1.0f
#define TOT_DIV_CNR (float)M_SQRT1_2
#define TOT_DIV_CNR float(M_SQRT1_2)
#define WTOT (TOT_DIV_ONE * 4 + TOT_DIV_CNR * 4)
@@ -177,7 +177,7 @@ void DespeckleOperation::update_memory_buffer_partial(MemoryBuffer *output,
const float *in1 = nullptr;
#define TOT_DIV_ONE 1.0f
#define TOT_DIV_CNR (float)M_SQRT1_2
#define TOT_DIV_CNR float(M_SQRT1_2)
#define WTOT (TOT_DIV_ONE * 4 + TOT_DIV_CNR * 4)

View File

@@ -76,4 +76,4 @@ void lightprobe_eval(ClosureDiffuse diffuse,
SphericalHarmonicL1 irradiance = lightprobe_irradiance_sample(irradiance_atlas_tx, P);
out_diffuse += spherical_harmonics_evaluate_lambert(diffuse.N, irradiance);
}
}

View File

@@ -30,4 +30,4 @@ vec3 octahedral_uv_to_direction(vec2 co)
}
return v;
}
}

View File

@@ -16,4 +16,4 @@ void main()
vec4 col = textureLod(cubemap_tx, R, 0.0);
imageStore(octahedral_img, octahedral_coord, col);
}
}

View File

@@ -2466,7 +2466,7 @@ static float x_axis_name[4][2] = {
{-0.9f * S_X, 1.0f * S_Y},
{1.0f * S_X, -1.0f * S_Y},
};
#define X_LEN (ARRAY_SIZE(x_axis_name))
#define X_LEN ARRAY_SIZE(x_axis_name)
#undef S_X
#undef S_Y
@@ -2480,7 +2480,7 @@ static float y_axis_name[6][2] = {
{0.0f * S_X, -0.1f * S_Y},
{0.0f * S_X, -1.0f * S_Y},
};
#define Y_LEN (ARRAY_SIZE(y_axis_name))
#define Y_LEN ARRAY_SIZE(y_axis_name)
#undef S_X
#undef S_Y
@@ -2498,7 +2498,7 @@ static float z_axis_name[10][2] = {
{-1.00f * S_X, -1.00f * S_Y},
{1.00f * S_X, -1.00f * S_Y},
};
#define Z_LEN (ARRAY_SIZE(z_axis_name))
#define Z_LEN ARRAY_SIZE(z_axis_name)
#undef S_X
#undef S_Y
@@ -2525,7 +2525,7 @@ static float axis_marker[8][2] = {
{-S_X, 0.0f}
#endif
};
#define MARKER_LEN (ARRAY_SIZE(axis_marker))
#define MARKER_LEN ARRAY_SIZE(axis_marker)
#define MARKER_FILL_LAYER 6
#undef S_X
#undef S_Y

View File

@@ -4219,7 +4219,7 @@ static void ANIM_OT_channel_view_pick(wmOperatorType *ot)
/** \name Operator Registration
* \{ */
void ED_operatortypes_animchannels(void)
void ED_operatortypes_animchannels()
{
WM_operatortype_append(ANIM_OT_channels_select_all);
WM_operatortype_append(ANIM_OT_channels_select_box);

View File

@@ -1474,7 +1474,7 @@ static size_t animfilter_action(bAnimContext *ac,
/* un-grouped F-Curves (only if we're not only considering those channels in the active group) */
if (!(filter_mode & ANIMFILTER_ACTGROUPED)) {
FCurve *firstfcu = (lastchan) ? (lastchan->next) : static_cast<FCurve *>((act->curves.first));
FCurve *firstfcu = (lastchan) ? (lastchan->next) : static_cast<FCurve *>(act->curves.first);
items += animfilter_fcurves(
anim_data, ads, firstfcu, ANIMTYPE_FCURVE, filter_mode, nullptr, owner_id, &act->id);
}

View File

@@ -237,7 +237,7 @@ void getcolor_fcurve_rainbow(int cur, int tot, float out[3])
* However, only a range of 0.3 to 1.0 is really usable to avoid clashing
* with some other stuff
*/
fac = ((float)cur / (float)tot) * 0.7f;
fac = (float(cur) / float(tot)) * 0.7f;
/* the base color can get offset a bit so that the colors aren't so identical */
hsv[0] += fac * HSV_BANDWIDTH;

View File

@@ -1028,7 +1028,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
value = TIME2FRA(value);
}
RNA_int_set(op->ptr, "frames", (int)value);
RNA_int_set(op->ptr, "frames", int(value));
ed_marker_move_apply(C, op);
ed_marker_move_update_header(C, op);
}
@@ -1078,7 +1078,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
0.1 * FPS,
0);
RNA_int_set(op->ptr, "frames", (int)fac);
RNA_int_set(op->ptr, "frames", int(fac));
ed_marker_move_apply(C, op);
ed_marker_move_update_header(C, op);
}
@@ -1094,7 +1094,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, const wmEvent *even
value = TIME2FRA(value);
}
RNA_int_set(op->ptr, "frames", (int)value);
RNA_int_set(op->ptr, "frames", int(value));
ed_marker_move_apply(C, op);
ed_marker_move_update_header(C, op);
}
@@ -1897,7 +1897,7 @@ static void MARKER_OT_camera_bind(wmOperatorType *ot)
/** \name Registration
* \{ */
void ED_operatortypes_marker(void)
void ED_operatortypes_marker()
{
WM_operatortype_append(MARKER_OT_add);
WM_operatortype_append(MARKER_OT_move);

View File

@@ -173,7 +173,7 @@ static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
copy_v3_v3(mpv->co, ob_eval->object_to_world[3]);
}
float mframe = (float)(cframe);
float mframe = float(cframe);
/* Tag if it's a keyframe */
if (ED_keylist_find_exact(mpt->keylist, mframe)) {

View File

@@ -653,7 +653,7 @@ static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
/** \name Registration
* \{ */
void ED_operatortypes_anim(void)
void ED_operatortypes_anim()
{
/* Animation Editors only -------------------------- */
WM_operatortype_append(ANIM_OT_change_frame);

View File

@@ -573,7 +573,7 @@ bool ANIM_remove_driver(
/* Copy/Paste Buffer for Driver Data... */
static FCurve *channeldriver_copypaste_buf = nullptr;
void ANIM_drivers_copybuf_free(void)
void ANIM_drivers_copybuf_free()
{
/* free the buffer F-Curve if it exists, as if it were just another F-Curve */
if (channeldriver_copypaste_buf) {
@@ -582,7 +582,7 @@ void ANIM_drivers_copybuf_free(void)
channeldriver_copypaste_buf = nullptr;
}
bool ANIM_driver_can_paste(void)
bool ANIM_driver_can_paste()
{
return (channeldriver_copypaste_buf != nullptr);
}
@@ -694,7 +694,7 @@ bool ANIM_paste_driver(
/* Copy/Paste Buffer for Driver Variables... */
static ListBase driver_vars_copybuf = {nullptr, nullptr};
void ANIM_driver_vars_copybuf_free(void)
void ANIM_driver_vars_copybuf_free()
{
/* Free the driver variables kept in the buffer */
if (driver_vars_copybuf.first) {
@@ -710,7 +710,7 @@ void ANIM_driver_vars_copybuf_free(void)
BLI_listbase_clear(&driver_vars_copybuf);
}
bool ANIM_driver_vars_can_paste(void)
bool ANIM_driver_vars_can_paste()
{
return (BLI_listbase_is_empty(&driver_vars_copybuf) == false);
}

View File

@@ -950,7 +950,7 @@ static ListBase fmodifier_copypaste_buf = {nullptr, nullptr};
/* ---------- */
void ANIM_fmodifiers_copybuf_free(void)
void ANIM_fmodifiers_copybuf_free()
{
/* just free the whole buffer */
free_fmodifiers(&fmodifier_copypaste_buf);

View File

@@ -397,7 +397,7 @@ void ED_ANIM_get_1d_gauss_kernel(const float sigma, const int kernel_size, doubl
double sum = 0.0;
for (int i = 0; i < kernel_size; i++) {
const double normalized_index = (double)i / (kernel_size - 1);
const double normalized_index = double(i) / (kernel_size - 1);
r_kernel[i] = exp(-normalized_index * normalized_index / sigma_sq);
if (i == 0) {
sum += r_kernel[i];
@@ -433,7 +433,7 @@ void smooth_fcurve_segment(FCurve *fcu,
filter_result += samples[sample_index + j] * kernel_value;
filter_result += samples[sample_index - j] * kernel_value;
}
const float key_y_value = interpf((float)filter_result, samples[sample_index], factor);
const float key_y_value = interpf(float(filter_result), samples[sample_index], factor);
BKE_fcurve_keyframe_move_value_with_handles(&fcu->bezt[i], key_y_value);
}
}
@@ -862,7 +862,7 @@ struct tAnimCopybufItem {
bool is_bone; /* special flag for armature bones */
};
void ANIM_fcurves_copybuf_free(void)
void ANIM_fcurves_copybuf_free()
{
tAnimCopybufItem *aci, *acn;

View File

@@ -616,7 +616,7 @@ void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi)
BLI_freelinkN(&keyingset_type_infos, ksi);
}
void ANIM_keyingset_infos_exit(void)
void ANIM_keyingset_infos_exit()
{
KeyingSetInfo *ksi, *next;

View File

@@ -1269,7 +1269,7 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
{
if (ebone_iter->temp.ebone) {
/* copy all flags except for ... */
const int flag_copy = ((int)~0) & ~(BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL);
const int flag_copy = int(~0) & ~(BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL);
EditBone *ebone = ebone_iter->temp.ebone;

View File

@@ -136,7 +136,7 @@ void ED_armature_origin_set(
add_v3_v3(cent, ebone->tail);
}
if (total) {
mul_v3_fl(cent, 1.0f / (float)total);
mul_v3_fl(cent, 1.0f / float(total));
}
}
}
@@ -190,7 +190,7 @@ float ED_armature_ebone_roll_to_vector(const EditBone *bone,
sub_v3_v3v3(align_axis_proj, align_axis, vec);
if (axis_only) {
if (angle_v3v3(align_axis_proj, mat[2]) > (float)(M_PI_2)) {
if (angle_v3v3(align_axis_proj, mat[2]) > float(M_PI_2)) {
negate_v3(align_axis_proj);
}
}

View File

@@ -18,7 +18,7 @@
/* ************************** registration **********************************/
void ED_operatortypes_armature(void)
void ED_operatortypes_armature()
{
/* Both operators `ARMATURE_OT_*` and `POSE_OT_*` are registered here. */
@@ -127,7 +127,7 @@ void ED_operatortypes_armature(void)
WM_operatortype_append(POSE_OT_blend_to_neighbors);
}
void ED_operatormacros_armature(void)
void ED_operatormacros_armature()
{
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;

View File

@@ -1700,7 +1700,7 @@ static void select_similar_direction(bContext *C, const float thresh)
float dir[3];
bone_direction_worldspace_get(ob, ebone, dir);
if (angle_v3v3(dir_act, dir) / (float)M_PI < (thresh + FLT_EPSILON)) {
if (angle_v3v3(dir_act, dir) / float(M_PI) < (thresh + FLT_EPSILON)) {
ED_armature_ebone_select_set(ebone, true);
changed = true;
}

View File

@@ -638,11 +638,11 @@ static void armature_finalize_restpose(ListBase *bonelist, ListBase *editbonelis
mul_m3_m3m3(difmat, imat, postmat);
#if 0
printf("Bone %s\n", curBone->name);
print_m4("premat", premat);
print_m4("postmat", postmat);
print_m4("difmat", difmat);
#if 0
printf("Bone %s\n", curBone->name);
print_m4("premat", premat);
print_m4("postmat", postmat);
print_m4("difmat", difmat);
printf("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2])));
#endif

View File

@@ -627,7 +627,7 @@ static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
/* use API Method for conversions... */
BKE_rotMode_change_values(
pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)mode);
pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, short(mode));
/* finally, set the new rotation type */
pchan->rotmode = mode;

View File

@@ -49,7 +49,7 @@
#include "armature_intern.h"
/* utility macros for storing a temp int in the bone (selection flag) */
#define PBONE_PREV_FLAG_GET(pchan) ((void)0, (POINTER_AS_INT((pchan)->temp)))
#define PBONE_PREV_FLAG_GET(pchan) ((void)0, POINTER_AS_INT((pchan)->temp))
#define PBONE_PREV_FLAG_SET(pchan, val) ((pchan)->temp = POINTER_FROM_INT(val))
/* ***************** Pose Select Utilities ********************* */

View File

@@ -15,7 +15,7 @@
#include "lattice_intern.h"
void ED_operatortypes_lattice(void)
void ED_operatortypes_lattice()
{
WM_operatortype_append(LATTICE_OT_select_all);
WM_operatortype_append(LATTICE_OT_select_more);

View File

@@ -582,7 +582,7 @@ static void edbm_bevel_numinput_set_value(wmOperator *op)
CLAMP(value, value_clamp_min[vmode], value_clamp_max[vmode]);
if (vmode == SEGMENTS_VALUE) {
opdata->segments = value;
RNA_int_set(op->ptr, "segments", (int)value);
RNA_int_set(op->ptr, "segments", int(value));
}
else {
RNA_float_set(op->ptr, value_rna_name[vmode], value);

View File

@@ -740,16 +740,16 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w
}
}
mul_v3_fl(local_center, 1.0f / (float)local_verts_len);
mul_v3_fl(local_center, 1.0f / float(local_verts_len));
mul_m4_v3(vc.obedit->object_to_world, local_center);
mul_v3_fl(local_center, (float)local_verts_len);
mul_v3_fl(local_center, float(local_verts_len));
add_v3_v3(center, local_center);
verts_len += local_verts_len;
}
if (verts_len != 0) {
mul_v3_fl(center, 1.0f / (float)verts_len);
mul_v3_fl(center, 1.0f / float(verts_len));
}
/* Then we process the meshes. */

View File

@@ -644,7 +644,7 @@ static void knifetool_draw_angle(const KnifeTool_OpData *kcd,
}
else {
BKE_unit_value_as_string(
numstr, sizeof(numstr), (double)angle, angle_precision, B_UNIT_ROTATION, unit, false);
numstr, sizeof(numstr), double(angle), angle_precision, B_UNIT_ROTATION, unit, false);
}
BLF_enable(blf_mono_font, BLF_ROTATION);
@@ -2350,10 +2350,10 @@ static void knife_make_cuts(KnifeTool_OpData *kcd, Object *ob)
if (!f || kfe->e) {
continue;
}
list = static_cast<ListBase *>(BLI_smallhash_lookup(fhash, (uintptr_t)f));
list = static_cast<ListBase *>(BLI_smallhash_lookup(fhash, uintptr_t(f)));
if (!list) {
list = knife_empty_list(kcd);
BLI_smallhash_insert(fhash, (uintptr_t)f, list);
BLI_smallhash_insert(fhash, uintptr_t(f), list);
}
knife_append_list(kcd, list, kfe);
}
@@ -2372,10 +2372,10 @@ static void knife_make_cuts(KnifeTool_OpData *kcd, Object *ob)
if (!e) {
continue;
}
list = static_cast<ListBase *>(BLI_smallhash_lookup(ehash, (uintptr_t)e));
list = static_cast<ListBase *>(BLI_smallhash_lookup(ehash, uintptr_t(e)));
if (!list) {
list = knife_empty_list(kcd);
BLI_smallhash_insert(ehash, (uintptr_t)e, list);
BLI_smallhash_insert(ehash, uintptr_t(e), list);
}
/* There can be more than one kfe in kfv's list with same e. */
if (!find_ref(list, kfv)) {
@@ -2958,12 +2958,12 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
continue;
}
/* For faces, store index of lowest hit looptri in hash. */
if (BLI_smallhash_haskey(&faces, (uintptr_t)f)) {
if (BLI_smallhash_haskey(&faces, uintptr_t(f))) {
continue;
}
/* Don't care what the value is except that it is non-null, for iterator. */
BLI_smallhash_insert(&faces, (uintptr_t)f, f);
BLI_smallhash_insert(&fobs, (uintptr_t)f, (void *)(uintptr_t)ob_index);
BLI_smallhash_insert(&faces, uintptr_t(f), f);
BLI_smallhash_insert(&fobs, uintptr_t(f), (void *)uintptr_t(ob_index));
list = knife_get_face_kedges(kcd, ob, ob_index, f);
for (ref = static_cast<Ref *>(list->first); ref; ref = ref->next) {
@@ -2971,14 +2971,14 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
if (kfe->is_invalid) {
continue;
}
if (BLI_smallhash_haskey(&kfes, (uintptr_t)kfe)) {
if (BLI_smallhash_haskey(&kfes, uintptr_t(kfe))) {
continue;
}
BLI_smallhash_insert(&kfes, (uintptr_t)kfe, kfe);
BLI_smallhash_insert(&kfes, uintptr_t(kfe), kfe);
v = kfe->v1;
BLI_smallhash_reinsert(&kfvs, (uintptr_t)v, v);
BLI_smallhash_reinsert(&kfvs, uintptr_t(v), v);
v = kfe->v2;
BLI_smallhash_reinsert(&kfvs, (uintptr_t)v, v);
BLI_smallhash_reinsert(&kfvs, uintptr_t(v), v);
}
}
@@ -3141,7 +3141,7 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd)
{
float p[3], p_cage[3];
uint ob_index = (uint)(uintptr_t)BLI_smallhash_lookup(&fobs, (uintptr_t)f);
uint ob_index = (uint)(uintptr_t)BLI_smallhash_lookup(&fobs, uintptr_t(f));
ob = kcd->objects[ob_index];
if (use_hit_prev &&
@@ -3346,7 +3346,7 @@ static float knife_snap_size(KnifeTool_OpData *kcd, float maxsize)
kcd, maxsize * 2.0f, kcd->curr.ob, kcd->curr.ob_index, kcd->curr.bmface, kcd->curr.cage);
}
return density ? min_ff(maxsize / ((float)density * 0.5f), maxsize) : maxsize;
return density ? min_ff(maxsize / (float(density) * 0.5f), maxsize) : maxsize;
}
/* Snap to edge when in a constrained mode.

View File

@@ -122,7 +122,7 @@ struct EditMesh_PreSelEdgeRing {
int verts_len;
};
struct EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create(void)
struct EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create()
{
struct EditMesh_PreSelEdgeRing *psel = static_cast<EditMesh_PreSelEdgeRing *>(
MEM_callocN(sizeof(*psel), __func__));
@@ -185,7 +185,7 @@ void EDBM_preselect_edgering_draw(struct EditMesh_PreSelEdgeRing *psel, const fl
/* Same size as an edit mode vertex */
immUniform1f("size",
2.0 * U.pixelsize *
max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f));
max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * float(M_SQRT2) / 2.0f));
immBegin(GPU_PRIM_POINTS, psel->verts_len);
@@ -221,7 +221,7 @@ static void view3d_preselect_mesh_edgering_update_verts_from_edge(
edgering_vcos_get_pair(&eed_start->v1, v_cos, coords);
for (i = 1; i <= previewlines; i++) {
const float fac = (i / ((float)previewlines + 1));
const float fac = (i / (float(previewlines) + 1));
interp_v3_v3v3(verts[tot], v_cos[0], v_cos[1], fac);
tot++;
}
@@ -291,7 +291,7 @@ static void view3d_preselect_mesh_edgering_update_edges_from_edge(
eve_last = v[0][0];
for (i = 1; i <= previewlines; i++) {
const float fac = (i / ((float)previewlines + 1));
const float fac = (i / (float(previewlines) + 1));
float v_cos[2][2][3];
edgering_vcos_get(v, v_cos, coords);
@@ -318,7 +318,7 @@ static void view3d_preselect_mesh_edgering_update_edges_from_edge(
edgering_find_order(eed_last, eed_start, eve_last, v);
for (i = 1; i <= previewlines; i++) {
const float fac = (i / ((float)previewlines + 1));
const float fac = (i / (float(previewlines) + 1));
float v_cos[2][2][3];
if (!v[0][0] || !v[0][1] || !v[1][0] || !v[1][1]) {

View File

@@ -83,7 +83,7 @@ eEditMesh_PreSelPreviewAction EDBM_preselect_action_get(struct EditMesh_PreSelEl
return psel->preview_action;
}
struct EditMesh_PreSelElem *EDBM_preselect_elem_create(void)
struct EditMesh_PreSelElem *EDBM_preselect_elem_create()
{
struct EditMesh_PreSelElem *psel = static_cast<EditMesh_PreSelElem *>(
MEM_callocN(sizeof(*psel), __func__));

View File

@@ -81,7 +81,7 @@ static int edbm_rip_edge_invoke(bContext *C, wmOperator * /*op*/, const wmEvent
cent_tot += 1;
}
}
mul_v2_fl(cent_sco, 1.0f / (float)cent_tot);
mul_v2_fl(cent_sco, 1.0f / float(cent_tot));
/* not essential, but gives more expected results with edge selection */
if (bm->totedgesel) {

View File

@@ -583,7 +583,7 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op)
const int type = RNA_enum_get(op->ptr, "type");
const float thresh = RNA_float_get(op->ptr, "threshold");
const float thresh_radians = thresh * (float)M_PI + FLT_EPSILON;
const float thresh_radians = thresh * float(M_PI) + FLT_EPSILON;
const int compare = RNA_enum_get(op->ptr, "compare");
int tot_edges_selected_all = 0;
@@ -961,7 +961,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op)
/* get the type from RNA */
const int type = RNA_enum_get(op->ptr, "type");
const float thresh = RNA_float_get(op->ptr, "threshold");
const float thresh_radians = thresh * (float)M_PI + FLT_EPSILON;
const float thresh_radians = thresh * float(M_PI) + FLT_EPSILON;
const int compare = RNA_enum_get(op->ptr, "compare");
int tot_verts_selected_all = 0;

View File

@@ -615,7 +615,7 @@ int BM_uv_element_get_unique_index(UvElementMap *element_map, UvElement *child)
return unique_index[index];
}
#define INVALID_ISLAND (uint(-1))
#define INVALID_ISLAND uint(-1)
static void bm_uv_assign_island(UvElementMap *element_map,
UvElement *element,

View File

@@ -20,7 +20,7 @@
/**************************** registration **********************************/
void ED_operatortypes_mesh(void)
void ED_operatortypes_mesh()
{
WM_operatortype_append(MESH_OT_select_all);
WM_operatortype_append(MESH_OT_select_interior_faces);
@@ -205,7 +205,7 @@ static int ED_operator_editmesh_face_select(bContext *C)
}
#endif
void ED_operatormacros_mesh(void)
void ED_operatormacros_mesh()
{
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;

View File

@@ -301,7 +301,7 @@ static bool mball_select_similar_type(Object *obedit,
BKE_object_rot_to_mat3(obedit, rmat, true);
mul_m3_v3(rmat, dir);
float thresh_cos = cosf(thresh * (float)M_PI_2);
float thresh_cos = cosf(thresh * float(M_PI_2));
KDTreeNearest_3d nearest;
if (BLI_kdtree_3d_find_nearest(tree_3d, dir, &nearest) != -1) {

View File

@@ -18,7 +18,7 @@
#include "mball_intern.h"
void ED_operatortypes_metaball(void)
void ED_operatortypes_metaball()
{
WM_operatortype_append(MBALL_OT_delete_metaelems);
WM_operatortype_append(MBALL_OT_duplicate_metaelems);
@@ -31,7 +31,7 @@ void ED_operatortypes_metaball(void)
WM_operatortype_append(MBALL_OT_select_random_metaelems);
}
void ED_operatormacros_metaball(void)
void ED_operatormacros_metaball()
{
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;

View File

@@ -654,4 +654,4 @@ void OBJECT_OT_collection_objects_select(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
}

View File

@@ -1130,7 +1130,7 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op)
* y = Ax + B
* 1 0 <-- coefficients array indices
*/
float A = standardRange / (float)(len);
float A = standardRange / float(len);
float B = (float)(-sfra) * A;
gen->coefficients[1] = A;
@@ -2793,4 +2793,4 @@ void POSE_OT_ik_clear(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
/** \} */
/** \} */

View File

@@ -87,7 +87,7 @@ static int return_editmesh_indexar(BMEditMesh *em,
nr++;
}
mul_v3_fl(r_cent, 1.0f / (float)indexar_num);
mul_v3_fl(r_cent, 1.0f / float(indexar_num));
return indexar_num;
}
@@ -120,7 +120,7 @@ static bool return_editmesh_vgroup(Object *obedit, BMEditMesh *em, char *r_name,
const ListBase *defbase = BKE_object_defgroup_list(obedit);
bDeformGroup *dg = static_cast<bDeformGroup *>(BLI_findlink(defbase, defgrp_index));
BLI_strncpy(r_name, dg->name, sizeof(dg->name));
mul_v3_fl(r_cent, 1.0f / (float)indexar_num);
mul_v3_fl(r_cent, 1.0f / float(indexar_num));
return true;
}
}
@@ -197,7 +197,7 @@ static int return_editlattice_indexar(Lattice *editlatt,
nr++;
}
mul_v3_fl(r_cent, 1.0f / (float)indexar_num);
mul_v3_fl(r_cent, 1.0f / float(indexar_num));
return indexar_num;
}
@@ -313,7 +313,7 @@ static int return_editcurve_indexar(Object *obedit,
}
}
mul_v3_fl(r_cent, 1.0f / (float)indexar_num);
mul_v3_fl(r_cent, 1.0f / float(indexar_num));
return indexar_num;
}

View File

@@ -26,7 +26,7 @@
/* ************************** registration **********************************/
void ED_operatortypes_object(void)
void ED_operatortypes_object()
{
WM_operatortype_append(OBJECT_OT_location_clear);
WM_operatortype_append(OBJECT_OT_rotation_clear);
@@ -290,7 +290,7 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_light_linking_unlink_from_collection);
}
void ED_operatormacros_object(void)
void ED_operatormacros_object()
{
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;

View File

@@ -2048,12 +2048,12 @@ static void single_mat_users(
FOREACH_OBJECT_FLAG_BEGIN (scene, view_layer, v3d, flag, ob) {
if (BKE_id_is_editable(bmain, &ob->id)) {
for (a = 1; a <= ob->totcol; a++) {
ma = BKE_object_material_get(ob, (short)a);
ma = BKE_object_material_get(ob, short(a));
if (single_data_needs_duplication(&ma->id)) {
man = (Material *)BKE_id_copy_ex(
bmain, &ma->id, nullptr, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS);
man->id.us = 0;
BKE_object_material_assign(bmain, ob, man, (short)a, BKE_MAT_ASSIGN_USERPREF);
BKE_object_material_assign(bmain, ob, man, short(a), BKE_MAT_ASSIGN_USERPREF);
}
}
}

View File

@@ -161,7 +161,7 @@ struct XFormObjectSkipChild {
int mode;
};
struct XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create(void)
struct XFormObjectSkipChild_Container *ED_object_xform_skip_child_container_create()
{
struct XFormObjectSkipChild_Container *xcs = static_cast<XFormObjectSkipChild_Container *>(
MEM_callocN(sizeof(*xcs), __func__));
@@ -409,7 +409,7 @@ static void trans_obdata_in_obmode_free_elem(void *xf_p)
MEM_freeN(xf);
}
struct XFormObjectData_Container *ED_object_data_xform_container_create(void)
struct XFormObjectData_Container *ED_object_data_xform_container_create()
{
struct XFormObjectData_Container *xds = static_cast<XFormObjectData_Container *>(
MEM_callocN(sizeof(*xds), __func__));

View File

@@ -428,7 +428,7 @@ static void SCENE_OT_delete(wmOperatorType *ot)
/** \name Registration
* \{ */
void ED_operatortypes_scene(void)
void ED_operatortypes_scene()
{
WM_operatortype_append(SCENE_OT_new);
WM_operatortype_append(SCENE_OT_delete);

View File

@@ -53,7 +53,7 @@ static IKPlugin ikplugin_tab[] = {
static IKPlugin *get_plugin(bPose *pose)
{
if (!pose || pose->iksolver < 0 || pose->iksolver >= ((ARRAY_SIZE(ikplugin_tab)) - 1)) {
if (!pose || pose->iksolver < 0 || pose->iksolver >= (ARRAY_SIZE(ikplugin_tab) - 1)) {
return NULL;
}

View File

@@ -116,7 +116,7 @@
# define MAKE_ID(a, b, c, d) ((int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d))
#else
/* Little Endian */
# define MAKE_ID(a, b, c, d) ((int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a))
# define MAKE_ID(a, b, c, d) (int(d) << 24 | int(c) << 16 | (b) << 8 | (a))
#endif
/* ************************* DIV ********************** */
@@ -296,7 +296,7 @@ int DNA_struct_alias_find_nr(const SDNA *sdna, const char *str)
BLI_INLINE const char *pad_up_4(const char *ptr)
{
return (const char *)((((uintptr_t)ptr) + 3) & ~3);
return (const char *)((uintptr_t(ptr) + 3) & ~3);
}
/**
@@ -563,18 +563,18 @@ SDNA *DNA_sdna_from_data(const void *data,
*/
static SDNA *g_sdna = nullptr;
void DNA_sdna_current_init(void)
void DNA_sdna_current_init()
{
g_sdna = DNA_sdna_from_data(DNAstr, DNAlen, false, false, nullptr);
}
const SDNA *DNA_sdna_current_get(void)
const SDNA *DNA_sdna_current_get()
{
BLI_assert(g_sdna != nullptr);
return g_sdna;
}
void DNA_sdna_current_free(void)
void DNA_sdna_current_free()
{
DNA_sdna_free(g_sdna);
g_sdna = nullptr;

View File

@@ -1219,7 +1219,7 @@ static void dna_write(FILE *file, const void *pntr, const int size)
}
}
void print_struct_sizes(void)
void print_struct_sizes()
{
int unknown = structs_len;
printf("\n\n*** All detected structs:\n");
@@ -1622,7 +1622,7 @@ int main(int argc, char **argv)
*
* \{ */
static void UNUSED_FUNCTION(dna_rename_defs_ensure)(void)
static void UNUSED_FUNCTION(dna_rename_defs_ensure)()
{
#define DNA_STRUCT_RENAME(old, new) (void)sizeof(new);
#define DNA_STRUCT_RENAME_ELEM(struct_name, old, new) (void)offsetof(struct_name, new);

View File

@@ -542,11 +542,11 @@ static bool rna_BrushCapabilitiesSculpt_has_plane_offset_get(PointerRNA *ptr)
static bool rna_BrushCapabilitiesSculpt_has_random_texture_angle_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
return (!ELEM(br->sculpt_tool,
SCULPT_TOOL_GRAB,
SCULPT_TOOL_ROTATE,
SCULPT_TOOL_SNAKE_HOOK,
SCULPT_TOOL_THUMB));
return !ELEM(br->sculpt_tool,
SCULPT_TOOL_GRAB,
SCULPT_TOOL_ROTATE,
SCULPT_TOOL_SNAKE_HOOK,
SCULPT_TOOL_THUMB);
}
static bool rna_TextureCapabilities_has_random_texture_angle_get(PointerRNA *ptr)

View File

@@ -857,4 +857,4 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_api_camera(srna);
}
#endif
#endif

View File

@@ -102,4 +102,4 @@ void RNA_api_drivers(StructRNA * /*srna*/)
/* PropertyRNA *parm; */
}
#endif
#endif

View File

@@ -229,4 +229,4 @@ void RNA_def_lightprobe(BlenderRNA *brna)
rna_def_lightprobe(brna);
}
#endif
#endif

View File

@@ -463,4 +463,4 @@ void RNA_def_movieclip(BlenderRNA *brna)
rna_def_movieClipScopes(brna);
}
#endif
#endif

View File

@@ -1055,17 +1055,17 @@ static float rna_PartSetting_linelenhead_get(PointerRNA *ptr)
static bool rna_PartSettings_is_fluid_get(PointerRNA *ptr)
{
ParticleSettings *part = static_cast<ParticleSettings *>(ptr->data);
return (ELEM(part->type,
PART_FLUID,
PART_FLUID_FLIP,
PART_FLUID_FOAM,
PART_FLUID_SPRAY,
PART_FLUID_BUBBLE,
PART_FLUID_TRACER,
PART_FLUID_SPRAYFOAM,
PART_FLUID_SPRAYBUBBLE,
PART_FLUID_FOAMBUBBLE,
PART_FLUID_SPRAYFOAMBUBBLE));
return ELEM(part->type,
PART_FLUID,
PART_FLUID_FLIP,
PART_FLUID_FOAM,
PART_FLUID_SPRAY,
PART_FLUID_BUBBLE,
PART_FLUID_TRACER,
PART_FLUID_SPRAYFOAM,
PART_FLUID_SPRAYBUBBLE,
PART_FLUID_FOAMBUBBLE,
PART_FLUID_SPRAYFOAMBUBBLE);
}
static void rna_ParticleSettings_use_clump_curve_update(Main *bmain, Scene *scene, PointerRNA *ptr)

View File

@@ -108,4 +108,4 @@ void RNA_def_sound(BlenderRNA *brna)
rna_def_sound(brna);
}
#endif
#endif

View File

@@ -298,4 +298,4 @@ void RNA_def_text(BlenderRNA *brna)
rna_def_text(brna);
}
#endif
#endif

View File

@@ -74,4 +74,4 @@ void RNA_def_timeline_marker(BlenderRNA *brna)
rna_def_timeline_marker(brna);
}
#endif
#endif

View File

@@ -70,4 +70,4 @@ void RNA_def_vfont(BlenderRNA *brna)
RNA_api_vfont(srna);
}
#endif
#endif

View File

@@ -172,4 +172,4 @@ void RNA_api_workspace_tool(StructRNA *srna)
RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN);
}
#endif
#endif

View File

@@ -267,4 +267,4 @@ void RNA_def_world(BlenderRNA *brna)
rna_def_world_mist(brna);
}
#endif
#endif