Cleanup: redundant casts
This commit is contained in:
parent
2fb4de1f8c
commit
1da8ed2a97
@ -373,7 +373,7 @@ FCurve *rna_get_fcurve_context_ui(bContext *C,
|
||||
|
||||
/* Special case for NLA Control Curves... */
|
||||
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
|
||||
* if we've been told to start looking here...
|
||||
|
@ -223,7 +223,7 @@ FCurve *verify_fcurve(Main *bmain,
|
||||
/* sync bone group colors if applicable */
|
||||
if (ptr && (ptr->type == &RNA_PoseBone)) {
|
||||
Object *ob = (Object *)ptr->owner_id;
|
||||
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
|
||||
bPoseChannel *pchan = ptr->data;
|
||||
bPose *pose = ob->pose;
|
||||
bActionGroup *grp;
|
||||
|
||||
@ -821,7 +821,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
|
||||
*/
|
||||
if (ptr->type == &RNA_Object) {
|
||||
/* Object */
|
||||
Object *ob = (Object *)ptr->data;
|
||||
Object *ob = ptr->data;
|
||||
RigidBodyOb *rbo = ob->rigidbody_object;
|
||||
|
||||
con = ob->constraints.first;
|
||||
@ -833,7 +833,7 @@ static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
|
||||
}
|
||||
else if (ptr->type == &RNA_PoseBone) {
|
||||
/* Pose Channel */
|
||||
bPoseChannel *pchan = (bPoseChannel *)ptr->data;
|
||||
bPoseChannel *pchan = ptr->data;
|
||||
|
||||
con = pchan->constraints.first;
|
||||
identifier = RNA_property_identifier(prop);
|
||||
@ -983,7 +983,7 @@ static float *visualkey_get_values(
|
||||
* - assume that array_index will be sane
|
||||
*/
|
||||
if (ptr->type == &RNA_Object) {
|
||||
Object *ob = (Object *)ptr->data;
|
||||
Object *ob = ptr->data;
|
||||
/* Loc code is specific... */
|
||||
if (strstr(identifier, "location")) {
|
||||
copy_v3_v3(buffer, ob->obmat[3]);
|
||||
@ -995,7 +995,7 @@ static float *visualkey_get_values(
|
||||
rotmode = ob->rotmode;
|
||||
}
|
||||
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);
|
||||
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
|
||||
* 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);
|
||||
|
||||
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...
|
||||
*/
|
||||
if (ptr.type == &RNA_PoseBone) {
|
||||
bPoseChannel *pchan = (bPoseChannel *)ptr.data;
|
||||
bPoseChannel *pchan = ptr.data;
|
||||
group = pchan->name;
|
||||
}
|
||||
else if ((ptr.type == &RNA_Object) &&
|
||||
@ -2467,7 +2467,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
|
||||
RPT_WARNING,
|
||||
"Button doesn't appear to have any property information attached (ptr.data = "
|
||||
"%p, prop = %p)",
|
||||
(void *)ptr.data,
|
||||
ptr.data,
|
||||
(void *)prop);
|
||||
}
|
||||
}
|
||||
@ -2535,7 +2535,7 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
|
||||
* not have any effect.
|
||||
*/
|
||||
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);
|
||||
|
||||
if (fcu) {
|
||||
@ -2586,7 +2586,7 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
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) {
|
||||
@ -2653,7 +2653,7 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
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) {
|
||||
|
@ -534,7 +534,7 @@ static void ui_item_array(uiLayout *layout,
|
||||
buth = unit;
|
||||
|
||||
if (ptr->type == &RNA_Armature) {
|
||||
bArmature *arm = (bArmature *)ptr->data;
|
||||
bArmature *arm = ptr->data;
|
||||
|
||||
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) {
|
||||
for (a = 0; a < ob->totcol; 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!
|
||||
*/
|
||||
if (ptr.type == &RNA_SpaceDopeSheetEditor) {
|
||||
SpaceAction *saction = (SpaceAction *)ptr.data;
|
||||
SpaceAction *saction = ptr.data;
|
||||
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*/
|
||||
if (sbuts->mainb == BCONTEXT_PARTICLE && sbuts->flag & SB_PIN_CONTEXT) {
|
||||
if (ptr->type == &RNA_ParticleSystem && ptr->data) {
|
||||
ParticleSystem *psys = (ParticleSystem *)ptr->data;
|
||||
ParticleSystem *psys = ptr->data;
|
||||
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);
|
||||
|
||||
/* if this exists, call the copy driver vars API function */
|
||||
FCurve *fcu = (FCurve *)ptr.data;
|
||||
FCurve *fcu = ptr.data;
|
||||
|
||||
if (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);
|
||||
|
||||
/* if this exists, call the paste driver vars API function */
|
||||
FCurve *fcu = (FCurve *)ptr.data;
|
||||
FCurve *fcu = ptr.data;
|
||||
|
||||
if (fcu) {
|
||||
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,
|
||||
* since ptr->data is sometimes the owner of this ID? */
|
||||
if (RNA_struct_is_ID(ptr->type)) {
|
||||
*id = (ID *)ptr->data;
|
||||
*id = ptr->data;
|
||||
|
||||
/* clear path */
|
||||
if (*path) {
|
||||
|
@ -353,7 +353,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
|
||||
}
|
||||
|
||||
if (prop) {
|
||||
NlaStrip *strip = (NlaStrip *)ptr.data;
|
||||
NlaStrip *strip = ptr.data;
|
||||
FCurve *fcu = list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), index);
|
||||
|
||||
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) {
|
||||
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);
|
||||
|
||||
/* NOTE: This should be true, or else we wouldn't be able to get here. */
|
||||
|
Loading…
Reference in New Issue
Block a user