Cleanup: Clang-Tidy, modernize-use-bool-literals
This commit is contained in:
parent
dfa027fe09
commit
af35ada2f3
|
@ -42,7 +42,6 @@ Checks: >
|
||||||
-modernize-concat-nested-namespaces,
|
-modernize-concat-nested-namespaces,
|
||||||
-modernize-use-nodiscard,
|
-modernize-use-nodiscard,
|
||||||
-modernize-use-using,
|
-modernize-use-using,
|
||||||
-modernize-use-bool-literals,
|
|
||||||
-modernize-loop-convert,
|
-modernize-loop-convert,
|
||||||
-modernize-pass-by-value,
|
-modernize-pass-by-value,
|
||||||
-modernize-use-default-member-init,
|
-modernize-use-default-member-init,
|
||||||
|
|
|
@ -41,7 +41,7 @@ TEST(path_util, Clean)
|
||||||
EXPECT_STREQ("a/", path);
|
EXPECT_STREQ("a/", path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) /* FIXME */
|
if (false) /* FIXME */
|
||||||
{
|
{
|
||||||
char path[FILE_MAX] = "./a////";
|
char path[FILE_MAX] = "./a////";
|
||||||
BLI_path_normalize(NULL, path);
|
BLI_path_normalize(NULL, path);
|
||||||
|
|
|
@ -747,7 +747,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
|
||||||
float blendfac, ipodata[4];
|
float blendfac, ipodata[4];
|
||||||
|
|
||||||
/* clear zbuf, if we draw future we fill in not moving pixels */
|
/* clear zbuf, if we draw future we fill in not moving pixels */
|
||||||
if (0) {
|
if (false) {
|
||||||
for (x = xsize * ysize - 1; x >= 0; x--) {
|
for (x = xsize * ysize - 1; x >= 0; x--) {
|
||||||
rectz[x] = 10e16;
|
rectz[x] = 10e16;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1234,7 +1234,7 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cti->flush_constraint_targets) {
|
if (cti->flush_constraint_targets) {
|
||||||
cti->flush_constraint_targets(con, &targets, 1);
|
cti->flush_constraint_targets(con, &targets, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ void FRS_init()
|
||||||
|
|
||||||
BKE_callback_add(&load_post_callback_funcstore, BKE_CB_EVT_LOAD_POST);
|
BKE_callback_add(&load_post_callback_funcstore, BKE_CB_EVT_LOAD_POST);
|
||||||
|
|
||||||
freestyle_is_initialized = 1;
|
freestyle_is_initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FRS_set_context(bContext *C)
|
void FRS_set_context(bContext *C)
|
||||||
|
|
|
@ -648,10 +648,10 @@ static bool float_array_from_PyList(PyObject *obj, float *v, int n)
|
||||||
v[i] = PyFloat_AsDouble(PyList_GET_ITEM(obj, i));
|
v[i] = PyFloat_AsDouble(PyList_GET_ITEM(obj, i));
|
||||||
if (v[i] == -1.0f && PyErr_Occurred()) {
|
if (v[i] == -1.0f && PyErr_Occurred()) {
|
||||||
PyErr_SetString(PyExc_TypeError, "list elements must be a number");
|
PyErr_SetString(PyExc_TypeError, "list elements must be a number");
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Vec2f_ptr_from_PyList(PyObject *obj, Vec2f &vec)
|
bool Vec2f_ptr_from_PyList(PyObject *obj, Vec2f &vec)
|
||||||
|
@ -707,10 +707,10 @@ static bool float_array_from_PyTuple(PyObject *obj, float *v, int n)
|
||||||
v[i] = PyFloat_AsDouble(PyTuple_GET_ITEM(obj, i));
|
v[i] = PyFloat_AsDouble(PyTuple_GET_ITEM(obj, i));
|
||||||
if (v[i] == -1.0f && PyErr_Occurred()) {
|
if (v[i] == -1.0f && PyErr_Occurred()) {
|
||||||
PyErr_SetString(PyExc_TypeError, "tuple elements must be a number");
|
PyErr_SetString(PyExc_TypeError, "tuple elements must be a number");
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Vec2f_ptr_from_PyTuple(PyObject *obj, Vec2f &vec)
|
bool Vec2f_ptr_from_PyTuple(PyObject *obj, Vec2f &vec)
|
||||||
|
@ -766,21 +766,21 @@ bool float_array_from_PyObject(PyObject *obj, float *v, int n)
|
||||||
{
|
{
|
||||||
if (VectorObject_Check(obj) && ((VectorObject *)obj)->size == n) {
|
if (VectorObject_Check(obj) && ((VectorObject *)obj)->size == n) {
|
||||||
if (BaseMath_ReadCallback((BaseMathObject *)obj) == -1) {
|
if (BaseMath_ReadCallback((BaseMathObject *)obj) == -1) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
v[i] = ((VectorObject *)obj)->vec[i];
|
v[i] = ((VectorObject *)obj)->vec[i];
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
if (ColorObject_Check(obj) && n == 3) {
|
if (ColorObject_Check(obj) && n == 3) {
|
||||||
if (BaseMath_ReadCallback((BaseMathObject *)obj) == -1) {
|
if (BaseMath_ReadCallback((BaseMathObject *)obj) == -1) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
v[i] = ((ColorObject *)obj)->col[i];
|
v[i] = ((ColorObject *)obj)->col[i];
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
if (PyList_Check(obj) && PyList_GET_SIZE(obj) == n) {
|
if (PyList_Check(obj) && PyList_GET_SIZE(obj) == n) {
|
||||||
return float_array_from_PyList(obj, v, n);
|
return float_array_from_PyList(obj, v, n);
|
||||||
|
@ -788,7 +788,7 @@ bool float_array_from_PyObject(PyObject *obj, float *v, int n)
|
||||||
if (PyTuple_Check(obj) && PyTuple_GET_SIZE(obj) == n) {
|
if (PyTuple_Check(obj) && PyTuple_GET_SIZE(obj) == n) {
|
||||||
return float_array_from_PyTuple(obj, v, n);
|
return float_array_from_PyTuple(obj, v, n);
|
||||||
}
|
}
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int convert_v4(PyObject *obj, void *v)
|
int convert_v4(PyObject *obj, void *v)
|
||||||
|
|
|
@ -268,7 +268,7 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
|
||||||
/* disable extrapolation if enabled */
|
/* disable extrapolation if enabled */
|
||||||
if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE)) {
|
if ((cumap->flag & CUMA_EXTEND_EXTRAPOLATE)) {
|
||||||
cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
|
cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
|
||||||
BKE_curvemapping_changed(cumap, 0);
|
BKE_curvemapping_changed(cumap, false);
|
||||||
}
|
}
|
||||||
return PyFloat_FromDouble(BKE_curvemapping_evaluateF(cumap, cur, value));
|
return PyFloat_FromDouble(BKE_curvemapping_evaluateF(cumap, cur, value));
|
||||||
}
|
}
|
||||||
|
|
|
@ -495,7 +495,7 @@ static PyObject *BPy_FrsMaterial_richcmpr(PyObject *objectA,
|
||||||
int comparison_type)
|
int comparison_type)
|
||||||
{
|
{
|
||||||
const BPy_FrsMaterial *matA = NULL, *matB = NULL;
|
const BPy_FrsMaterial *matA = NULL, *matB = NULL;
|
||||||
bool result = 0;
|
bool result = false;
|
||||||
|
|
||||||
if (!BPy_FrsMaterial_Check(objectA) || !BPy_FrsMaterial_Check(objectB)) {
|
if (!BPy_FrsMaterial_Check(objectA) || !BPy_FrsMaterial_Check(objectB)) {
|
||||||
if (comparison_type == Py_NE) {
|
if (comparison_type == Py_NE) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ typedef struct GPUSelectQueryState {
|
||||||
eGPUDepthTest depth_test;
|
eGPUDepthTest depth_test;
|
||||||
} GPUSelectQueryState;
|
} GPUSelectQueryState;
|
||||||
|
|
||||||
static GPUSelectQueryState g_query_state = {0};
|
static GPUSelectQueryState g_query_state = {false};
|
||||||
|
|
||||||
void gpu_select_query_begin(
|
void gpu_select_query_begin(
|
||||||
uint (*buffer)[4], uint bufsize, const rcti *input, char mode, int oldhits)
|
uint (*buffer)[4], uint bufsize, const rcti *input, char mode, int oldhits)
|
||||||
|
|
|
@ -956,7 +956,7 @@ static int convert_channels(struct Depsgraph *depsgraph,
|
||||||
* this is because some of the pose data (e.g. pose head) don't have corresponding
|
* this is because some of the pose data (e.g. pose head) don't have corresponding
|
||||||
* joint angles and can't be applied to the iTaSC armature dynamically */
|
* joint angles and can't be applied to the iTaSC armature dynamically */
|
||||||
if (!(pchan->flag & POSE_DONE)) {
|
if (!(pchan->flag & POSE_DONE)) {
|
||||||
BKE_pose_where_is_bone(depsgraph, ikscene->blscene, ikscene->blArmature, pchan, ctime, 1);
|
BKE_pose_where_is_bone(depsgraph, ikscene->blscene, ikscene->blArmature, pchan, ctime, true);
|
||||||
}
|
}
|
||||||
/* tell blender that this channel was controlled by IK,
|
/* tell blender that this channel was controlled by IK,
|
||||||
* it's cleared on each BKE_pose_where_is() */
|
* it's cleared on each BKE_pose_where_is() */
|
||||||
|
@ -1720,7 +1720,8 @@ static void execute_scene(struct Depsgraph *depsgraph,
|
||||||
/* in animation mode, we must get the bone position from action and constraints */
|
/* in animation mode, we must get the bone position from action and constraints */
|
||||||
for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ikchan++) {
|
for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ikchan++) {
|
||||||
if (!(ikchan->pchan->flag & POSE_DONE)) {
|
if (!(ikchan->pchan->flag & POSE_DONE)) {
|
||||||
BKE_pose_where_is_bone(depsgraph, blscene, ikscene->blArmature, ikchan->pchan, ctime, 1);
|
BKE_pose_where_is_bone(
|
||||||
|
depsgraph, blscene, ikscene->blArmature, ikchan->pchan, ctime, true);
|
||||||
}
|
}
|
||||||
/* tell blender that this channel was controlled by IK,
|
/* tell blender that this channel was controlled by IK,
|
||||||
* it's cleared on each BKE_pose_where_is() */
|
* it's cleared on each BKE_pose_where_is() */
|
||||||
|
|
|
@ -1918,7 +1918,7 @@ struct ImBuf *imb_load_openexr(const unsigned char *mem,
|
||||||
// printf("OpenEXR-load: image data window %d %d %d %d\n",
|
// printf("OpenEXR-load: image data window %d %d %d %d\n",
|
||||||
// dw.min.x, dw.min.y, dw.max.x, dw.max.y);
|
// dw.min.x, dw.min.y, dw.max.x, dw.max.y);
|
||||||
|
|
||||||
if (0) { /* debug */
|
if (false) { /* debug */
|
||||||
exr_print_filecontents(*file);
|
exr_print_filecontents(*file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ void AnimationImporter::read_node_transform(COLLADAFW::Node *node, Object *ob)
|
||||||
TransformReader::get_node_mat(mat, node, &uid_animated_map, ob);
|
TransformReader::get_node_mat(mat, node, &uid_animated_map, ob);
|
||||||
if (ob) {
|
if (ob) {
|
||||||
copy_m4_m4(ob->obmat, mat);
|
copy_m4_m4(ob->obmat, mat);
|
||||||
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
BKE_object_apply_mat4(ob, ob->obmat, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob,
|
||||||
}
|
}
|
||||||
/* calc new matrix and apply */
|
/* calc new matrix and apply */
|
||||||
mul_m4_m4m4(obn->obmat, obn->obmat, mat);
|
mul_m4_m4m4(obn->obmat, obn->obmat, mat);
|
||||||
BKE_object_apply_mat4(obn, obn->obmat, 0, 0);
|
BKE_object_apply_mat4(obn, obn->obmat, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -222,7 +222,7 @@ void SceneExporter::writeNode(Object *ob)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cti->flush_constraint_targets) {
|
if (cti->flush_constraint_targets) {
|
||||||
cti->flush_constraint_targets(con, &targets, 1);
|
cti->flush_constraint_targets(con, &targets, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,7 @@ void SkinInfo::link_armature(bContext *C,
|
||||||
DEG_id_tag_update(&obn->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
DEG_id_tag_update(&obn->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
|
||||||
#endif
|
#endif
|
||||||
copy_m4_m4(ob->obmat, bind_shape_matrix);
|
copy_m4_m4(ob->obmat, bind_shape_matrix);
|
||||||
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
BKE_object_apply_mat4(ob, ob->obmat, false, false);
|
||||||
|
|
||||||
amd->deformflag = ARM_DEF_VGROUP;
|
amd->deformflag = ARM_DEF_VGROUP;
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ void bc_match_scale(Object *ob, UnitConverter &bc_unit, bool scale_to_scene)
|
||||||
mul_m4_m4m4(ob->obmat, bc_unit.get_scale(), ob->obmat);
|
mul_m4_m4m4(ob->obmat, bc_unit.get_scale(), ob->obmat);
|
||||||
}
|
}
|
||||||
mul_m4_m4m4(ob->obmat, bc_unit.get_rotation(), ob->obmat);
|
mul_m4_m4m4(ob->obmat, bc_unit.get_rotation(), ob->obmat);
|
||||||
BKE_object_apply_mat4(ob, ob->obmat, 0, 0);
|
BKE_object_apply_mat4(ob, ob->obmat, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bc_match_scale(std::vector<Object *> *objects_done,
|
void bc_match_scale(std::vector<Object *> *objects_done,
|
||||||
|
|
|
@ -272,7 +272,7 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
|
||||||
/* Even when only asking an export of transforms, on the first frame everything should be
|
/* Even when only asking an export of transforms, on the first frame everything should be
|
||||||
* exported. */
|
* exported. */
|
||||||
{
|
{
|
||||||
ExportSubset export_subset = {0};
|
ExportSubset export_subset = {false};
|
||||||
export_subset.transforms = true;
|
export_subset.transforms = true;
|
||||||
export_subset.shapes = false;
|
export_subset.shapes = false;
|
||||||
iterator->set_export_subset(export_subset);
|
iterator->set_export_subset(export_subset);
|
||||||
|
@ -296,7 +296,7 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
|
||||||
|
|
||||||
/* Third iteration, should only write data now. */
|
/* Third iteration, should only write data now. */
|
||||||
{
|
{
|
||||||
ExportSubset export_subset = {0};
|
ExportSubset export_subset = {false};
|
||||||
export_subset.transforms = false;
|
export_subset.transforms = false;
|
||||||
export_subset.shapes = true;
|
export_subset.shapes = true;
|
||||||
iterator->set_export_subset(export_subset);
|
iterator->set_export_subset(export_subset);
|
||||||
|
@ -311,7 +311,7 @@ TEST_F(AbstractHierarchyIteratorTest, ExportSubsetTest)
|
||||||
|
|
||||||
/* Fourth iteration, should export everything now. */
|
/* Fourth iteration, should export everything now. */
|
||||||
{
|
{
|
||||||
ExportSubset export_subset = {0};
|
ExportSubset export_subset = {false};
|
||||||
export_subset.transforms = true;
|
export_subset.transforms = true;
|
||||||
export_subset.shapes = true;
|
export_subset.shapes = true;
|
||||||
iterator->set_export_subset(export_subset);
|
iterator->set_export_subset(export_subset);
|
||||||
|
|
Loading…
Reference in New Issue