[Bf-blender-cvs] [7aeedf71b88] master: UI: quiet warning when drawing markers

Jacques Lucke noreply at git.blender.org
Sat Sep 14 16:55:08 CEST 2019


Commit: 7aeedf71b88b91d7bc857bdcc04a4845bb1bc794
Author: Jacques Lucke
Date:   Sat Sep 14 16:52:56 2019 +0200
Branches: master
https://developer.blender.org/rB7aeedf71b88b91d7bc857bdcc04a4845bb1bc794

UI: quiet warning when drawing markers

The compiler was warning that it assumed that
crfa - 4 < cfra is always true even though that might not
be the case due to overflow. This patch just removes
the condition that caused the assumption.

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

M	source/blender/editors/animation/anim_markers.c

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

diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 8c873eb6b45..2a35acdefcb 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -486,7 +486,7 @@ static void draw_marker(
   float name_y = UI_DPI_FAC * 18;
   /* Give an offset to the marker name when selected,
    * or when near the current frame (5 frames range, starting from the current one). */
-  if ((marker->flag & SELECT) || (IN_RANGE_INCL(marker->frame, cfra - 4, cfra))) {
+  if ((marker->flag & SELECT) || (cfra - 4 <= marker->frame && marker->frame <= cfra)) {
     name_y += UI_DPI_FAC * 10;
   }
   draw_marker_name(fstyle, marker, xpos, name_y);



More information about the Bf-blender-cvs mailing list