cookbook: Make example code C90 compliant

Modified all cookbook example code to prevent ISO C90 compliance
warnings occurring during compilation.
This commit is contained in:
Elliot Smith
2010-11-12 09:32:04 +00:00
parent 03a713e18e
commit f9d2310b72
16 changed files with 113 additions and 89 deletions

View File

@ -13,14 +13,15 @@ _scroll_event_cb (ClutterActor *viewport,
gfloat viewport_height = clutter_actor_get_height (viewport);
gfloat scrollable_height = clutter_actor_get_height (scrollable);
gfloat y;
ClutterScrollDirection direction;
/* no need to scroll if the scrollable is shorter than the viewport */
if (scrollable_height < viewport_height)
return TRUE;
gfloat y = clutter_actor_get_y (scrollable);
y = clutter_actor_get_y (scrollable);
ClutterScrollDirection direction;
direction = clutter_event_get_scroll_direction (event);
switch (direction)
@ -63,6 +64,10 @@ _scroll_event_cb (ClutterActor *viewport,
int
main (int argc, char *argv[])
{
ClutterActor *stage;
ClutterActor *viewport;
ClutterActor *texture;
gchar *image_file_path = TESTS_DATA_DIR "/redhand.png";
if (argc > 1)
@ -70,10 +75,6 @@ main (int argc, char *argv[])
image_file_path = argv[1];
}
ClutterActor *stage;
ClutterActor *viewport;
ClutterActor *texture;
clutter_init (&argc, &argv);
stage = clutter_stage_get_default ();