[Bf-blender-cvs] [0f2efce6c50] master: Cleanup: remove bad casts

Campbell Barton noreply at git.blender.org
Sun Apr 15 11:58:50 CEST 2018


Commit: 0f2efce6c50718d7745a6dc1613acf62a186cc05
Author: Campbell Barton
Date:   Sun Apr 15 11:57:49 2018 +0200
Branches: master
https://developer.blender.org/rB0f2efce6c50718d7745a6dc1613acf62a186cc05

Cleanup: remove bad casts

===================================================================

M	source/blender/collada/ArmatureImporter.cpp
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/include/ED_armature.h
M	source/blenderplayer/bad_level_call_stubs/stubs.c

===================================================================

diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index 7727eea793c..c32a2a7034e 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -102,7 +102,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBon
 	it = std::find(finished_joints.begin(), finished_joints.end(), node);
 	if (it != finished_joints.end()) return chain_length;
 	
-	EditBone *bone = ED_armature_ebone_add(arm, (char *)bc_get_joint_name(node));
+	EditBone *bone = ED_armature_ebone_add(arm, bc_get_joint_name(node));
 	totbone++;
 
 	/*
@@ -634,8 +634,8 @@ Object *ArmatureImporter::create_armature_bones(SkinInfo& skin)
 }
 
 void ArmatureImporter::set_pose(Object *ob_arm,  COLLADAFW::Node *root_node, const char *parentname, float parent_mat[4][4])
-{ 
-	char *bone_name = (char *) bc_get_joint_name(root_node);
+{
+	const char *bone_name = bc_get_joint_name(root_node);
 	float mat[4][4];
 	float obmat[4][4];
 
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 3879d67964c..ccbb2e95fc1 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -205,7 +205,7 @@ void ED_armature_origin_set(Scene *scene, Object *ob, float cursor[3], int cente
 /* adjust bone roll to align Z axis with vector
  * vec is in local space and is normalized
  */
-float ED_armature_ebone_roll_to_vector(EditBone *bone, const float align_axis[3], const bool axis_only)
+float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float align_axis[3], const bool axis_only)
 {
 	float mat[3][3], nor[3];
 	float vec[3], align_axis_proj[3], roll = 0.0f;
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index fbaa65211e6..567e477ec6c 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -140,7 +140,7 @@ bool ED_armature_edit_select_pick(
         struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle);
 int join_armature_exec(struct bContext *C, struct wmOperator *op);
 struct Bone *ED_armature_bone_find_index(struct Object *ob, int index);
-float ED_armature_ebone_roll_to_vector(EditBone *bone, const float new_up_axis[3], const bool axis_only);
+float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float new_up_axis[3], const bool axis_only);
 EditBone *ED_armature_ebone_find_name(const struct ListBase *edbo, const char *name);
 EditBone *ED_armature_ebone_get_mirrored(const struct ListBase *edbo, EditBone *ebo);
 void ED_armature_edit_sync_selection(struct ListBase *edbo);
diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c
index 14fc2366232..8dba71a54c3 100644
--- a/source/blenderplayer/bad_level_call_stubs/stubs.c
+++ b/source/blenderplayer/bad_level_call_stubs/stubs.c
@@ -530,7 +530,7 @@ float ED_vgroup_vert_weight(struct Object *ob, struct bDeformGroup *dg, int vert
 int ED_mesh_mirror_topo_table(struct Object *ob, struct DerivedMesh *dm, char mode) RET_ZERO
 int ED_mesh_mirror_spatial_table(struct Object *ob, struct BMEditMesh *em, struct DerivedMesh *dm, const float co[3], char mode) RET_ZERO
 
-float ED_armature_ebone_roll_to_vector(EditBone *bone, const float new_up_axis[3], const bool axis_only) RET_ZERO
+float ED_armature_ebone_roll_to_vector(const EditBone *bone, const float new_up_axis[3], const bool axis_only) RET_ZERO
 void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height) RET_NONE
 bool ED_space_image_check_show_maskedit(struct Scene *scene, struct SpaceImage *sima) RET_ZERO



More information about the Bf-blender-cvs mailing list