Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-11-06 19:49:09 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-11-06 20:08:25 +0300
commit16732def37c5a66f3ea28dbe247b09cc6bca6677 (patch)
tree5d14f5c920a1411e336bd80b12becbb3f73de19a /source/blender/ikplugin
parent88926375a0e4e45f72c87b9e487c060ddd3c9216 (diff)
Cleanup: Clang-Tidy modernize-use-nullptr
Replace `NULL` with `nullptr` in C++ code. No functional changes.
Diffstat (limited to 'source/blender/ikplugin')
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index fd671fabc1b..61f2153cf6c 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -101,13 +101,13 @@ struct IK_Target {
IK_Target()
{
- bldepsgraph = NULL;
- blscene = NULL;
- target = NULL;
- constraint = NULL;
- blenderConstraint = NULL;
- rootChannel = NULL;
- owner = NULL;
+ bldepsgraph = nullptr;
+ blscene = nullptr;
+ target = nullptr;
+ constraint = nullptr;
+ blenderConstraint = nullptr;
+ rootChannel = nullptr;
+ owner = nullptr;
controlType = 0;
channel = 0;
ee = 0;
@@ -138,12 +138,12 @@ struct IK_Channel {
IK_Channel()
{
- pchan = NULL;
+ pchan = nullptr;
parent = -1;
jointType = 0;
ndof = 0;
jointValid = 0;
- owner = NULL;
+ owner = nullptr;
jointValue[0] = 0.0;
jointValue[1] = 0.0;
jointValue[2] = 0.0;
@@ -174,20 +174,20 @@ struct IK_Scene {
IK_Scene()
{
- bldepsgraph = NULL;
- blscene = NULL;
- next = NULL;
- channels = NULL;
- armature = NULL;
- cache = NULL;
- scene = NULL;
- base = NULL;
- solver = NULL;
+ bldepsgraph = nullptr;
+ blscene = nullptr;
+ next = nullptr;
+ channels = nullptr;
+ armature = nullptr;
+ cache = nullptr;
+ scene = nullptr;
+ base = nullptr;
+ solver = nullptr;
blScale = blInvScale = 1.0f;
- blArmature = NULL;
+ blArmature = nullptr;
numchan = 0;
numjoint = 0;
- polarConstraint = NULL;
+ polarConstraint = nullptr;
}
~IK_Scene()
@@ -228,7 +228,7 @@ enum IK_SegmentAxis {
static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *con)
{
- bPoseChannel *curchan, *pchan_root = NULL, *chanlist[256], **oldchan;
+ bPoseChannel *curchan, *pchan_root = nullptr, *chanlist[256], **oldchan;
PoseTree *tree;
PoseTarget *target;
bKinematicConstraint *data;
@@ -290,7 +290,7 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co
* and each channel can be part of at most one tree. */
tree = (PoseTree *)pchan_root->iktree.first;
- if (tree == NULL) {
+ if (tree == nullptr) {
/* make new tree */
tree = (PoseTree *)MEM_callocN(sizeof(PoseTree), "posetree");
@@ -398,7 +398,7 @@ static bool constraint_valid(bConstraint *con)
}
if (is_cartesian_constraint(con)) {
/* cartesian space constraint */
- if (data->tar == NULL) {
+ if (data->tar == nullptr) {
return false;
}
if (data->tar->type == OB_ARMATURE && data->subtarget[0] == 0) {
@@ -1163,7 +1163,7 @@ static IK_Scene *convert_tree(
float start[3];
if (tree->totchannel == 0) {
- return NULL;
+ return nullptr;
}
ikscene = new IK_Scene;
@@ -1196,7 +1196,7 @@ static IK_Scene *convert_tree(
break;
default:
delete ikscene;
- return NULL;
+ return nullptr;
}
ikscene->blArmature = ob;
/* assume uniform scaling and take Y scale as general scale for the armature */
@@ -1438,10 +1438,10 @@ static IK_Scene *convert_tree(
}
if (!ret) {
delete ikscene;
- return NULL;
+ return nullptr;
}
/* for each target, we need to add an end effector in the armature */
- for (numtarget = 0, polarcon = NULL, ret = true, target = (PoseTarget *)tree->targets.first;
+ for (numtarget = 0, polarcon = nullptr, ret = true, target = (PoseTarget *)tree->targets.first;
target;
target = (PoseTarget *)target->next) {
condata = (bKinematicConstraint *)target->con->data;
@@ -1496,7 +1496,7 @@ static IK_Scene *convert_tree(
}
if (!ret) {
delete ikscene;
- return NULL;
+ return nullptr;
}
/* set the weight */
e_matrix &Wq = arm->getWq();
@@ -1638,7 +1638,7 @@ static IK_Scene *convert_tree(
if (!ret || !scene->addCache(ikscene->cache) || !scene->addSolver(ikscene->solver) ||
!scene->initialize()) {
delete ikscene;
- ikscene = NULL;
+ ikscene = nullptr;
}
return ikscene;
}
@@ -1688,7 +1688,7 @@ static int init_scene(Object *ob)
IK_Scene *scene;
if (ob->pose->ikdata) {
- for (scene = ((IK_Data *)ob->pose->ikdata)->first; scene != NULL; scene = scene->next) {
+ for (scene = ((IK_Data *)ob->pose->ikdata)->first; scene != nullptr; scene = scene->next) {
if (fabs(scene->blScale - scale) > KDL::epsilon) {
return 1;
}
@@ -1768,7 +1768,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
if (ikscene->cache && !reiterate && simulation) {
iTaSC::CacheTS sts, cts;
sts = cts = (iTaSC::CacheTS)std::round(timestamp * 1000.0);
- if (ikscene->cache->getPreviousCacheItem(ikscene->armature, 0, &cts) == NULL || cts == 0) {
+ if (ikscene->cache->getPreviousCacheItem(ikscene->armature, 0, &cts) == nullptr || cts == 0) {
/* the cache is empty before this time, reiterate */
if (ikparam->flag & ITASC_INITIAL_REITERATION) {
reiterate = true;
@@ -1887,7 +1887,7 @@ void itasc_initialize_tree(struct Depsgraph *depsgraph,
bPoseChannel *pchan;
int count = 0;
- if (ob->pose->ikdata != NULL && !(ob->pose->flag & POSE_WAS_REBUILT)) {
+ if (ob->pose->ikdata != nullptr && !(ob->pose->flag & POSE_WAS_REBUILT)) {
if (!init_scene(ob)) {
return;
}
@@ -1950,7 +1950,7 @@ void itasc_clear_data(struct bPose *pose)
delete scene;
}
MEM_freeN(ikdata);
- pose->ikdata = NULL;
+ pose->ikdata = nullptr;
}
}
@@ -1961,7 +1961,7 @@ void itasc_clear_cache(struct bPose *pose)
for (IK_Scene *scene = ikdata->first; scene; scene = scene->next) {
if (scene->cache) {
/* clear all cache but leaving the timestamp 0 (=rest pose) */
- scene->cache->clearCacheFrom(NULL, 1);
+ scene->cache->clearCacheFrom(nullptr, 1);
}
}
}
@@ -2001,7 +2001,7 @@ void itasc_test_constraint(struct Object *ob, struct bConstraint *cons)
struct bKinematicConstraint *data = (struct bKinematicConstraint *)cons->data;
/* only for IK constraint */
- if (cons->type != CONSTRAINT_TYPE_KINEMATIC || data == NULL) {
+ if (cons->type != CONSTRAINT_TYPE_KINEMATIC || data == nullptr) {
return;
}