Cleanup: function style casts, remove UNUSED(..) & use nullptr in C++

This commit is contained in:
Campbell Barton
2023-03-29 14:21:38 +11:00
parent 1ddbe7cadd
commit 2bc331981d
4 changed files with 9 additions and 10 deletions

View File

@@ -6814,8 +6814,7 @@ static void sort_bmelem_flag(bContext *C,
/* Multiplying with totface and adding i ensures us
* we keep current order for all faces of same mat. */
sb[affected[2]++].srt = srt * float(totelem[2]) + float(i);
// printf("e: %d; srt: %f; final: %f\n",
// i, srt, srt * ((float)totface) + ((float)i));
// printf("e: %d; srt: %f; final: %f\n", i, srt, srt * float(totface) + float(i));
}
else {
pb[i] = true;

View File

@@ -1000,7 +1000,7 @@ void AnimationImporter::translate_Animations(
ob = armature_importer->get_armature_for_joint(root);
}
else {
ob = object_map.find(uid) == object_map.end() ? NULL : object_map.find(uid)->second;
ob = object_map.find(uid) == object_map.end() ? nullptr : object_map.find(uid)->second;
}
if (!ob) {

View File

@@ -719,7 +719,7 @@ float bc_get_property(Bone *bone, std::string key, float def)
result = float(IDP_Double(property));
break;
case IDP_BOOLEAN:
result = (float)(IDP_Bool(property));
result = float(IDP_Bool(property));
break;
default:
result = def;

View File

@@ -410,17 +410,17 @@ BLI_INLINE int major_axis_v3(const float v[3])
}
BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid,
const float UNUSED(x1[3]),
const float UNUSED(v1[3]),
const float /*x1*/ [3],
const float /*v1*/ [3]),
const float x2[3],
const float v2[3],
const float x3[3],
const float v3[3],
const float UNUSED(x4[3]),
const float UNUSED(v4[3]),
const float UNUSED(dir1[3]),
const float /*x4*/ [3],
const float /*v4*/ [3],
const float /*dir1*/[3],
const float dir2[3],
const float UNUSED(dir3[3]),
const float /*dir3*/ [3],
int resj,
int resk,
int jmin,