Cleanup: fix harmless compiler warnings.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 16 Aug 2018 15:10:17 +0000 (17:10 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Fri, 17 Aug 2018 11:00:31 +0000 (13:00 +0200)
source/blender/draw/engines/gpencil/gpencil_cache_utils.c
source/blender/editors/transform/transform_gizmo_3d.c

index 4c427a672d28a65741576c99516152992da2719c..8ae650a21eb407028ac733f4f468eb2fac151615 100644 (file)
@@ -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);
index f9908c5dbe65490fe2ec0940901d1e680faf68e5..03ed75d46a2ccda030182a0acd23ff332a722135 100644 (file)
@@ -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;
 }