diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-25 13:23:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-25 13:23:11 +0300 |
commit | c64e9c6ae239adf0be09599cd9ea56522d43a42b (patch) | |
tree | 63e6dda91e89dd3bdc127e603b097f9d1c312022 /source/blender/makesrna/intern/rna_constraint.c | |
parent | 4949dd54eb4576442050690f44b2c6ec7366e011 (diff) |
Cleanup: Add more const'ness to RNA API.
This commit makes PointerRNA passed to RNA path API const.
Main change was in the `path` callback for RNA structs, and indirectly
the `getlength` callback of properties.
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 63d8876ec8b..8829c655030 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -440,7 +440,7 @@ static char *rna_Constraint_do_compute_path(Object *ob, bConstraint *con) } } -static char *rna_Constraint_path(PointerRNA *ptr) +static char *rna_Constraint_path(const PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; bConstraint *con = ptr->data; @@ -448,7 +448,7 @@ static char *rna_Constraint_path(PointerRNA *ptr) return rna_Constraint_do_compute_path(ob, con); } -static bConstraint *rna_constraint_from_target(PointerRNA *ptr) +static bConstraint *rna_constraint_from_target(const PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; bConstraintTarget *tgt = ptr->data; @@ -456,7 +456,7 @@ static bConstraint *rna_constraint_from_target(PointerRNA *ptr) return BKE_constraint_find_from_target(ob, tgt, NULL); } -static char *rna_ConstraintTarget_path(PointerRNA *ptr) +static char *rna_ConstraintTarget_path(const PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; bConstraintTarget *tgt = ptr->data; @@ -691,11 +691,11 @@ static void rna_ActionConstraint_minmax_range( } } -static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, +static int rna_SplineIKConstraint_joint_bindings_get_length(const PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { - bConstraint *con = (bConstraint *)ptr->data; - bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; + const bConstraint *con = (bConstraint *)ptr->data; + const bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; if (ikData) { length[0] = ikData->numpoints; |