summaryrefslogtreecommitdiff
path: root/src/cairo-bentley-ottmann-rectangular.c
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2017-12-23 14:09:27 +0100
committerUli Schlachter <psychon@znc.in>2018-01-13 11:30:50 +0100
commitb7f313a8d2a3049e77b3497dd6040fcfab3b3c9b (patch)
treee1fa2d1311197e0f4c3e3815653cf1866ef1b7c5 /src/cairo-bentley-ottmann-rectangular.c
parent62f2037bc06a8eda1aa5ff66b45ce9e8bafe0a9c (diff)
downloadcairo-b7f313a8d2a3049e77b3497dd6040fcfab3b3c9b.tar.gz
fix warning: variable X might be clobbered by 'longjmp'
According to "man setjmp", one possible way to avoid variable clobbering is to declare them as volatile. Thus, this commit turns the variables that are changed between setjmp() and longjmp() and whose values are still needed after setjmp() returned the second time into volatile variables. The warning in cairo-bentley-ottmann-rectangular.c is worked around by not initializing the variable before setjmp(). To be honest, I don't understand why the compiler warns here at all since the value of update is clearly not used after setjmp()'s second return. This commit re-fixes the warnings that were reintroduced in commit 82f40285 which reverted b092b63. Signed-off-by: Uli Schlachter <psychon@znc.in> Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'src/cairo-bentley-ottmann-rectangular.c')
-rw-r--r--src/cairo-bentley-ottmann-rectangular.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cairo-bentley-ottmann-rectangular.c b/src/cairo-bentley-ottmann-rectangular.c
index 29f902c1a..65f95d797 100644
--- a/src/cairo-bentley-ottmann-rectangular.c
+++ b/src/cairo-bentley-ottmann-rectangular.c
@@ -603,7 +603,7 @@ _cairo_bentley_ottmann_tessellate_rectangular (rectangle_t **rectangles,
sweep_line_t sweep_line;
rectangle_t *rectangle;
cairo_status_t status;
- cairo_bool_t update = FALSE;
+ cairo_bool_t update;
sweep_line_init (&sweep_line,
rectangles, num_rectangles,
@@ -612,6 +612,8 @@ _cairo_bentley_ottmann_tessellate_rectangular (rectangle_t **rectangles,
if ((status = setjmp (sweep_line.unwind)))
return status;
+ update = FALSE;
+
rectangle = rectangle_pop_start (&sweep_line);
do {
if (rectangle->top != sweep_line.current_y) {