summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-10-30 15:30:09 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-11-04 13:06:53 +0100
commit92a4fab5d79f69dfea118f65f494bb014117b4f2 (patch)
tree8c74926dd3e71d4a0c1df0014ff5dd7ebf197161
parentf47b9277453edb1a3b4b68171d99f5b841e52e19 (diff)
efl_canvas_animation: be more explicit with errors
Summary: with this commit invalid values are not accepted silently anymore. But rather a error will be raised. Depends on D10350 Reviewers: segfaultxavi, Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8288 Differential Revision: https://phab.enlightenment.org/D10558
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation.c10
-rw-r--r--src/lib/evas/canvas/efl_canvas_animation_types.eot3
2 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_animation.c b/src/lib/evas/canvas/efl_canvas_animation.c
index b8c7c99861..119384b5eb 100644
--- a/src/lib/evas/canvas/efl_canvas_animation.c
+++ b/src/lib/evas/canvas/efl_canvas_animation.c
@@ -38,9 +38,8 @@ _efl_canvas_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
38 Efl_Canvas_Animation_Data *pd, 38 Efl_Canvas_Animation_Data *pd,
39 Efl_Canvas_Animation_Repeat_Mode mode) 39 Efl_Canvas_Animation_Repeat_Mode mode)
40{ 40{
41 if ((mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_RESTART) || 41 EINA_SAFETY_ON_FALSE_RETURN(mode >= 0 && mode < EFL_CANVAS_ANIMATION_REPEAT_MODE_LAST);
42 (mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)) 42 pd->repeat_mode = mode;
43 pd->repeat_mode = mode;
44} 43}
45 44
46EOLIAN static Efl_Canvas_Animation_Repeat_Mode 45EOLIAN static Efl_Canvas_Animation_Repeat_Mode
@@ -54,8 +53,7 @@ _efl_canvas_animation_repeat_count_set(Eo *eo_obj EINA_UNUSED,
54 Efl_Canvas_Animation_Data *pd, 53 Efl_Canvas_Animation_Data *pd,
55 int count) 54 int count)
56{ 55{
57 //EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely 56 EINA_SAFETY_ON_FALSE_RETURN(count >= EFL_ANIMATION_REPEAT_INFINITE);
58 if ((count < 0) && (count != EFL_ANIMATION_REPEAT_INFINITE)) return;
59 57
60 pd->repeat_count = count; 58 pd->repeat_count = count;
61} 59}
@@ -71,7 +69,7 @@ _efl_canvas_animation_start_delay_set(Eo *eo_obj EINA_UNUSED,
71 Efl_Canvas_Animation_Data *pd, 69 Efl_Canvas_Animation_Data *pd,
72 double sec) 70 double sec)
73{ 71{
74 if (sec < 0.0) return; 72 EINA_SAFETY_ON_FALSE_RETURN(sec < 0.0);
75 73
76 pd->start_delay_time = sec; 74 pd->start_delay_time = sec;
77} 75}
diff --git a/src/lib/evas/canvas/efl_canvas_animation_types.eot b/src/lib/evas/canvas/efl_canvas_animation_types.eot
index 23e89aef0d..cfdda2d490 100644
--- a/src/lib/evas/canvas/efl_canvas_animation_types.eot
+++ b/src/lib/evas/canvas/efl_canvas_animation_types.eot
@@ -8,5 +8,6 @@ enum @beta Efl.Canvas.Animation_Repeat_Mode
8 [[Animation repeat mode]] 8 [[Animation repeat mode]]
9 9
10 restart = 0, [[Restart animation when the animation ends.]] 10 restart = 0, [[Restart animation when the animation ends.]]
11 reverse [[Reverse animation when the animation ends.]] 11 reverse = 1, [[Reverse animation when the animation ends.]]
12 last
12} 13}