Re: [AD] Allegro 4.2.0 beta 4 deadline |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, 2005-06-27 at 13:43 +0200, Evert Glebbeek wrote:
> On Monday 27 June 2005 13:02, Elias Pschernig wrote:
> > Eh, already a case where it isn't C99 compliant. Line 24 simply declares
> > an array with unspezified size. Try moving the other definition of the
> > array up, it should then work..
>
> We shouldn't be doing C99 constructs anyway. Maybe it's a good idea to set
> a compiler flag to force GCC into C89 mode to catch these more easily (I
> assume there is one)?
>
Yes. I actually thought gcc would warn about C99 constructs.. so this
may be allowed even in C89.
Anyway, attached is a patch which should work around it. Does it work in
VC?
--
Elias Pschernig
Index: demo/animsel.c
===================================================================
RCS file: /cvsroot/alleg/allegro/demo/animsel.c,v
retrieving revision 1.1
diff -r1.1 animsel.c
23,24c23,42
< /* dialog procedure for the animation type dialog */
< static DIALOG anim_type_dlg[];
---
> static int anim_list_proc(int msg, DIALOG * d, int c);
> static int anim_desc_proc(int msg, DIALOG * d, int c);
>
> static DIALOG anim_type_dlg[] = {
> /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
> {d_shadow_box_proc, 0, 0, 281, 151, 0, 1, 0, 0, 0, 0, NULL, NULL, NULL},
> {d_ctext_proc, 140, 8, 1, 1, 0, 1, 0, 0, 0, 0, "Animation Method", NULL,
> NULL},
> {anim_list_proc, 16, 28, 153, 36, 0, 1, 0, D_EXIT, 3, 0,
> anim_list_getter, NULL, NULL},
> {d_check_proc, 16, 70, 248, 12, 0, 0, 0, 0, 0, 0, "Maximum FPS (uses 100% CPU)", NULL, NULL},
> {anim_desc_proc, 16, 90, 248, 48, 0, 1, 0, 0, 0, 0, 0, NULL, NULL},
> {d_button_proc, 184, 28, 80, 16, 0, 1, 13, D_EXIT, 0, 0, "OK", NULL,
> NULL},
> {d_button_proc, 184, 50, 80, 16, 0, 1, 27, D_EXIT, 0, 0, "Cancel", NULL,
> NULL},
> {d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
> {NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL}
> };
>
111,129d128
< static DIALOG anim_type_dlg[] = {
< /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
< {d_shadow_box_proc, 0, 0, 281, 151, 0, 1, 0, 0, 0, 0, NULL, NULL, NULL},
< {d_ctext_proc, 140, 8, 1, 1, 0, 1, 0, 0, 0, 0, "Animation Method", NULL,
< NULL},
< {anim_list_proc, 16, 28, 153, 36, 0, 1, 0, D_EXIT, 3, 0,
< anim_list_getter, NULL, NULL},
< {d_check_proc, 16, 70, 248, 12, 0, 0, 0, 0, 0, 0, "Maximum FPS (uses 100% CPU)", NULL, NULL},
< {anim_desc_proc, 16, 90, 248, 48, 0, 1, 0, 0, 0, 0, 0, NULL, NULL},
< {d_button_proc, 184, 28, 80, 16, 0, 1, 13, D_EXIT, 0, 0, "OK", NULL,
< NULL},
< {d_button_proc, 184, 50, 80, 16, 0, 1, 27, D_EXIT, 0, 0, "Cancel", NULL,
< NULL},
< {d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
< {NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL}
< };
<
<
<