use BLI_strncpy and BLI_snprintf when the size of the string is known.
[blender.git] / source / blender / editors / armature / poseSlide.c
index 1688890..c28b688 100644 (file)
@@ -421,7 +421,7 @@ static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl)
                        sub_qt_qtqt(quat_diff, pchan->quat, quat_prev);
                        
                        /* make a copy of the original rotation */
-                       QUATCOPY(quat_orig, pchan->quat);
+                       copy_qt_qt(quat_orig, pchan->quat);
                        
                        /* increase the original by the delta transform, by an amount determined by percentage */
                        add_qt_qtqt(pchan->quat, quat_orig, quat_diff, pso->percentage);
@@ -436,7 +436,7 @@ static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl)
                                interp_qt_qtqt(quat_interp, quat_prev, quat_next, (cframe-pso->prevFrame) / (pso->nextFrame-pso->prevFrame) );
                                
                                /* make a copy of the original rotation */
-                               QUATCOPY(quat_orig, pchan->quat);
+                               copy_qt_qt(quat_orig, pchan->quat);
                                
                                /* tricky interpolations - blending between original and new */
                                interp_qt_qtqt(pchan->quat, quat_orig, quat_interp, 1.0f/6.0f);
@@ -523,28 +523,28 @@ static void pose_slide_reset (tPoseSlideOp *pso)
 /* draw percentage indicator in header */
 static void pose_slide_draw_status (tPoseSlideOp *pso)
 {
-       char statusStr[32];
-       char mode[32];
+       char status_str[32];
+       char mode_str[32];
        
        switch (pso->mode) {
                case POSESLIDE_PUSH:
-                       strcpy(mode, "Push Pose");
+                       strcpy(mode_str, "Push Pose");
                        break;
                case POSESLIDE_RELAX:
-                       strcpy(mode, "Relax Pose");
+                       strcpy(mode_str, "Relax Pose");
                        break;
                case POSESLIDE_BREAKDOWN:
-                       strcpy(mode, "Breakdown");
+                       strcpy(mode_str, "Breakdown");
                        break;
                
                default:
                        // unknown
-                       strcpy(mode, "Sliding-Tool");
+                       strcpy(mode_str, "Sliding-Tool");
                        break;
        }
        
-       sprintf(statusStr, "%s: %d %%", mode, (int)(pso->percentage*100.0f));
-       ED_area_headerprint(pso->sa, statusStr);
+       BLI_snprintf(status_str, sizeof(status_str), "%s: %d %%", mode_str, (int)(pso->percentage*100.0f));
+       ED_area_headerprint(pso->sa, status_str);
 }
 
 /* common code for invoke() methods */
@@ -600,7 +600,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
                }
        }
        else {
-               BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between.");
+               BKE_report(op->reports, RPT_ERROR, "No keyframes to slide between");
                pose_slide_exit(op);
                return OPERATOR_CANCELLED;
        }
@@ -718,8 +718,8 @@ static int pose_slide_exec_common (bContext *C, wmOperator *op, tPoseSlideOp *ps
 /* common code for defining RNA properties */
 static void pose_slide_opdef_properties (wmOperatorType *ot)
 {
-       RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame.", 0, 50);
-       RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame.", 0, 50);
+       RNA_def_int(ot->srna, "prev_frame", 0, MINAFRAME, MAXFRAME, "Previous Keyframe", "Frame number of keyframe immediately before the current frame", 0, 50);
+       RNA_def_int(ot->srna, "next_frame", 0, MINAFRAME, MAXFRAME, "Next Keyframe", "Frame number of keyframe immediately after the current frame", 0, 50);
        RNA_def_float_percentage(ot->srna, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Weighting factor for the sliding operation", 0.3, 0.7);
 }