Cleanup: redundant casts
This commit is contained in:
@@ -373,7 +373,7 @@ FCurve *rna_get_fcurve_context_ui(bContext *C,
|
|||||||
|
|
||||||
/* Special case for NLA Control Curves... */
|
/* Special case for NLA Control Curves... */
|
||||||
if (BKE_nlastrip_has_curves_for_property(ptr, prop)) {
|
if (BKE_nlastrip_has_curves_for_property(ptr, prop)) {
|
||||||
NlaStrip *strip = (NlaStrip *)ptr->data;
|
NlaStrip *strip = ptr->data;
|
||||||
|
|
||||||
/* Set the special flag, since it cannot be a normal action/driver
|
/* Set the special flag, since it cannot be a normal action/driver
|
||||||
* if we've been told to start looking here...
|
* if we've been told to start looking here...
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ FCurve *verify_fcurve(Main *bmain,
|
|||||||
/* sync bone group colors if applicable */
|
/* sync bone group colors if applicable */
|
||||||
if (ptr && (ptr->type == &RNA_PoseBone)) {
|
if (ptr && (ptr->type == &RNA_PoseBone)) {
|
||||||
Object *ob = (Object *)ptr->owner_id;
|
Object *ob = (Object *)ptr->owner_id;
|
||||||
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
|
bPoseChannel *pchan = ptr->data;
|
||||||
bPose *pose = ob->pose;
|
bPose *pose = ob->pose;
|
||||||
bActionGroup *grp;
|
bActionGroup *grp;
|
||||||
|
|
||||||
@@ -821,7 +821,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
|
|||||||
*/
|
*/
|
||||||
if (ptr->type == &RNA_Object) {
|
if (ptr->type == &RNA_Object) {
|
||||||
/* Object */
|
/* Object */
|
||||||
Object *ob = (Object *)ptr->data;
|
Object *ob = ptr->data;
|
||||||
RigidBodyOb *rbo = ob->rigidbody_object;
|
RigidBodyOb *rbo = ob->rigidbody_object;
|
||||||
|
|
||||||
con = ob->constraints.first;
|
con = ob->constraints.first;
|
||||||
@@ -833,7 +833,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
|
|||||||
}
|
}
|
||||||
else if (ptr->type == &RNA_PoseBone) {
|
else if (ptr->type == &RNA_PoseBone) {
|
||||||
/* Pose Channel */
|
/* Pose Channel */
|
||||||
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
|
bPoseChannel *pchan = ptr->data;
|
||||||
|
|
||||||
con = pchan->constraints.first;
|
con = pchan->constraints.first;
|
||||||
identifier = RNA_property_identifier(prop);
|
identifier = RNA_property_identifier(prop);
|
||||||
@@ -983,7 +983,7 @@ static float *visualkey_get_values(
|
|||||||
* - assume that array_index will be sane
|
* - assume that array_index will be sane
|
||||||
*/
|
*/
|
||||||
if (ptr->type == &RNA_Object) {
|
if (ptr->type == &RNA_Object) {
|
||||||
Object *ob = (Object *)ptr->data;
|
Object *ob = ptr->data;
|
||||||
/* Loc code is specific... */
|
/* Loc code is specific... */
|
||||||
if (strstr(identifier, "location")) {
|
if (strstr(identifier, "location")) {
|
||||||
copy_v3_v3(buffer, ob->obmat[3]);
|
copy_v3_v3(buffer, ob->obmat[3]);
|
||||||
@@ -995,7 +995,7 @@ static float *visualkey_get_values(
|
|||||||
rotmode = ob->rotmode;
|
rotmode = ob->rotmode;
|
||||||
}
|
}
|
||||||
else if (ptr->type == &RNA_PoseBone) {
|
else if (ptr->type == &RNA_PoseBone) {
|
||||||
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
|
bPoseChannel *pchan = ptr->data;
|
||||||
|
|
||||||
BKE_armature_mat_pose_to_bone(pchan, pchan->pose_mat, tmat);
|
BKE_armature_mat_pose_to_bone(pchan, pchan->pose_mat, tmat);
|
||||||
rotmode = pchan->rotmode;
|
rotmode = pchan->rotmode;
|
||||||
@@ -2375,7 +2375,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
* strips themselves. These are stored separately or else the properties will
|
* strips themselves. These are stored separately or else the properties will
|
||||||
* not have any effect.
|
* not have any effect.
|
||||||
*/
|
*/
|
||||||
NlaStrip *strip = (NlaStrip *)ptr.data;
|
NlaStrip *strip = ptr.data;
|
||||||
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
||||||
|
|
||||||
if (fcu) {
|
if (fcu) {
|
||||||
@@ -2416,7 +2416,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
* TODO: Perhaps we can extend this behavior in future for other properties...
|
* TODO: Perhaps we can extend this behavior in future for other properties...
|
||||||
*/
|
*/
|
||||||
if (ptr.type == &RNA_PoseBone) {
|
if (ptr.type == &RNA_PoseBone) {
|
||||||
bPoseChannel *pchan = (bPoseChannel *)ptr.data;
|
bPoseChannel *pchan = ptr.data;
|
||||||
group = pchan->name;
|
group = pchan->name;
|
||||||
}
|
}
|
||||||
else if ((ptr.type == &RNA_Object) &&
|
else if ((ptr.type == &RNA_Object) &&
|
||||||
@@ -2467,7 +2467,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
RPT_WARNING,
|
RPT_WARNING,
|
||||||
"Button doesn't appear to have any property information attached (ptr.data = "
|
"Button doesn't appear to have any property information attached (ptr.data = "
|
||||||
"%p, prop = %p)",
|
"%p, prop = %p)",
|
||||||
(void *)ptr.data,
|
ptr.data,
|
||||||
(void *)prop);
|
(void *)prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2535,7 +2535,7 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
* not have any effect.
|
* not have any effect.
|
||||||
*/
|
*/
|
||||||
ID *id = ptr.owner_id;
|
ID *id = ptr.owner_id;
|
||||||
NlaStrip *strip = (NlaStrip *)ptr.data;
|
NlaStrip *strip = ptr.data;
|
||||||
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), 0);
|
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), 0);
|
||||||
|
|
||||||
if (fcu) {
|
if (fcu) {
|
||||||
@@ -2586,7 +2586,7 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G.debug & G_DEBUG) {
|
else if (G.debug & G_DEBUG) {
|
||||||
printf("ptr.data = %p, prop = %p\n", (void *)ptr.data, (void *)prop);
|
printf("ptr.data = %p, prop = %p\n", ptr.data, (void *)prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -2653,7 +2653,7 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G.debug & G_DEBUG) {
|
else if (G.debug & G_DEBUG) {
|
||||||
printf("ptr.data = %p, prop = %p\n", (void *)ptr.data, (void *)prop);
|
printf("ptr.data = %p, prop = %p\n", ptr.data, (void *)prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|||||||
@@ -534,7 +534,7 @@ static void ui_item_array(uiLayout *layout,
|
|||||||
buth = unit;
|
buth = unit;
|
||||||
|
|
||||||
if (ptr->type == &RNA_Armature) {
|
if (ptr->type == &RNA_Armature) {
|
||||||
bArmature *arm = (bArmature *)ptr->data;
|
bArmature *arm = ptr->data;
|
||||||
|
|
||||||
layer_used = arm->layer_used;
|
layer_used = arm->layer_used;
|
||||||
|
|
||||||
|
|||||||
@@ -2260,7 +2260,7 @@ static int make_local_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
matarar = (Material ***)BKE_object_material_array_p(ob);
|
matarar = BKE_object_material_array_p(ob);
|
||||||
if (matarar) {
|
if (matarar) {
|
||||||
for (a = 0; a < ob->totcol; a++) {
|
for (a = 0; a < ob->totcol; a++) {
|
||||||
ma = (*matarar)[a];
|
ma = (*matarar)[a];
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ static int action_new_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
* or else the user gets decremented twice!
|
* or else the user gets decremented twice!
|
||||||
*/
|
*/
|
||||||
if (ptr.type == &RNA_SpaceDopeSheetEditor) {
|
if (ptr.type == &RNA_SpaceDopeSheetEditor) {
|
||||||
SpaceAction *saction = (SpaceAction *)ptr.data;
|
SpaceAction *saction = ptr.data;
|
||||||
saction->action = NULL;
|
saction->action = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1233,7 +1233,7 @@ ID *buttons_context_id_path(const bContext *C)
|
|||||||
/* pin particle settings instead of system, since only settings are an idblock*/
|
/* pin particle settings instead of system, since only settings are an idblock*/
|
||||||
if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
|
if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
|
||||||
if (ptr->type == &RNA_ParticleSystem && ptr->data) {
|
if (ptr->type == &RNA_ParticleSystem && ptr->data) {
|
||||||
ParticleSystem *psys = (ParticleSystem *)ptr->data;
|
ParticleSystem *psys = ptr->data;
|
||||||
return &psys->part->id;
|
return &psys->part->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3476,7 +3476,7 @@ static int graph_driver_vars_copy_exec(bContext *C, wmOperator *op)
|
|||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "active_editable_fcurve", &RNA_FCurve);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "active_editable_fcurve", &RNA_FCurve);
|
||||||
|
|
||||||
/* if this exists, call the copy driver vars API function */
|
/* if this exists, call the copy driver vars API function */
|
||||||
FCurve *fcu = (FCurve *)ptr.data;
|
FCurve *fcu = ptr.data;
|
||||||
|
|
||||||
if (fcu) {
|
if (fcu) {
|
||||||
ok = ANIM_driver_vars_copy(op->reports, fcu);
|
ok = ANIM_driver_vars_copy(op->reports, fcu);
|
||||||
@@ -3516,7 +3516,7 @@ static int graph_driver_vars_paste_exec(bContext *C, wmOperator *op)
|
|||||||
PointerRNA ptr = CTX_data_pointer_get_type(C, "active_editable_fcurve", &RNA_FCurve);
|
PointerRNA ptr = CTX_data_pointer_get_type(C, "active_editable_fcurve", &RNA_FCurve);
|
||||||
|
|
||||||
/* if this exists, call the paste driver vars API function */
|
/* if this exists, call the paste driver vars API function */
|
||||||
FCurve *fcu = (FCurve *)ptr.data;
|
FCurve *fcu = ptr.data;
|
||||||
|
|
||||||
if (fcu) {
|
if (fcu) {
|
||||||
ok = ANIM_driver_vars_paste(op->reports, fcu, replace);
|
ok = ANIM_driver_vars_paste(op->reports, fcu, replace);
|
||||||
|
|||||||
@@ -1791,7 +1791,7 @@ static void tree_element_to_path(TreeElement *te,
|
|||||||
/* ptr->data not ptr->owner_id seems to be the one we want,
|
/* ptr->data not ptr->owner_id seems to be the one we want,
|
||||||
* since ptr->data is sometimes the owner of this ID? */
|
* since ptr->data is sometimes the owner of this ID? */
|
||||||
if (RNA_struct_is_ID(ptr->type)) {
|
if (RNA_struct_is_ID(ptr->type)) {
|
||||||
*id = (ID *)ptr->data;
|
*id = ptr->data;
|
||||||
|
|
||||||
/* clear path */
|
/* clear path */
|
||||||
if (*path) {
|
if (*path) {
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (prop) {
|
if (prop) {
|
||||||
NlaStrip *strip = (NlaStrip *)ptr.data;
|
NlaStrip *strip = ptr.data;
|
||||||
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
||||||
|
|
||||||
result = insert_keyframe_direct(&reports, ptr, prop, fcu, cfra, keytype, NULL, options);
|
result = insert_keyframe_direct(&reports, ptr, prop, fcu, cfra, keytype, NULL, options);
|
||||||
@@ -452,7 +452,7 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb
|
|||||||
|
|
||||||
if (prop) {
|
if (prop) {
|
||||||
ID *id = ptr.owner_id;
|
ID *id = ptr.owner_id;
|
||||||
NlaStrip *strip = (NlaStrip *)ptr.data;
|
NlaStrip *strip = ptr.data;
|
||||||
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
||||||
|
|
||||||
/* NOTE: This should be true, or else we wouldn't be able to get here. */
|
/* NOTE: This should be true, or else we wouldn't be able to get here. */
|
||||||
|
|||||||
Reference in New Issue
Block a user