[Bf-blender-cvs] [c9d5d311ec5] blender2.8: Cleanup: fix harmless compiler warnings.

Brecht Van Lommel noreply at git.blender.org
Fri Aug 17 13:03:22 CEST 2018


Commit: c9d5d311ec52fccee1a1948810633d120351d9ce
Author: Brecht Van Lommel
Date:   Thu Aug 16 17:10:17 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc9d5d311ec52fccee1a1948810633d120351d9ce

Cleanup: fix harmless compiler warnings.

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

M	source/blender/draw/engines/gpencil/gpencil_cache_utils.c
M	source/blender/editors/transform/transform_gizmo_3d.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index 4c427a672d2..8ae650a21eb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -102,7 +102,7 @@ tGPencilObjectCache *gpencil_object_cache_add(
 
 	cache_elem->is_dup_ob = gpencil_check_ob_duplicated(cache_array, *gp_cache_used, ob);
 
-	sprintf(cache_elem->ob_name, "%s", ob->id.name);
+	STRNCPY(cache_elem->ob_name, ob->id.name);
 	cache_elem->gpd = (bGPdata *)ob->data;
 
 	copy_v3_v3(cache_elem->loc, ob->loc);
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index f9908c5dbe6..03ed75d46a2 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -1354,7 +1354,7 @@ static void gizmogroup_init_properties_from_twtype(wmGizmoGroup *gzgroup)
 	{
 		const short axis_type = gizmo_get_axis_type(axis_idx, man->axis_type_default);
 		bool constraint_axis[3] = {1, 0, 0};
-		PointerRNA *ptr;
+		PointerRNA *ptr = NULL;
 
 		gizmo_get_axis_constraint(axis_idx, constraint_axis);
 
@@ -1455,14 +1455,14 @@ static void gizmogroup_init_properties_from_twtype(wmGizmoGroup *gzgroup)
 			}
 		}
 
-		{
+		if (ptr) {
 			PropertyRNA *prop;
 			if ((prop = RNA_struct_find_property(ptr, "constraint_axis"))) {
 				RNA_property_boolean_set_array(ptr, prop, constraint_axis);
 			}
-		}
 
-		RNA_boolean_set(ptr, "release_confirm", 1);
+			RNA_boolean_set(ptr, "release_confirm", 1);
+		}
 	}
 	MAN_ITER_AXES_END;
 }



More information about the Bf-blender-cvs mailing list