diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-05-30 21:27:24 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-06-02 09:08:15 -0400 |
commit | 9545c017644b0e3de37b2479fbecd78cc0950a91 (patch) | |
tree | da136cd793313b13a5eb67913b669734776b2a96 /gtk/gtkkineticscrolling.c | |
parent | 6ee9281a2410b6c1309cb3ba30f5bb889a476e9e (diff) | |
download | gtk+-9545c017644b0e3de37b2479fbecd78cc0950a91.tar.gz |
kinetic scrolling: Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
Diffstat (limited to 'gtk/gtkkineticscrolling.c')
-rw-r--r-- | gtk/gtkkineticscrolling.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gtk/gtkkineticscrolling.c b/gtk/gtkkineticscrolling.c index 09619707ef..c33faee9c3 100644 --- a/gtk/gtkkineticscrolling.c +++ b/gtk/gtkkineticscrolling.c @@ -164,11 +164,11 @@ gtk_kinetic_scrolling_tick (GtkKineticScrolling *data, { gtk_kinetic_scrolling_init_overshoot(data,data->lower,data->position,data->velocity); } - else if(data->position > data->upper) + else if (data->position > data->upper) { gtk_kinetic_scrolling_init_overshoot(data, data->upper, data->position, data->velocity); } - else if(fabs(data->velocity) < 1) + else if (fabs(data->velocity) < 1) { data->phase = GTK_KINETIC_SCROLLING_PHASE_FINISHED; data->position = round(data->position); @@ -179,23 +179,23 @@ gtk_kinetic_scrolling_tick (GtkKineticScrolling *data, case GTK_KINETIC_SCROLLING_PHASE_OVERSHOOTING: { - gdouble exp_part, position; + gdouble exp_part, pos; data->t += time_delta; exp_part = exp(-data->overshoot_friction / 2 * data->t); - position = exp_part * (data->c1 + data->c2 * data->t); + pos = exp_part * (data->c1 + data->c2 * data->t); - if (position < data->lower - 50 || position > data->upper + 50) + if (pos < data->lower - 50 || pos > data->upper + 50) { - position = CLAMP (position, data->lower - 50, data->upper + 50); - gtk_kinetic_scrolling_init_overshoot (data, data->equilibrium_position, position, 0); + pos = CLAMP (pos, data->lower - 50, data->upper + 50); + gtk_kinetic_scrolling_init_overshoot (data, data->equilibrium_position, pos, 0); } else - data->velocity = data->c2 * exp_part - data->overshoot_friction / 2 * position; + data->velocity = data->c2 * exp_part - data->overshoot_friction / 2 * pos; - data->position = position + data->equilibrium_position; + data->position = pos + data->equilibrium_position; - if(fabs(position) < 0.1) + if(fabs (pos) < 0.1) { data->phase = GTK_KINETIC_SCROLLING_PHASE_FINISHED; data->position = data->equilibrium_position; |