[libdazzle] multi-paned: use inline variable in for loops
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] multi-paned: use inline variable in for loops
- Date: Wed, 21 Jun 2017 23:46:28 +0000 (UTC)
commit 515fc4f875b139acc5cb3c2cb1f250290d880c32
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 21 16:44:44 2017 -0700
multi-paned: use inline variable in for loops
We have sufficiently high C compiler requirements to be able to keep the
code base cleaner here.
src/widgets/dzl-multi-paned.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/widgets/dzl-multi-paned.c b/src/widgets/dzl-multi-paned.c
index 246c604..b59c61e 100644
--- a/src/widgets/dzl-multi-paned.c
+++ b/src/widgets/dzl-multi-paned.c
@@ -947,14 +947,13 @@ allocation_stage_naturals (DzlMultiPaned *self,
{
gint x_adjust = 0;
gint y_adjust = 0;
- guint i;
g_assert (DZL_IS_MULTI_PANED (self));
g_assert (state != NULL);
g_assert (state->children != NULL);
g_assert (state->n_children > 0);
- for (i = 0; i < state->n_children; i++)
+ for (guint i = 0; i < state->n_children; i++)
{
DzlMultiPanedChild *child = state->children [i];
@@ -1203,7 +1202,6 @@ allocation_stage_expand (DzlMultiPaned *self,
gint y_adjust = 0;
gint n_expand = 0;
gint adjust;
- guint i;
g_assert (DZL_IS_MULTI_PANED (self));
g_assert (state != NULL);
@@ -1234,7 +1232,7 @@ allocation_stage_expand (DzlMultiPaned *self,
return;
}
- for (i = 0; i < state->n_children; i++)
+ for (guint i = 0; i < state->n_children; i++)
{
DzlMultiPanedChild *child = state->children [i];
@@ -1261,7 +1259,7 @@ allocation_stage_expand (DzlMultiPaned *self,
else
adjust = state->avail_height / n_expand;
- for (i = 0; i < state->n_children; i++)
+ for (guint i = 0; i < state->n_children; i++)
{
DzlMultiPanedChild *child = state->children [i];
@@ -1315,14 +1313,12 @@ static void
allocation_stage_allocate (DzlMultiPaned *self,
AllocationState *state)
{
- guint i;
-
g_assert (DZL_IS_MULTI_PANED (self));
g_assert (state != NULL);
g_assert (state->children != NULL);
g_assert (state->n_children > 0);
- for (i = 0; i < state->n_children; i++)
+ for (guint i = 0; i < state->n_children; i++)
{
DzlMultiPanedChild *child = state->children [i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]