diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-12-23 11:24:34 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-12-23 11:24:34 +0800 |
commit | ecd6b0b9a494a33a402cdddf16448727172f7f71 (patch) | |
tree | 2d2ad228a02e67682b399093405d1a3def1beafc | |
parent | de6498f18cce3abe2c577f6339f06d44a1328c07 (diff) | |
download | gtk+-ecd6b0b9a494a33a402cdddf16448727172f7f71.tar.gz |
gtk/gtkscrolledwindow.c: Declare variables at top-of-block
This way, the code can be built on C89-esque compilers.
-rw-r--r-- | gtk/gtkscrolledwindow.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 0f4193b14b..408c09265d 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -3754,10 +3754,11 @@ kinetic_scroll_stop_notify (GtkScrolledWindow *scrolled_window) static void gtk_scrolled_window_accumulate_velocity (GtkKineticScrolling **scrolling, double elapsed, double *velocity) { + double last_velocity; + if (!*scrolling) return; - double last_velocity; gtk_kinetic_scrolling_tick (*scrolling, elapsed, NULL, &last_velocity); if (((*velocity >= 0) == (last_velocity >= 0)) && (fabs (*velocity) >= fabs (last_velocity) * VELOCITY_ACCUMULATION_FLOOR)) |