From 8083eae40da40bc00ac2dd21382cbbd84e492f8e Mon Sep 17 00:00:00 2001 From: Sean Fox Date: Thu, 26 Jun 2008 19:49:08 +0000 Subject: Bitmap callbacks are now set during the call to gif_create svn path=/branches/dynis/libnsgif/; revision=4458 --- examples/decode_gif.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'examples/decode_gif.c') diff --git a/examples/decode_gif.c b/examples/decode_gif.c index 08f8a21..9c7a40f 100644 --- a/examples/decode_gif.c +++ b/examples/decode_gif.c @@ -38,16 +38,15 @@ void bitmap_modified(void *bitmap); int main(int argc, char *argv[]) { - gif_animation gif = { - .bitmap_callbacks = { - bitmap_create, - bitmap_destroy, - bitmap_get_buffer, - bitmap_set_opaque, - bitmap_test_opaque, - bitmap_modified - } + gif_bitmap_callback_vt bitmap_callbacks = { + bitmap_create, + bitmap_destroy, + bitmap_get_buffer, + bitmap_set_opaque, + bitmap_test_opaque, + bitmap_modified }; + gif_animation gif; size_t size; int code; unsigned int i; @@ -58,7 +57,7 @@ int main(int argc, char *argv[]) } /* create our gif animation */ - gif_create(&gif); + gif_create(&gif, &bitmap_callbacks); /* load file into memory */ unsigned char *data = load_file(argv[1], &size); @@ -106,6 +105,7 @@ int main(int argc, char *argv[]) /* clean up */ gif_finalise(&gif); + free(data); return 0; } -- cgit v1.2.3