[gtk/324.c89: 1/2] gtk/gtkscrolledwindow.c: Declare variables at top-of-block
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/324.c89: 1/2] gtk/gtkscrolledwindow.c: Declare variables at top-of-block
- Date: Wed, 23 Dec 2020 03:31:14 +0000 (UTC)
commit ecd6b0b9a494a33a402cdddf16448727172f7f71
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Dec 23 11:24:34 2020 +0800
gtk/gtkscrolledwindow.c: Declare variables at top-of-block
This way, the code can be built on C89-esque compilers.
gtk/gtkscrolledwindow.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]