Create embedded-5_0-branch branch for development on ARM embedded cores.
[official-gcc.git] / embedded-5_0-branch / gcc / testsuite / gcc.c-torture / compile / pr25311.c
blob26c5bc37b831da305cf50bb8eef25a8a04ea4578
2 struct w
4 int top;
5 int left;
6 int height;
7 int width;
8 struct w *next;
9 struct w *parent;
10 struct w *child;
13 extern struct w *Qnil;
15 void
16 set_size (struct w *w, int new_size, int nodelete, int set_height)
18 int old_size = set_height? w->height : w->width;
20 if (nodelete || w->parent == Qnil)
22 int last_pos, last_old_pos, pos, old_pos, first;
23 int div_val = old_size << 1;
24 struct w *c;
26 last_pos = first = set_height? w->top : w->left;
27 last_old_pos = 0;
29 for (c = w->child; c != Qnil; c = c->next)
31 if (set_height)
32 old_pos = last_old_pos + c->height;
33 else
34 old_pos = last_old_pos + c->width;
36 pos = (((old_pos * new_size) << 1) + old_size) / div_val;
37 set_size (c, pos + first - last_pos, 1, set_height);
38 last_pos = pos + first;
39 last_old_pos = old_pos;
42 if (!nodelete)
43 for (c = w->child; c != Qnil; c = c->next)
44 use (c);