[Swfdec] 12 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_playback_alsa.c libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_with.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_cached.c libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_ffmpeg.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec_mad.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_codec_video.c libswfdec/swfdec_color_as.c libswfdec/swfdec_debugger.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_internal.h libswfdec/swfdec_interval.c libswfdec/swfdec_listener.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_loadertarget.c libswfdec/swfdec_mouse_as.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_connection.c libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_pattern.c libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_shape.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_swf_instance.c libswfdec/swfdec_tag.c libswfdec/swfdec_video_movie_as.c libswfdec/swfdec_xml_as.c player/swfdec_debug_movies.c player/swfdec_player_manager.c test/dump.c test/swfedit_list.c test/swfedit_tag.c test/swfedit_token.c test/trace test/various

Benjamin Otte company at kemper.freedesktop.org
Wed Jul 18 03:32:01 PDT 2007


 configure.ac                             |    2 
 doc/swfdec-sections.txt                  |    5 -
 libswfdec-gtk/swfdec_playback_alsa.c     |    8 +-
 libswfdec/Makefile.am                    |    1 
 libswfdec/jpeg/jpeg.c                    |   45 ++++++++--------
 libswfdec/jpeg/jpeg.h                    |    2 
 libswfdec/swfdec_amf.c                   |    6 +-
 libswfdec/swfdec_as_array.c              |    2 
 libswfdec/swfdec_as_boolean.h            |    2 
 libswfdec/swfdec_as_context.c            |    2 
 libswfdec/swfdec_as_frame.h              |    3 +
 libswfdec/swfdec_as_frame_internal.h     |   11 ----
 libswfdec/swfdec_as_function.c           |    1 
 libswfdec/swfdec_as_interpret.c          |   15 +++--
 libswfdec/swfdec_as_object.c             |   18 +-----
 libswfdec/swfdec_as_object.h             |    2 
 libswfdec/swfdec_as_super.c              |    2 
 libswfdec/swfdec_as_types.c              |    6 +-
 libswfdec/swfdec_as_with.c               |    2 
 libswfdec/swfdec_button_movie.c          |    2 
 libswfdec/swfdec_cached.c                |    2 
 libswfdec/swfdec_codec_adpcm.c           |    1 
 libswfdec/swfdec_codec_audio.c           |   17 ------
 libswfdec/swfdec_codec_ffmpeg.c          |    3 -
 libswfdec/swfdec_codec_gst.c             |    1 
 libswfdec/swfdec_codec_mad.c             |    1 
 libswfdec/swfdec_codec_screen.c          |    9 +--
 libswfdec/swfdec_codec_video.c           |    9 ---
 libswfdec/swfdec_color_as.c              |    1 
 libswfdec/swfdec_debugger.c              |    2 
 libswfdec/swfdec_flv_decoder.c           |    9 +--
 libswfdec/swfdec_internal.h              |   83 +++++++++++++++++++++++++++++++
 libswfdec/swfdec_interval.c              |    2 
 libswfdec/swfdec_listener.c              |    2 
 libswfdec/swfdec_loader.c                |    2 
 libswfdec/swfdec_loader_internal.h       |    4 -
 libswfdec/swfdec_loadertarget.c          |    2 
 libswfdec/swfdec_mouse_as.c              |    1 
 libswfdec/swfdec_movie.c                 |    8 +-
 libswfdec/swfdec_movie_asprops.c         |   14 +++--
 libswfdec/swfdec_net_connection.c        |    1 
 libswfdec/swfdec_net_stream_as.c         |    1 
 libswfdec/swfdec_pattern.c               |    3 +
 libswfdec/swfdec_player.c                |   34 +++++++-----
 libswfdec/swfdec_player.h                |   12 ++++
 libswfdec/swfdec_player_as.c             |    1 
 libswfdec/swfdec_shape.c                 |    2 
 libswfdec/swfdec_sound.c                 |    2 
 libswfdec/swfdec_sprite_movie.c          |   10 +--
 libswfdec/swfdec_sprite_movie_as.c       |    1 
 libswfdec/swfdec_swf_instance.c          |    2 
 libswfdec/swfdec_tag.c                   |   16 ++---
 libswfdec/swfdec_video_movie_as.c        |    1 
 libswfdec/swfdec_xml_as.c                |    1 
 player/swfdec_debug_movies.c             |    2 
 player/swfdec_player_manager.c           |   10 +--
 test/dump.c                              |    8 +-
 test/swfedit_list.c                      |    2 
 test/swfedit_tag.c                       |    4 -
 test/swfedit_token.c                     |    6 +-
 test/trace/Makefile.am                   |    3 +
 test/trace/swfdec_interaction.c          |   12 ++--
 test/trace/trace.c                       |    4 -
 test/trace/waitforframe-huge-4.swf       |binary
 test/trace/waitforframe-huge-4.swf.trace |    1 
 test/trace/waitforframe-huge.as          |    8 ++
 test/various/gc.c                        |    6 +-
 test/various/urlencode.c                 |    8 +-
 68 files changed, 288 insertions(+), 183 deletions(-)

New commits:
diff-tree 7fea1baed62362bc04093cdc509488bb11658c49 (from parents)
Merge: bfabf461c04410ce66b4938e87862af559cb5108 6e644576c0bac40f193b31935946738a143c3c7a
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Jul 18 11:32:06 2007 +0100

    Merge branch 'master' of ssh://company@git.freedesktop.org/git/swfdec

diff-tree bfabf461c04410ce66b4938e87862af559cb5108 (from be09fa72dceb7ca3aecf8f6ec3d2b50f1e6348af)
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Jul 18 11:26:04 2007 +0100

    add a test for WaitForFrame

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 3bef969..94713c4 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -949,6 +949,9 @@ EXTRA_DIST = \
 	unescape2-7.swf.trace \
 	values.as \
 	video.flv \
+	waitforframe-huge.as \
+	waitforframe-huge-4.swf \
+	waitforframe-huge-4.swf.trace \
 	with-delete.as \
 	with-delete-5.swf \
 	with-delete-5.swf.trace \
diff --git a/test/trace/waitforframe-huge-4.swf b/test/trace/waitforframe-huge-4.swf
new file mode 100644
index 0000000..a07b8c1
Binary files /dev/null and b/test/trace/waitforframe-huge-4.swf differ
diff --git a/test/trace/waitforframe-huge-4.swf.trace b/test/trace/waitforframe-huge-4.swf.trace
new file mode 100644
index 0000000..45b983b
--- /dev/null
+++ b/test/trace/waitforframe-huge-4.swf.trace
@@ -0,0 +1 @@
+hi
diff --git a/test/trace/waitforframe-huge.as b/test/trace/waitforframe-huge.as
new file mode 100644
index 0000000..b7701ca
--- /dev/null
+++ b/test/trace/waitforframe-huge.as
@@ -0,0 +1,8 @@
+// makeswf -v 4 -s 200x150 -r 1 -o waitforframe-huge.swf waitforframe-huge.as
+
+if (frameLoaded (10000)) {
+  trace ("hi");
+}
+
+loadMovie ("FSCommand:quit", "");
+
diff-tree be09fa72dceb7ca3aecf8f6ec3d2b50f1e6348af (from 5c57cf2b0be8b2d66dd8c8362e768491a2b3f92b)
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Jul 18 11:24:49 2007 +0100

    make WaitForFrame always succeed when the file is fully loaded

diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index d71d948..b04136e 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -285,8 +285,10 @@ swfdec_action_wait_for_frame (SwfdecAsCo
     SwfdecDecoder *dec = SWFDEC_MOVIE (movie)->swf->decoder;
     loaded = dec->frames_loaded;
     g_assert (loaded <= movie->n_frames);
+    if (loaded == dec->frames_total)
+      loaded = G_MAXUINT;
   } else {
-    loaded = movie->n_frames;
+    loaded = G_MAXUINT;
   }
   if (loaded <= frame)
     swfdec_script_skip_actions (cx, jump);
diff-tree 5c57cf2b0be8b2d66dd8c8362e768491a2b3f92b (from f7617df09a9ef883cb0503e801f457175d5e3de7)
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Jul 18 11:14:21 2007 +0100

    fix alignment issues on broken processors

diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 4d683b4..d71d948 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -279,7 +279,7 @@ swfdec_action_wait_for_frame (SwfdecAsCo
   }
 
   movie = SWFDEC_SPRITE_MOVIE (cx->frame->target);
-  frame = GUINT16_FROM_LE (*((guint16 *) data));
+  frame = data[0] || (data[1] << 8);
   jump = data[2];
   if (SWFDEC_MOVIE (movie)->swf->movie == movie) {
     SwfdecDecoder *dec = SWFDEC_MOVIE (movie)->swf->decoder;
@@ -2132,7 +2132,7 @@ swfdec_action_print_with (guint action, 
     SWFDEC_ERROR ("With action requires a length of 2, but got %u", len);
     return NULL;
   }
-  return g_strdup_printf ("With %u", GUINT16_FROM_LE (*(guint16 *) data));
+  return g_strdup_printf ("With %u", data[0] | (data[1] << 8));
 }
 
 static char *
@@ -2401,7 +2401,7 @@ swfdec_action_print_goto_frame (guint ac
   if (len != 2)
     return NULL;
 
-  frame = GUINT16_FROM_LE (*((guint16 *) data));
+  frame = data[0] | (data[1] << 8);
   return g_strdup_printf ("GotoFrame %u", frame);
 }
 
@@ -2424,7 +2424,7 @@ swfdec_action_print_wait_for_frame (guin
   if (len != 3)
     return NULL;
 
-  frame = GUINT16_FROM_LE (*((guint16 *) data));
+  frame = data[0] | (data[1] << 8);
   jump = data[2];
   return g_strdup_printf ("WaitForFrame %u %u", frame, jump);
 }
diff-tree f7617df09a9ef883cb0503e801f457175d5e3de7 (from b9c53ce3c9dda11eabeb6b91f96a7e80b232bf31)
Author: Uygar Gümüş <uygar.gumus at gmail.com>
Date:   Tue Jul 17 20:29:40 2007 +0100

    rename SwfdecAsObjectClass.delete to del, since delete is a reserved C++ keyword

diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 989c30b..3bb325f 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -362,7 +362,7 @@ swfdec_as_object_class_init (SwfdecAsObj
   klass->get = swfdec_as_object_do_get;
   klass->set = swfdec_as_object_do_set;
   klass->set_flags = swfdec_as_object_do_set_flags;
-  klass->delete = swfdec_as_object_do_delete;
+  klass->del = swfdec_as_object_do_delete;
   klass->foreach = swfdec_as_object_do_foreach;
   klass->debug = swfdec_as_object_do_debug;
 }
@@ -582,7 +582,7 @@ swfdec_as_object_delete_variable (Swfdec
   g_return_val_if_fail (variable != NULL, FALSE);
 
   klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
-  return klass->delete (object, variable);
+  return klass->del (object, variable);
 }
 
 /**
diff --git a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h
index d796518..aab3cf5 100644
--- a/libswfdec/swfdec_as_object.h
+++ b/libswfdec/swfdec_as_object.h
@@ -80,7 +80,7 @@ struct _SwfdecAsObjectClass {
 						 guint			flags,
 						 guint			mask);
   /* delete the variable - return TRUE if it exists */
-  gboolean		(* delete)		(SwfdecAsObject *       object,
+  gboolean		(* del)			(SwfdecAsObject *       object,
 						 const char *		variable);
   /* call with every variable until func returns FALSE */
   gboolean		(* foreach)		(SwfdecAsObject *	object,
diff --git a/libswfdec/swfdec_as_super.c b/libswfdec/swfdec_as_super.c
index f093638..41a58f2 100644
--- a/libswfdec/swfdec_as_super.c
+++ b/libswfdec/swfdec_as_super.c
@@ -122,7 +122,7 @@ swfdec_as_super_class_init (SwfdecAsSupe
   asobject_class->get = swfdec_as_super_get;
   asobject_class->set = swfdec_as_super_set;
   asobject_class->set_flags = swfdec_as_super_set_flags;
-  asobject_class->delete = swfdec_as_super_delete;
+  asobject_class->del = swfdec_as_super_delete;
   asobject_class->resolve = swfdec_as_super_resolve;
 
   function_class->call = swfdec_as_super_call;
diff --git a/libswfdec/swfdec_as_with.c b/libswfdec/swfdec_as_with.c
index 672d09d..a000ca3 100644
--- a/libswfdec/swfdec_as_with.c
+++ b/libswfdec/swfdec_as_with.c
@@ -102,7 +102,7 @@ swfdec_as_with_class_init (SwfdecAsWithC
   asobject_class->get = swfdec_as_with_get;
   asobject_class->set = swfdec_as_with_set;
   asobject_class->set_flags = swfdec_as_with_set_flags;
-  asobject_class->delete = swfdec_as_with_delete;
+  asobject_class->del = swfdec_as_with_delete;
   asobject_class->foreach = swfdec_as_with_foreach;
   asobject_class->resolve = swfdec_as_with_resolve;
 }
diff-tree b9c53ce3c9dda11eabeb6b91f96a7e80b232bf31 (from 6ae045ecd4718c78b02f2e0bf569c832ca52992b)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jul 17 01:09:38 2007 +0100

    fix warning I missed earlier

diff --git a/test/swfedit_list.c b/test/swfedit_list.c
index 36e0295..45e0dd5 100644
--- a/test/swfedit_list.c
+++ b/test/swfedit_list.c
@@ -49,7 +49,7 @@ swfedit_list_changed (SwfeditToken *toke
   /* update length */
   j = list->def[i % list->n_defs].n_items;
   if (j != 0) {
-    SwfeditTokenEntry *entry = &g_array_index (token->tokens, 
+    entry = &g_array_index (token->tokens, 
 	SwfeditTokenEntry, j - 1);
     if (entry->type == SWFEDIT_TOKEN_UINT32) {
       SwfdecOut *out = swfdec_out_open ();
diff-tree 6ae045ecd4718c78b02f2e0bf569c832ca52992b (from a6d787347be55099a17168e430b9154e9149b213)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jul 17 01:09:25 2007 +0100

    disable -Wstrict-prototypes because gtk is broken

diff --git a/configure.ac b/configure.ac
index 1e4cb3f..7c3d67a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl if we support them, we set them unco
 AS_COMPILER_FLAG(-Wall, GLOBAL_CFLAGS="-Wall", GLOBAL_CFLAGS="")
 dnl I want this but stupid headers don't let me
 dnl AS_COMPILER_FLAG(-Wshadow, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wshadow")
-AS_COMPILER_FLAG(-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline")
+AS_COMPILER_FLAG(-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline")
 dnl if we're in nano >= 1, add -Werror if supported
 if test x$SWFDEC_CVS = xyes ; then
   AS_COMPILER_FLAG(-Werror, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Werror")
diff-tree a6d787347be55099a17168e430b9154e9149b213 (from 48cf5039491bba2226179efd482aa27f82fde84d)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jul 17 00:58:49 2007 +0100

    add new warning flags and fix the associated warnings
    
    Huge patch, woohoo

diff --git a/configure.ac b/configure.ac
index 881a73b..1e4cb3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl if we support them, we set them unco
 AS_COMPILER_FLAG(-Wall, GLOBAL_CFLAGS="-Wall", GLOBAL_CFLAGS="")
 dnl I want this but stupid headers don't let me
 dnl AS_COMPILER_FLAG(-Wshadow, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wshadow")
-AS_COMPILER_FLAG(-Wextra -Wno-missing-field-initializers -Wno-unused-parameter, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter")
+AS_COMPILER_FLAG(-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline")
 dnl if we're in nano >= 1, add -Werror if supported
 if test x$SWFDEC_CVS = xyes ; then
   AS_COMPILER_FLAG(-Werror, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Werror")
diff --git a/libswfdec-gtk/swfdec_playback_alsa.c b/libswfdec-gtk/swfdec_playback_alsa.c
index ee4da3e..f227781 100644
--- a/libswfdec-gtk/swfdec_playback_alsa.c
+++ b/libswfdec-gtk/swfdec_playback_alsa.c
@@ -82,8 +82,8 @@ write_player (Stream *stream, const snd_
   g_assert (dst[0].step == dst[1].step);
   g_assert (dst[0].step == 32);
 
-  memset (dst[0].addr + offset * dst[0].step / 8, 0, avail * 4);
-  swfdec_audio_render (stream->audio, dst[0].addr + offset * dst[0].step / 8, 
+  memset ((guint8 *) dst[0].addr + offset * dst[0].step / 8, 0, avail * 4);
+  swfdec_audio_render (stream->audio, (gint16 *) ((guint8 *) dst[0].addr + offset * dst[0].step / 8), 
       stream->offset, avail);
   //g_print ("rendering %u %u\n", stream->offset, (guint) avail);
   return avail;
@@ -150,6 +150,8 @@ handle_stream (GIOChannel *source, GIOCo
 static void
 swfdec_stream_install_handlers (Stream *stream)
 {
+  GIOChannel *channel;
+
   if (stream->n_sources > 0) {
     struct pollfd polls[stream->n_sources];
     guint i, count;
@@ -159,7 +161,7 @@ swfdec_stream_install_handlers (Stream *
     for (i = 0; i < count; i++) {
       if (stream->sources[i] != NULL)
 	continue;
-      GIOChannel *channel = g_io_channel_unix_new (polls[i].fd);
+      channel = g_io_channel_unix_new (polls[i].fd);
       stream->sources[i] = g_io_create_watch (channel, polls[i].events);
       g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
       g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index 500c431..313afbf 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -176,6 +176,7 @@ noinst_HEADERS = \
 	swfdec_graphic.h \
 	swfdec_graphic_movie.h \
 	swfdec_image.h \
+	swfdec_internal.h \
 	swfdec_interval.h \
 	swfdec_listener.h \
 	swfdec_loader_internal.h \
diff --git a/libswfdec/swfdec_amf.c b/libswfdec/swfdec_amf.c
index 341976e..36b0959 100644
--- a/libswfdec/swfdec_amf.c
+++ b/libswfdec/swfdec_amf.c
@@ -132,16 +132,16 @@ swfdec_amf_parse_array (SwfdecAsContext 
   if (array == NULL)
     return FALSE;
   for (i = 0; i < len; i++) {
+    SwfdecAsValue tmp;
     type = swfdec_bits_get_u8 (bits);
-    SwfdecAsValue val;
     if (type >= SWFDEC_AMF_N_TYPES ||
 	(func = parse_funcs[type]) == NULL) {
       SWFDEC_ERROR ("no parse func for AMF type %u", type);
       goto fail;
     }
-    if (!func (context, bits, &val))
+    if (!func (context, bits, &tmp))
       goto fail;
-    swfdec_as_array_push (SWFDEC_AS_ARRAY (array), &val);
+    swfdec_as_array_push (SWFDEC_AS_ARRAY (array), &tmp);
   }
 
   SWFDEC_AS_VALUE_SET_OBJECT (val, array);
diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c
index 32760a3..cc03b03 100644
--- a/libswfdec/swfdec_as_array.c
+++ b/libswfdec/swfdec_as_array.c
@@ -675,7 +675,7 @@ swfdec_as_array_sort_compare (SwfdecAsCo
     } else {
       double an = swfdec_as_value_to_number (cx, a);
       double bn = swfdec_as_value_to_number (cx, b);
-      retval = (an < bn ? -1 : (an == bn ? 0 : 1));
+      retval = (an < bn ? -1 : (an > bn ? 1 : 0));
     }
   }
   else if (options & ARRAY_SORT_OPTION_CASEINSENSITIVE)
diff --git a/libswfdec/swfdec_as_boolean.h b/libswfdec/swfdec_as_boolean.h
index 47ec511..16bdebd 100644
--- a/libswfdec/swfdec_as_boolean.h
+++ b/libswfdec/swfdec_as_boolean.h
@@ -38,7 +38,7 @@ typedef struct _SwfdecAsBooleanClass Swf
 struct _SwfdecAsBoolean {
   SwfdecAsObject	object;
 
-  double		boolean;		/* boolean represented by this boolean object */
+  gboolean		boolean;		/* boolean represented by this boolean object */
 };
 
 struct _SwfdecAsBooleanClass {
diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c
index 227444e..8546134 100644
--- a/libswfdec/swfdec_as_context.c
+++ b/libswfdec/swfdec_as_context.c
@@ -817,7 +817,7 @@ out:
 
 /*** EVAL ***/
 
-char *
+static char *
 swfdec_as_slash_to_dot (const char *slash_str)
 {
   const char *cur = slash_str;
diff --git a/libswfdec/swfdec_as_frame.h b/libswfdec/swfdec_as_frame.h
index 44caf87..17fdccf 100644
--- a/libswfdec/swfdec_as_frame.h
+++ b/libswfdec/swfdec_as_frame.h
@@ -50,6 +50,9 @@ SwfdecAsFrame *	swfdec_as_frame_get_next
 
 SwfdecAsValue *	swfdec_as_stack_iterator_init	(SwfdecAsStackIterator *	iter,
 						 SwfdecAsFrame *		frame);
+SwfdecAsValue *	swfdec_as_stack_iterator_init_arguments 
+						(SwfdecAsStackIterator *	iter,
+						 SwfdecAsFrame *		frame);
 SwfdecAsValue *	swfdec_as_stack_iterator_next	(SwfdecAsStackIterator *	iter);
 
 
diff --git a/libswfdec/swfdec_as_frame_internal.h b/libswfdec/swfdec_as_frame_internal.h
index 2a2a7cb..f6d7644 100644
--- a/libswfdec/swfdec_as_frame_internal.h
+++ b/libswfdec/swfdec_as_frame_internal.h
@@ -26,13 +26,6 @@
 
 G_BEGIN_DECLS
 
-#define SWFDEC_TYPE_AS_FRAME                    (swfdec_as_frame_get_type())
-#define SWFDEC_IS_AS_FRAME(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_FRAME))
-#define SWFDEC_IS_AS_FRAME_CLASS(klass)         (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_AS_FRAME))
-#define SWFDEC_AS_FRAME(obj)                    (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrame))
-#define SWFDEC_AS_FRAME_CLASS(klass)            (G_TYPE_CHECK_CLASS_CAST ((klass), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrameClass))
-#define SWFDEC_AS_FRAME_GET_CLASS(obj)          (G_TYPE_INSTANCE_GET_CLASS ((obj), SWFDEC_TYPE_AS_FRAME, SwfdecAsFrameClass))
-
 struct _SwfdecAsFrame {
   SwfdecAsScope		scope_object;
 
@@ -45,7 +38,7 @@ struct _SwfdecAsFrame {
   guint			argc;		/* number of arguments */
   const SwfdecAsValue *	argv;		/* arguments or %NULL if taken from stack */
   /* debugging */
-  char *		function_name;	/* name of function */
+  const char *		function_name;	/* name of function */
   /* script execution */
   SwfdecScript *	script;		/* script being executed */
   SwfdecAsScope *	scope;		/* first object in scope chain (either this frame or a with object) */
@@ -65,8 +58,6 @@ struct _SwfdecAsFrameClass {
   SwfdecAsScopeClass	scope_class;
 };
 
-GType		swfdec_as_frame_get_type	(void);
-
 SwfdecAsFrame *	swfdec_as_frame_new		(SwfdecAsContext *	context,
 						 SwfdecScript *		script);
 SwfdecAsFrame *	swfdec_as_frame_new_native	(SwfdecAsContext *	context);
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index 66fcb00..3e9b6dd 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -24,6 +24,7 @@
 #include "swfdec_as_function.h"
 #include "swfdec_as_context.h"
 #include "swfdec_as_frame_internal.h"
+#include "swfdec_as_internal.h"
 #include "swfdec_as_stack.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index ea29bc3..4d683b4 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -1465,6 +1465,7 @@ swfdec_action_define_function (SwfdecAsC
   const char *function_name;
   const char *name = NULL;
   guint i, n_args, size, n_registers;
+  SwfdecBuffer *buffer;
   SwfdecBits bits;
   SwfdecAsFunction *fun;
   SwfdecAsFrame *frame;
@@ -1530,7 +1531,7 @@ swfdec_action_define_function (SwfdecAsC
     return;
   }
   /* create the script */
-  SwfdecBuffer *buffer = swfdec_buffer_new_subbuffer (frame->script->buffer, 
+  buffer = swfdec_buffer_new_subbuffer (frame->script->buffer, 
       frame->pc + 3 + len - frame->script->buffer->data, size);
   swfdec_bits_init (&bits, buffer);
   if (*function_name) {
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 7e049d1..989c30b 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -180,7 +180,8 @@ swfdec_as_object_do_set (SwfdecAsObject 
     var = g_slice_new0 (SwfdecAsVariable);
     g_hash_table_insert (object->properties, (gpointer) variable, var);
   }
-  var->value = *val;
+  if (!(var->flags & SWFDEC_AS_VARIABLE_READONLY))
+    var->value = *val;
 }
 
 static void
@@ -959,17 +960,6 @@ swfdec_as_object_init_context (SwfdecAsC
       SWFDEC_TYPE_AS_OBJECT, swfdec_as_object_toString, 0);
 }
 
-void
-swfdec_as_variable_set (SwfdecAsVariable *var, const SwfdecAsValue *value)
-{
-  g_return_if_fail (var != NULL);
-  g_return_if_fail (SWFDEC_IS_AS_VALUE (value));
-
-  if (var->flags & SWFDEC_AS_VARIABLE_READONLY)
-    return;
-  var->value = *value;
-}
-
 /**
  * swfdec_as_object_get_debug:
  * @object: a #SwfdecAsObject
diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
index 8282996..e248805 100644
--- a/libswfdec/swfdec_as_types.c
+++ b/libswfdec/swfdec_as_types.c
@@ -496,9 +496,11 @@ swfdec_as_value_to_integer (SwfdecAsCont
   if (!isfinite (d))
     return 0;
   if (d < 0) {
-    return - (guint) fmod (-d, 4294967296);
+    d = fmod (-d, 4294967296);
+    return - (guint) d;
   } else {
-    return (guint) fmod (d, 4294967296);
+    d = fmod (d, 4294967296);
+    return (guint) d;
   }
 }
 
diff --git a/libswfdec/swfdec_button_movie.c b/libswfdec/swfdec_button_movie.c
index 0d9a57c..b48c746 100644
--- a/libswfdec/swfdec_button_movie.c
+++ b/libswfdec/swfdec_button_movie.c
@@ -63,7 +63,7 @@ static const int sound_table[2][4][4] = 
     { -1,  0,  3, -1 } }
 };
 
-const char *
+static const char *
 swfdec_button_condition_get_name (SwfdecButtonCondition condition)
 {
   /* FIXME: check if these events are based on conditions or if they're independant of button type */
diff --git a/libswfdec/swfdec_cached.c b/libswfdec/swfdec_cached.c
index b7216e6..37b5737 100644
--- a/libswfdec/swfdec_cached.c
+++ b/libswfdec/swfdec_cached.c
@@ -71,7 +71,7 @@ swfdec_cached_set_cache (SwfdecCached *c
 static void
 swfdec_cached_unload_func (gpointer data)
 {
-  SwfdecCached *cached = SWFDEC_CACHED (data - G_STRUCT_OFFSET (SwfdecCached, handle));
+  SwfdecCached *cached = SWFDEC_CACHED ((guint8 *) data - G_STRUCT_OFFSET (SwfdecCached, handle));
 
   cached->handle.unload = NULL;
   swfdec_cached_unload (cached);
diff --git a/libswfdec/swfdec_codec_adpcm.c b/libswfdec/swfdec_codec_adpcm.c
index a435041..ca01831 100644
--- a/libswfdec/swfdec_codec_adpcm.c
+++ b/libswfdec/swfdec_codec_adpcm.c
@@ -24,6 +24,7 @@
 #include "swfdec_codec_audio.h"
 #include "swfdec_bits.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 typedef struct {
   SwfdecAudioDecoder	decoder;
diff --git a/libswfdec/swfdec_codec_audio.c b/libswfdec/swfdec_codec_audio.c
index b690524..7694e8d 100644
--- a/libswfdec/swfdec_codec_audio.c
+++ b/libswfdec/swfdec_codec_audio.c
@@ -23,6 +23,7 @@
 
 #include "swfdec_codec_audio.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 /*** UNCOMPRESSED SOUND ***/
 
@@ -106,22 +107,6 @@ swfdec_audio_decoder_uncompressed_new (S
   return &dec->decoder;
 }
 
-/*** DECODER LIST ***/
-
-extern SwfdecAudioDecoderNewFunc swfdec_audio_decoder_adpcm_new;
-
-#ifdef HAVE_MAD
-extern SwfdecAudioDecoderNewFunc swfdec_audio_decoder_mad_new;
-#endif
-
-#ifdef HAVE_FFMPEG
-extern SwfdecAudioDecoderNewFunc swfdec_audio_decoder_ffmpeg_new;
-#endif
-
-#ifdef HAVE_GST
-extern SwfdecAudioDecoderNewFunc swfdec_audio_decoder_gst_new;
-#endif
-
 /*** PUBLIC API ***/
 
 /**
diff --git a/libswfdec/swfdec_codec_ffmpeg.c b/libswfdec/swfdec_codec_ffmpeg.c
index c80f117..3f9e387 100644
--- a/libswfdec/swfdec_codec_ffmpeg.c
+++ b/libswfdec/swfdec_codec_ffmpeg.c
@@ -27,6 +27,7 @@
 #include "swfdec_codec_audio.h"
 #include "swfdec_codec_video.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 /*** GENERAL ***/
 
@@ -209,7 +210,7 @@ typedef struct {
   struct SwsContext *	sws;		/* the format conversion */
 } SwfdecVideoDecoderFFMpeg;
 
-SwfdecBuffer *
+static SwfdecBuffer *
 swfdec_video_decoder_ffmpeg_decode (SwfdecVideoDecoder *dec, SwfdecBuffer *buffer,
     guint *width, guint *height, guint *rowstride)
 {
diff --git a/libswfdec/swfdec_codec_gst.c b/libswfdec/swfdec_codec_gst.c
index 6c1ae37..c561bcb 100644
--- a/libswfdec/swfdec_codec_gst.c
+++ b/libswfdec/swfdec_codec_gst.c
@@ -26,6 +26,7 @@
 #include "swfdec_codec_audio.h"
 #include "swfdec_codec_video.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 #if 0
 #define swfdec_cond_wait(cond, mutex) G_STMT_START { \
diff --git a/libswfdec/swfdec_codec_mad.c b/libswfdec/swfdec_codec_mad.c
index 66f0753..bcdf7c3 100644
--- a/libswfdec/swfdec_codec_mad.c
+++ b/libswfdec/swfdec_codec_mad.c
@@ -27,6 +27,7 @@
 
 #include "swfdec_codec_audio.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 typedef struct {
   SwfdecAudioDecoder	decoder;
diff --git a/libswfdec/swfdec_codec_screen.c b/libswfdec/swfdec_codec_screen.c
index 369ff88..b0d757e 100644
--- a/libswfdec/swfdec_codec_screen.c
+++ b/libswfdec/swfdec_codec_screen.c
@@ -28,6 +28,7 @@
 #include "swfdec_codec_video.h"
 #include "swfdec_bits.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 typedef struct _SwfdecCodecScreen SwfdecCodecScreen;
 
@@ -84,19 +85,19 @@ swfdec_video_decoder_screen_decode (Swfd
   for (j = 0; j < h; j += bh) {
     for (i = 0; i < w; i += bw) {
       guint x, y, size;
-      SwfdecBuffer *buffer;
+      SwfdecBuffer *buf;
       guint8 *in, *out;
       size = swfdec_bits_get_bu16 (&bits);
       if (size == 0)
 	continue;
-      buffer = swfdec_bits_decompress (&bits, size, bw * bh * 4);
-      if (buffer == NULL) {
+      buf = swfdec_bits_decompress (&bits, size, bw * bh * 4);
+      if (buf == NULL) {
 	SWFDEC_WARNING ("error decoding block");
 	continue;
       }
       /* convert format and write out data */
       out = ret->data + stride * (h - j - 1) + i * 4;
-      in = buffer->data;
+      in = buf->data;
       for (y = 0; y < MIN (bh, h - j); y++) {
 	for (x = 0; x < MIN (bw, w - i); x++) {
 	  out[x * 4 - y * stride + SWFDEC_COLOR_INDEX_BLUE] = *in++;
diff --git a/libswfdec/swfdec_codec_video.c b/libswfdec/swfdec_codec_video.c
index 7417758..51f3b10 100644
--- a/libswfdec/swfdec_codec_video.c
+++ b/libswfdec/swfdec_codec_video.c
@@ -23,14 +23,7 @@
 
 #include "swfdec_codec_video.h"
 #include "swfdec_debug.h"
-
-extern SwfdecVideoDecoderNewFunc swfdec_video_decoder_screen_new;
-#ifdef HAVE_FFMPEG
-extern SwfdecVideoDecoderNewFunc swfdec_video_decoder_ffmpeg_new;
-#endif
-#ifdef HAVE_GST
-extern SwfdecVideoDecoderNewFunc swfdec_video_decoder_gst_new;
-#endif
+#include "swfdec_internal.h"
 
 /**
  * swfdec_video_decoder_new:
diff --git a/libswfdec/swfdec_color_as.c b/libswfdec/swfdec_color_as.c
index 60a95d3..3abf5f9 100644
--- a/libswfdec/swfdec_color_as.c
+++ b/libswfdec/swfdec_color_as.c
@@ -26,6 +26,7 @@
 #include "swfdec_as_native_function.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_movie.h"
 
 G_DEFINE_TYPE (SwfdecMovieColor, swfdec_movie_color, SWFDEC_TYPE_AS_OBJECT)
diff --git a/libswfdec/swfdec_debugger.c b/libswfdec/swfdec_debugger.c
index c7f9a35..d9c2798 100644
--- a/libswfdec/swfdec_debugger.c
+++ b/libswfdec/swfdec_debugger.c
@@ -131,7 +131,7 @@ swfdec_debugger_print_push (ScriptParser
 
 error:
   g_string_free (string, TRUE);
-  return "erroneous action Push";
+  return g_strdup ("erroneous action Push");
 }
 
 /* NB: constant pool actions are special in that they are called at init time */
diff --git a/libswfdec/swfdec_flv_decoder.c b/libswfdec/swfdec_flv_decoder.c
index 2352471..df8054b 100644
--- a/libswfdec/swfdec_flv_decoder.c
+++ b/libswfdec/swfdec_flv_decoder.c
@@ -267,15 +267,15 @@ swfdec_flv_decoder_parse_video_tag (Swfd
     g_array_insert_val (flv->video, idx, tag);
   }
   if (dec->width == 0 && dec->height == 0) {
-    SwfdecFlvVideoTag *tag = &g_array_index (flv->video, SwfdecFlvVideoTag, 0);
+    SwfdecFlvVideoTag *t = &g_array_index (flv->video, SwfdecFlvVideoTag, 0);
     SwfdecVideoDecoder *decoder;
     cairo_surface_t *surface;
 
     /* nice hack... */
-    decoder = swfdec_video_decoder_new (tag->format);
+    decoder = swfdec_video_decoder_new (t->format);
     if (decoder == NULL)
       return SWFDEC_STATUS_OK;
-    surface = swfdec_video_decoder_decode (decoder, tag->buffer);
+    surface = swfdec_video_decoder_decode (decoder, t->buffer);
     if (surface == NULL)
       return SWFDEC_STATUS_OK;
     dec->width = cairo_image_surface_get_width (surface);
@@ -640,7 +640,8 @@ swfdec_flv_decoder_eof (SwfdecFlvDecoder
 SwfdecMovie *
 swfdec_flv_decoder_add_movie (SwfdecFlvDecoder *flv, SwfdecMovie *parent)
 {
-  g_assert_not_reached ();
+  //g_assert_not_reached ();
+  return NULL;
 #if 0
   SwfdecContent *content = swfdec_content_new (0);
   SwfdecMovie *movie;
diff --git a/libswfdec/swfdec_internal.h b/libswfdec/swfdec_internal.h
new file mode 100644
index 0000000..c830eb7
--- /dev/null
+++ b/libswfdec/swfdec_internal.h
@@ -0,0 +1,83 @@
+/* Swfdec
+ * Copyright (C) 2003-2006 David Schleef <ds at schleef.org>
+ *		 2005-2006 Eric Anholt <eric at anholt.net>
+ *		      2006 Benjamin Otte <otte at gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+
+#ifndef _SWFDEC_INTERNAL_H_
+#define _SWFDEC_INTERNAL_H_
+
+#include <libswfdec/swfdec_types.h>
+#include <libswfdec/swfdec_codec_audio.h>
+#include <libswfdec/swfdec_codec_video.h>
+
+G_BEGIN_DECLS
+
+
+/* audio codecs */
+
+SwfdecAudioDecoder *	swfdec_audio_decoder_adpcm_new		(SwfdecAudioFormat	type, 
+								 gboolean		width,
+								 SwfdecAudioOut		format);
+#ifdef HAVE_MAD
+SwfdecAudioDecoder *	swfdec_audio_decoder_mad_new		(SwfdecAudioFormat	type, 
+								 gboolean		width,
+								 SwfdecAudioOut		format);
+#endif
+#ifdef HAVE_FFMPEG
+SwfdecAudioDecoder *	swfdec_audio_decoder_ffmpeg_new		(SwfdecAudioFormat	type, 
+								 gboolean		width,
+								 SwfdecAudioOut		format);
+#endif
+#ifdef HAVE_GST
+SwfdecAudioDecoder *	swfdec_audio_decoder_gst_new		(SwfdecAudioFormat	type, 
+								 gboolean		width,
+								 SwfdecAudioOut		format);
+#endif
+
+/* video codecs */
+
+SwfdecVideoDecoder *	swfdec_video_decoder_screen_new		(SwfdecVideoFormat	format);
+#ifdef HAVE_FFMPEG
+SwfdecVideoDecoder *	swfdec_video_decoder_ffmpeg_new		(SwfdecVideoFormat	format);
+#endif
+#ifdef HAVE_GST
+SwfdecVideoDecoder *	swfdec_video_decoder_gst_new		(SwfdecVideoFormat	format);
+#endif
+
+/* AS engine setup code */
+
+void			swfdec_player_init_global		(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_mouse_init_context		(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_movie_color_init_context		(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_net_connection_init_context	(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_net_stream_init_context		(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_sprite_movie_init_context	(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_video_movie_init_context		(SwfdecPlayer *		player,
+								 guint			version);
+void			swfdec_xml_init_context			(SwfdecPlayer *		player,
+								 guint			version);
+
+G_END_DECLS
+#endif
diff --git a/libswfdec/swfdec_interval.c b/libswfdec/swfdec_interval.c
index ab79eb8..f8fcc85 100644
--- a/libswfdec/swfdec_interval.c
+++ b/libswfdec/swfdec_interval.c
@@ -104,7 +104,7 @@ swfdec_interval_trigger (SwfdecTimeout *
   }
 }
 
-guint
+static guint
 swfdec_interval_new (SwfdecPlayer *player, guint msecs, gboolean repeat, 
     SwfdecAsObject *object, const char *fun_name,
     guint n_args, const SwfdecAsValue *args)
diff --git a/libswfdec/swfdec_listener.c b/libswfdec/swfdec_listener.c
index da7a365..73c1bf9 100644
--- a/libswfdec/swfdec_listener.c
+++ b/libswfdec/swfdec_listener.c
@@ -79,7 +79,7 @@ swfdec_listener_add (SwfdecListener *lis
       return TRUE;
   }
   if (found >= listener->n_entries) {
-    gpointer mem;
+    SwfdecListenerEntry *mem;
     guint new_len = listener->n_entries + 16;
 
     mem = g_try_realloc (listener->entries, sizeof (SwfdecListenerEntry) * new_len);
diff --git a/libswfdec/swfdec_loader.c b/libswfdec/swfdec_loader.c
index 2416c61..aa41e59 100644
--- a/libswfdec/swfdec_loader.c
+++ b/libswfdec/swfdec_loader.c
@@ -694,7 +694,7 @@ swfdec_urldecode_one_string (const char 
  * to the given @str
  **/
 void
-swfdec_string_append_urlencoded (GString *str, char *name, char *value)
+swfdec_string_append_urlencoded (GString *str, const char *name, const char *value)
 {
   g_return_if_fail (str != NULL);
   g_return_if_fail (name != NULL);
diff --git a/libswfdec/swfdec_loader_internal.h b/libswfdec/swfdec_loader_internal.h
index a428a71..43b5231 100644
--- a/libswfdec/swfdec_loader_internal.h
+++ b/libswfdec/swfdec_loader_internal.h
@@ -68,8 +68,8 @@ gboolean		swfdec_urldecode_one		(const c
 							 char **		value,
 							 const char **		end);
 void			swfdec_string_append_urlencoded	(GString *		str,
-							 char *			name,
-							 char *			value);
+							 const char *		name,
+							 const char *		value);
 
 G_END_DECLS
 #endif
diff --git a/libswfdec/swfdec_loadertarget.c b/libswfdec/swfdec_loadertarget.c
index bef3aca..f702f99 100644
--- a/libswfdec/swfdec_loadertarget.c
+++ b/libswfdec/swfdec_loadertarget.c
@@ -38,7 +38,7 @@ swfdec_loader_target_base_init (gpointer
 }
 
 GType
-swfdec_loader_target_get_type ()
+swfdec_loader_target_get_type (void)
 {
   static GType loader_target_type = 0;
   
diff --git a/libswfdec/swfdec_mouse_as.c b/libswfdec/swfdec_mouse_as.c
index c5d6f49..44deecc 100644
--- a/libswfdec/swfdec_mouse_as.c
+++ b/libswfdec/swfdec_mouse_as.c
@@ -24,6 +24,7 @@
 #include "swfdec_as_object.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_listener.h"
 #include "swfdec_player_internal.h"
 
diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 7ae2a67..196a8f3 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -222,12 +222,12 @@ swfdec_movie_find (SwfdecMovie *movie, i
   g_return_val_if_fail (SWFDEC_IS_MOVIE (movie), NULL);
 
   for (walk = movie->list; walk; walk = walk->next) {
-    SwfdecMovie *movie = walk->data;
+    SwfdecMovie *cur= walk->data;
 
-    if (movie->depth < depth)
+    if (cur->depth < depth)
       continue;
-    if (movie->depth == depth)
-      return movie;
+    if (cur->depth == depth)
+      return cur;
     break;
   }
   return NULL;
diff --git a/libswfdec/swfdec_movie_asprops.c b/libswfdec/swfdec_movie_asprops.c
index 5d4e2ab..e1887ec 100644
--- a/libswfdec/swfdec_movie_asprops.c
+++ b/libswfdec/swfdec_movie_asprops.c
@@ -217,7 +217,8 @@ mc_width_get (SwfdecMovie *movie, Swfdec
   double d;
 
   swfdec_movie_update (movie);
-  d = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) (rint (movie->extents.x1 - movie->extents.x0)));
+  d = rint (movie->extents.x1 - movie->extents.x0);
+  d = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) d);
   SWFDEC_AS_VALUE_SET_NUMBER (rval, d);
 }
 
@@ -236,7 +237,8 @@ mc_width_set (SwfdecMovie *movie, const 
   }
   swfdec_movie_update (movie);
   movie->modified = TRUE;
-  cur = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) (rint (movie->original_extents.x1 - movie->original_extents.x0)));
+  cur = rint (movie->original_extents.x1 - movie->original_extents.x0);
+  cur = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) cur);
   if (cur != 0) {
     movie->xscale = 100 * d / cur;
   } else {
@@ -252,7 +254,8 @@ mc_height_get (SwfdecMovie *movie, Swfde
   double d;
 
   swfdec_movie_update (movie);
-  d = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) (rint (movie->extents.y1 - movie->extents.y0)));
+  d = rint (movie->extents.y1 - movie->extents.y0);
+  d = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) d);
   SWFDEC_AS_VALUE_SET_NUMBER (rval, d);
 }
 
@@ -271,7 +274,8 @@ mc_height_set (SwfdecMovie *movie, const
   }
   swfdec_movie_update (movie);
   movie->modified = TRUE;
-  cur = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) (rint (movie->original_extents.y1 - movie->original_extents.y0)));
+  cur = rint (movie->original_extents.y1 - movie->original_extents.y0);
+  cur = SWFDEC_TWIPS_TO_DOUBLE ((SwfdecTwips) cur);
   if (cur != 0) {
     movie->yscale = 100 * d / cur;
   } else {
diff --git a/libswfdec/swfdec_net_connection.c b/libswfdec/swfdec_net_connection.c
index 6ba01bf..f36ea84 100644
--- a/libswfdec/swfdec_net_connection.c
+++ b/libswfdec/swfdec_net_connection.c
@@ -28,6 +28,7 @@
 #include "swfdec_as_object.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 
 /*** SwfdecNetConnection ***/
 
diff --git a/libswfdec/swfdec_net_stream_as.c b/libswfdec/swfdec_net_stream_as.c
index 839c549..ae85908 100644
--- a/libswfdec/swfdec_net_stream_as.c
+++ b/libswfdec/swfdec_net_stream_as.c
@@ -26,6 +26,7 @@
 #include "swfdec_as_native_function.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_player_internal.h"
 
 static void
diff --git a/libswfdec/swfdec_pattern.c b/libswfdec/swfdec_pattern.c
index 53fe202..82963bc 100644
--- a/libswfdec/swfdec_pattern.c
+++ b/libswfdec/swfdec_pattern.c
@@ -72,6 +72,7 @@ struct _SwfdecColorPatternClass
   SwfdecPatternClass	pattern_class;
 };
 
+GType swfdec_color_pattern_get_type (void);
 G_DEFINE_TYPE (SwfdecColorPattern, swfdec_color_pattern, SWFDEC_TYPE_PATTERN);
 
 static cairo_pattern_t *
@@ -125,6 +126,7 @@ struct _SwfdecImagePatternClass
   SwfdecPatternClass	pattern_class;
 };
 
+GType swfdec_image_pattern_get_type (void);
 G_DEFINE_TYPE (SwfdecImagePattern, swfdec_image_pattern, SWFDEC_TYPE_PATTERN);
 
 static cairo_pattern_t *
@@ -186,6 +188,7 @@ struct _SwfdecGradientPatternClass
   SwfdecPatternClass	pattern_class;
 };
 
+GType swfdec_gradient_pattern_get_type (void);
 G_DEFINE_TYPE (SwfdecGradientPattern, swfdec_gradient_pattern, SWFDEC_TYPE_PATTERN);
 
 static cairo_pattern_t *
diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index d50e1b1..be041a2 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -34,6 +34,7 @@
 #include "swfdec_debug.h"
 #include "swfdec_enums.h"
 #include "swfdec_event.h"
+#include "swfdec_internal.h"
 #include "swfdec_listener.h"
 #include "swfdec_loader_internal.h"
 #include "swfdec_marshal.h"
@@ -685,7 +686,7 @@ swfdec_player_do_handle_mouse (SwfdecPla
 static void
 swfdec_player_iterate (SwfdecTimeout *timeout)
 {
-  SwfdecPlayer *player = SWFDEC_PLAYER ((void *) timeout - G_STRUCT_OFFSET (SwfdecPlayer, iterate_timeout));
+  SwfdecPlayer *player = SWFDEC_PLAYER ((guint8 *) timeout - G_STRUCT_OFFSET (SwfdecPlayer, iterate_timeout));
   GList *walk;
 
   SWFDEC_INFO ("=== START ITERATION ===");
@@ -1121,14 +1122,6 @@ swfdec_player_launch (SwfdecPlayer *play
   g_signal_emit (player, signals[LAUNCH], 0, url, target);
 }
 
-extern void swfdec_player_init_global (SwfdecPlayer *player, guint version);
-extern void swfdec_mouse_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_movie_color_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_net_connection_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_net_stream_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_sprite_movie_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_video_movie_init_context (SwfdecPlayer *player, guint version);
-extern void swfdec_xml_init_context (SwfdecPlayer *player, guint version);
 /**
  * swfdec_player_initialize:
  * @player: a #SwfdecPlayer
@@ -1490,14 +1483,14 @@ swfdec_player_is_initialized (SwfdecPlay
 guint
 swfdec_player_get_next_event (SwfdecPlayer *player)
 {
-  SwfdecTick time;
+  SwfdecTick tick;
   guint ret;
 
   g_return_val_if_fail (SWFDEC_IS_PLAYER (player), 0);
 
-  time = swfdec_player_get_next_event_time (player);
-  ret = SWFDEC_TICKS_TO_MSECS (time);
-  if (time % (SWFDEC_TICKS_PER_SECOND / 1000))
+  tick = swfdec_player_get_next_event_time (player);
+  ret = SWFDEC_TICKS_TO_MSECS (tick);
+  if (tick % (SWFDEC_TICKS_PER_SECOND / 1000))
     ret++;
 
   return ret;
diff --git a/libswfdec/swfdec_player_as.c b/libswfdec/swfdec_player_as.c
index bb42da1..95ee8ac 100644
--- a/libswfdec/swfdec_player_as.c
+++ b/libswfdec/swfdec_player_as.c
@@ -26,6 +26,7 @@
 #include "swfdec_as_object.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_interval.h"
 
 /*** INTERVALS ***/
diff --git a/libswfdec/swfdec_shape.c b/libswfdec/swfdec_shape.c
index 06705f0..f954314 100644
--- a/libswfdec/swfdec_shape.c
+++ b/libswfdec/swfdec_shape.c
@@ -711,7 +711,7 @@ swfdec_shape_parse_line (SwfdecBits *bit
   }
 }
 
-SubPath *
+static SubPath *
 swfdec_shape_parse_change (SwfdecSwfDecoder *s, SwfdecShape *shape, GArray *path_array, SubPath *path,
     int *x, int *y, SwfdecPatternFunc parse_fill, SwfdecStrokeFunc parse_stroke)
 {
diff --git a/libswfdec/swfdec_sound.c b/libswfdec/swfdec_sound.c
index 8c171a6..9f03af0 100644
--- a/libswfdec/swfdec_sound.c
+++ b/libswfdec/swfdec_sound.c
@@ -177,7 +177,7 @@ tag_func_define_sound (SwfdecSwfDecoder 
   return SWFDEC_STATUS_OK;
 }
 
-SwfdecBuffer *
+static SwfdecBuffer *
 swfdec_sound_get_decoded (SwfdecSound *sound, SwfdecAudioOut *format)
 {
   gpointer decoder;
diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index 20aa7a1..4b67ed5 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -74,7 +74,7 @@ swfdec_get_clipeventflags (SwfdecMovie *
   }
 }
 
-gboolean
+static gboolean
 swfdec_sprite_movie_perform_place (SwfdecSpriteMovie *movie, SwfdecBits *bits, guint tag)
 {
   SwfdecPlayer *player = SWFDEC_PLAYER (SWFDEC_AS_OBJECT (movie)->context);
@@ -185,12 +185,12 @@ swfdec_sprite_movie_perform_place (Swfde
   }
 
   if (has_filter) {
-    guint i, n_filters, id;
+    guint i, n_filters, filter_id;
     n_filters = swfdec_bits_get_u8 (bits);
     SWFDEC_LOG ("  filters: %u", n_filters);
     for (i = 0; i < n_filters && swfdec_bits_left (bits); i++) {
-      id = swfdec_bits_get_u8 (bits);
-      switch (id) {
+      filter_id = swfdec_bits_get_u8 (bits);
+      switch (filter_id) {
 	case 0:
 	  SWFDEC_WARNING ("    drop shadow");
 	  swfdec_bits_skip_bytes (bits, 16);
@@ -237,7 +237,7 @@ swfdec_sprite_movie_perform_place (Swfde
 	  }
 	  break;
 	default:
-	  SWFDEC_ERROR ("unknown filter id %u", id);
+	  SWFDEC_ERROR ("unknown filter id %u", filter_id);
 	  break;
       }
     }
diff --git a/libswfdec/swfdec_sprite_movie_as.c b/libswfdec/swfdec_sprite_movie_as.c
index e5b9954..087cfda 100644
--- a/libswfdec/swfdec_sprite_movie_as.c
+++ b/libswfdec/swfdec_sprite_movie_as.c
@@ -28,6 +28,7 @@
 #include "swfdec_bits.h"
 #include "swfdec_debug.h"
 #include "swfdec_decoder.h"
+#include "swfdec_internal.h"
 #include "swfdec_player_internal.h"
 #include "swfdec_sprite.h"
 #include "swfdec_sprite_movie.h"
diff --git a/libswfdec/swfdec_swf_instance.c b/libswfdec/swfdec_swf_instance.c
index 0196855..b45ef43 100644
--- a/libswfdec/swfdec_swf_instance.c
+++ b/libswfdec/swfdec_swf_instance.c
@@ -71,7 +71,7 @@ swfdec_swf_instance_loader_target_image 
   }
 }
 
-void
+static void
 swfdec_swf_instance_loader_target_parse (SwfdecLoaderTarget *target, SwfdecLoader *loader)
 {
   SwfdecSwfInstance *instance = SWFDEC_SWF_INSTANCE (target);
diff --git a/libswfdec/swfdec_tag.c b/libswfdec/swfdec_tag.c
index 9f56aa1..fb8dfc7 100644
--- a/libswfdec/swfdec_tag.c
+++ b/libswfdec/swfdec_tag.c
@@ -46,13 +46,13 @@
 #include "swfdec_text.h"
 #include "swfdec_video.h"
 
-int
+static int
 tag_func_end (SwfdecSwfDecoder * s, guint tag)
 {
   return SWFDEC_STATUS_OK;
 }
 
-int
+static int
 tag_func_protect (SwfdecSwfDecoder * s, guint tag)
 {
   if (s->protection) {
@@ -69,7 +69,7 @@ tag_func_protect (SwfdecSwfDecoder * s, 
   return SWFDEC_STATUS_OK;
 }
 
-int
+static int
 tag_func_frame_label (SwfdecSwfDecoder * s, guint tag)
 {
   SwfdecSpriteFrame *frame = &s->parse_sprite->frames[s->parse_sprite->parse_frame];
@@ -323,7 +323,7 @@ swfdec_button_append_content (SwfdecButt
   }
 }
 
-int
+static int
 tag_func_define_button_2 (SwfdecSwfDecoder * s, guint tag)
 {
   SwfdecBits *bits = &s->b;
@@ -411,7 +411,7 @@ tag_func_define_button_2 (SwfdecSwfDecod
   return SWFDEC_STATUS_OK;
 }
 
-int
+static int
 tag_func_define_button (SwfdecSwfDecoder * s, guint tag)
 {
   SwfdecBits *bits = &s->b;
@@ -492,7 +492,7 @@ tag_func_file_attributes (SwfdecSwfDecod
   return SWFDEC_STATUS_OK;
 }
 
-int
+static int
 tag_func_export_assets (SwfdecSwfDecoder * s, guint tag)
 {
   SwfdecBits *bits = &s->b;
@@ -525,7 +525,7 @@ tag_func_export_assets (SwfdecSwfDecoder
   return SWFDEC_STATUS_OK;
 }
 
-int
+static int
 tag_func_do_init_action (SwfdecSwfDecoder * s, guint tag)
 {
   SwfdecBits *bits = &s->b;
@@ -609,7 +609,7 @@ tag_func_do_action (SwfdecSwfDecoder * s
 #define SPRITE 1
 struct tag_func_struct
 {
-  char *name;
+  const char *name;
   SwfdecTagFunc func;
   int flag;
 };
diff --git a/libswfdec/swfdec_video_movie_as.c b/libswfdec/swfdec_video_movie_as.c
index e0fe763..e40b473 100644
--- a/libswfdec/swfdec_video_movie_as.c
+++ b/libswfdec/swfdec_video_movie_as.c
@@ -24,6 +24,7 @@
 #include "swfdec_video.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_net_stream.h"
 #include "swfdec_player_internal.h"
 
diff --git a/libswfdec/swfdec_xml_as.c b/libswfdec/swfdec_xml_as.c
index 69b7932..8159977 100644
--- a/libswfdec/swfdec_xml_as.c
+++ b/libswfdec/swfdec_xml_as.c
@@ -26,6 +26,7 @@
 #include "swfdec_as_object.h"
 #include "swfdec_as_strings.h"
 #include "swfdec_debug.h"
+#include "swfdec_internal.h"
 #include "swfdec_player_internal.h"
 
 static void
diff --git a/player/swfdec_debug_movies.c b/player/swfdec_debug_movies.c
index d2049b6..252277c 100644
--- a/player/swfdec_debug_movies.c
+++ b/player/swfdec_debug_movies.c
@@ -99,7 +99,7 @@ swfdec_debug_movies_get_iter (GtkTreeMod
   return TRUE;
 }
 
-gint
+static gint
 my_g_list_is_nth (GList *list, gpointer data)
 {
   gint count;
diff --git a/player/swfdec_player_manager.c b/player/swfdec_player_manager.c
index 2d0ece7..1ff9fbf 100644
--- a/player/swfdec_player_manager.c
+++ b/player/swfdec_player_manager.c
@@ -51,10 +51,10 @@ typedef enum {
 
 static void
 swfdec_player_manager_send_message (SwfdecPlayerManager *manager,
-    SwfdecMessageType type, char *format, ...) G_GNUC_PRINTF (3, 4);
+    SwfdecMessageType type, const char *format, ...) G_GNUC_PRINTF (3, 4);
 static void
 swfdec_player_manager_send_message (SwfdecPlayerManager *manager,
-    SwfdecMessageType type, char *format, ...)
+    SwfdecMessageType type, const char *format, ...)
 {
   va_list args;
   char *msg;
@@ -332,7 +332,7 @@ swfdec_player_manager_continue (SwfdecPl
 
 /*** commands ***/
 
-const char *
+static const char *
 parse_skip (const char *input)
 {
   g_assert (input);
@@ -341,7 +341,7 @@ parse_skip (const char *input)
   return input;
 }
 
-const char *
+static const char *
 parse_string (const char *input, char **output)
 {
   const char *start = input;
@@ -358,7 +358,7 @@ parse_string (const char *input, char **
   return parse_skip (input);
 }
 
-const char *
+static const char *
 parse_uint (const char *input, guint *output)
 {
   char *end;
diff --git a/test/dump.c b/test/dump.c
index 8d8cbd4..96109e9 100644
--- a/test/dump.c
+++ b/test/dump.c
@@ -309,7 +309,7 @@ dump_button (SwfdecButton *button)
   }
 }
 
-const char *
+static const char *
 get_image_type_name (SwfdecImageType type)
 {
   switch (type) {
@@ -377,7 +377,6 @@ dump_object (gpointer key, gpointer valu
 int
 main (int argc, char *argv[])
 {
-  char *fn = "it.swf";
   SwfdecSwfDecoder *s;
   SwfdecPlayer *player;
   GError *error = NULL;
@@ -399,8 +398,9 @@ main (int argc, char *argv[])
 
   swfdec_init();
 
-  if(argc>=2){
-	fn = argv[1];
+  if(argc < 2){
+    g_print ("usage: %s [OPTIONS] file\n", argv[0]);
+    return 0;
   }
 
   player = swfdec_player_new_from_file (argv[1]);
diff --git a/test/swfedit_tag.c b/test/swfedit_tag.c
index b69a5d5..b2f887a 100644
--- a/test/swfedit_tag.c
+++ b/test/swfedit_tag.c
@@ -88,7 +88,7 @@ swfedit_u8_write (SwfeditToken *token, g
 static gpointer
 swfedit_u8_read (SwfeditToken *token, SwfdecBits *bits, gconstpointer hint)
 {
-  return GUINT_TO_POINTER (swfdec_bits_get_u8 (bits));
+  return GUINT_TO_POINTER ((gulong) swfdec_bits_get_u8 (bits));
 }
 
 static void
@@ -397,7 +397,7 @@ swfedit_tag_changed (SwfeditToken *token
     }
   }
   if (def[i].n_items != 0) {
-    SwfeditTokenEntry *entry = &g_array_index (token->tokens, 
+    entry = &g_array_index (token->tokens, 
 	SwfeditTokenEntry, def[i].n_items - 1);
     if (entry->type == SWFEDIT_TOKEN_UINT32) {
       SwfdecOut *out = swfdec_out_open ();
diff --git a/test/swfedit_token.c b/test/swfedit_token.c
index 542da2f..dfb55db 100644
--- a/test/swfedit_token.c
+++ b/test/swfedit_token.c
@@ -521,12 +521,14 @@ static gboolean
 swfedit_token_iter_next (GtkTreeModel *tree_model, GtkTreeIter *iter)
 {
   SwfeditToken *token = SWFEDIT_TOKEN (iter->user_data);
+  int i;
 
   REPORT;
-  if ((guint) GPOINTER_TO_INT (iter->user_data2) + 1 >= token->tokens->len)
+  i = GPOINTER_TO_INT (iter->user_data2) + 1;
+  if ((guint) i >= token->tokens->len)
     return FALSE;
 
-  iter->user_data2++;
+  iter->user_data2 = GINT_TO_POINTER (i);
   return TRUE;
 }
 
diff --git a/test/trace/swfdec_interaction.c b/test/trace/swfdec_interaction.c
index 1aabb30..371d786 100644
--- a/test/trace/swfdec_interaction.c
+++ b/test/trace/swfdec_interaction.c
@@ -24,10 +24,10 @@
 #include "swfdec_interaction.h"
 
 static const GScannerConfig scanner_config = {
-  ",; \t\n",
-  G_CSET_a_2_z G_CSET_A_2_Z,
-  G_CSET_a_2_z G_CSET_A_2_Z,
-  "#\n",
+  (char *) ",; \t\n",
+  (char *) G_CSET_a_2_z G_CSET_A_2_Z,
+  (char *) G_CSET_a_2_z G_CSET_A_2_Z,
+  (char *) "#\n",
   FALSE,
   FALSE, TRUE, FALSE, TRUE, TRUE, FALSE,
   TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
@@ -81,12 +81,12 @@ swfdec_command_append_mouse (SwfdecInter
 }
 
 static void
-swfdec_command_append_wait (SwfdecInteraction *inter, int time)
+swfdec_command_append_wait (SwfdecInteraction *inter, int msecs)
 {
   SwfdecCommand command;
 
   command.command = SWFDEC_COMMAND_WAIT;
-  command.args.time = time;
+  command.args.time = msecs;
   g_array_append_val (inter->commands, command);
 }
 
diff --git a/test/trace/trace.c b/test/trace/trace.c
index 864090a..832fe1b 100644
--- a/test/trace/trace.c
+++ b/test/trace/trace.c
@@ -159,9 +159,9 @@ run_test (gpointer testp, gpointer unuse
       memcmp (buffer->data, string->str, buffer->length) != 0) {
     g_string_append (output, "  ERROR: unexpected trace output\n");
     if (g_file_set_contents ("tmp", string->str, string->len, NULL)) {
-      char *command[] = { "diff", "-u", (char *) str, "tmp", NULL };
+      const char *command[] = { "diff", "-u", str, "tmp", NULL };
       char *result;
-      if (!g_spawn_sync (NULL, command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
+      if (!g_spawn_sync (NULL, (char **) command, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
 	  &result, NULL, NULL, &error)) {
 	g_string_append_printf (output, 
 	    "  ERROR: Could not spawn diff to compare the results: %s\n", 
diff --git a/test/various/gc.c b/test/various/gc.c
index a6e378b..ebc87a8 100644
--- a/test/various/gc.c
+++ b/test/various/gc.c
@@ -33,7 +33,7 @@
 }G_STMT_END
 
 static guint
-check_strings ()
+check_strings (void)
 {
   const char *s;
   guint errors = 0;
@@ -52,7 +52,7 @@ check_strings ()
 }
 
 static guint
-check_objects ()
+check_objects (void)
 {
   SwfdecAsObject *object;
   guint errors = 0;
@@ -85,7 +85,7 @@ check_objects ()
 }
 
 static guint
-check_object_variables ()
+check_object_variables (void)
 {
   SwfdecAsObject *o, *o2;
   guint errors = 0;
diff --git a/test/various/urlencode.c b/test/various/urlencode.c
index 0899b00..46654b6 100644
--- a/test/various/urlencode.c
+++ b/test/various/urlencode.c
@@ -24,10 +24,10 @@
 #include "libswfdec/swfdec_loader_internal.h"
 
 typedef struct {
-  char *  encoded;
-  char *  names[10];
-  char *  values[10];
-  guint	  n_props;
+  const char *  encoded;
+  const char *  names[10];
+  const char *  values[10];
+  guint		n_props;
 } Test;
 Test tests[] = {
   { "a=b", { "a" }, { "b" }, 1 },
diff-tree 48cf5039491bba2226179efd482aa27f82fde84d (from 8c6d2ad08e54eefcfc0a0c50c3234d5e644470d4)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jul 16 10:49:14 2007 +0100

    fixes for warnings
    
    - make jpeg_decoder_error() take a const format
    - comment out unused code

diff --git a/libswfdec/jpeg/jpeg.c b/libswfdec/jpeg/jpeg.c
index b7398d7..e9a98ef 100644
--- a/libswfdec/jpeg/jpeg.c
+++ b/libswfdec/jpeg/jpeg.c
@@ -27,8 +27,6 @@ void jpeg_decoder_start_of_scan (JpegDec
 
 /* misc helper function declarations */
 
-static char *sprintbits (char *str, unsigned int bits, int n);
-
 static void jpeg_load_standard_huffman_tables (JpegDecoder * dec);
 
 static void jpeg_decoder_verify_header (JpegDecoder *dec);
@@ -36,7 +34,7 @@ static void jpeg_decoder_init_decoder (J
 
 
 void
-jpeg_decoder_error(JpegDecoder *dec, char *fmt, ...)
+jpeg_decoder_error(JpegDecoder *dec, const char *fmt, ...)
 {
   va_list varargs;
 
@@ -195,8 +193,23 @@ jpeg_decoder_init_decoder (JpegDecoder *
   }
 }
 
+#if 0
+static char *
+sprintbits (char *str, unsigned int bits, int n)
+{
+  int i;
+  int bit = 1 << (n - 1);
 
-void
+  for (i = 0; i < n; i++) {
+    str[i] = (bits & bit) ? '1' : '0';
+    bit >>= 1;
+  }
+  str[i] = 0;
+
+  return str;
+}
+
+static void
 generate_code_table (int *huffsize)
 {
   int code;
@@ -220,8 +233,9 @@ generate_code_table (int *huffsize)
   }
 
 }
+#endif
 
-int
+static int
 huffman_table_init_jpeg (JpegDecoder *decoder, HuffmanTable *table, JpegBits * bits)
 {
   int n_symbols;
@@ -272,7 +286,7 @@ huffman_table_init_jpeg (JpegDecoder *de
   return n;
 }
 
-int
+static int
 jpeg_decoder_find_component_by_id (JpegDecoder * dec, int id)
 {
   int i;
@@ -537,7 +551,7 @@ jpeg_decoder_free (JpegDecoder * dec)
   free (dec);
 }
 
-int
+static int
 jpeg_decoder_get_marker (JpegDecoder *dec, int *marker)
 {
   int a,b;
@@ -561,7 +575,7 @@ jpeg_decoder_get_marker (JpegDecoder *de
   return TRUE;
 }
 
-void
+static void
 jpeg_decoder_skip (JpegDecoder *dec)
 {
   int length;
@@ -1093,21 +1107,6 @@ jpeg_decoder_parse (JpegDecoder * dec)
 
 /* misc helper functins */
 
-static char *
-sprintbits (char *str, unsigned int bits, int n)
-{
-  int i;
-  int bit = 1 << (n - 1);
-
-  for (i = 0; i < n; i++) {
-    str[i] = (bits & bit) ? '1' : '0';
-    bit >>= 1;
-  }
-  str[i] = 0;
-
-  return str;
-}
-
 static void
 jpeg_load_standard_huffman_tables (JpegDecoder * dec)
 {
diff --git a/libswfdec/jpeg/jpeg.h b/libswfdec/jpeg/jpeg.h
index 9caad4c..eff4c03 100644
--- a/libswfdec/jpeg/jpeg.h
+++ b/libswfdec/jpeg/jpeg.h
@@ -159,7 +159,7 @@ unsigned char *jpeg_decoder_get_argb_ima
 int jpeg_decode_argb (uint8_t *data, int length, uint32_t **image,
     int *width, int *height);
 
-void jpeg_decoder_error(JpegDecoder *dec, char *fmt, ...);
+void jpeg_decoder_error(JpegDecoder *dec, const char *fmt, ...);
 
 int jpeg_decoder_sof_baseline_dct(JpegDecoder *dec, JpegBits *bits);
 int jpeg_decoder_define_quant_table(JpegDecoder *dec, JpegBits *bits);
diff-tree 8c6d2ad08e54eefcfc0a0c50c3234d5e644470d4 (from 72316dbdaa18559f718d6866bc96746b19beae0a)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jul 16 01:21:22 2007 +0100

    add SwfdecAlignment

diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index 7d022c0..793d347 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -108,6 +108,7 @@ SwfdecAsContextState
 SwfdecLoaderDataType
 SwfdecLoaderRequest
 swfdec_loader_data_type_get_extension
+SwfdecAlignment
 SwfdecMouseCursor
 </SECTION>
 
diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 5317d36..d50e1b1 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -99,6 +99,21 @@
  * property.
  */
 
+/**
+ * SwfdecAlignment:
+ * @SWFDEC_ALIGNMENT_TOP_LEFT: top left
+ * @SWFDEC_ALIGNMENT_TOP: top
+ * @SWFDEC_ALIGNMENT_TOP_RIGHT: top right
+ * @SWFDEC_ALIGNMENT_LEFT: left
+ * @SWFDEC_ALIGNMENT_CENTER: center
+ * @SWFDEC_ALIGNMENT_RIGHT: right
+ * @SWFDEC_ALIGNMENT_BOTTOM_LEFT: left
+ * @SWFDEC_ALIGNMENT_BOTTOM: bottom
+ * @SWFDEC_ALIGNMENT_BOTTOM_RIGHT bottom right
+ *
+ * These are the possible values for the alignment of an unscaled movie.
+ */
+
 /*** Timeouts ***/
 
 static SwfdecTick
diff --git a/libswfdec/swfdec_player.h b/libswfdec/swfdec_player.h
index f4bda6d..b4ce558 100644
--- a/libswfdec/swfdec_player.h
+++ b/libswfdec/swfdec_player.h
@@ -33,6 +33,18 @@ typedef enum {
   SWFDEC_MOUSE_CURSOR_CLICK
 } SwfdecMouseCursor;
 
+typedef enum {
+  SWFDEC_ALIGNMENT_TOP_LEFT,
+  SWFDEC_ALIGNMENT_TOP,
+  SWFDEC_ALIGNMENT_TOP_RIGHT,
+  SWFDEC_ALIGNMENT_LEFT,
+  SWFDEC_ALIGNMENT_CENTER,
+  SWFDEC_ALIGNMENT_RIGHT,
+  SWFDEC_ALIGNMENT_BOTTOM_LEFT,
+  SWFDEC_ALIGNMENT_BOTTOM,
+  SWFDEC_ALIGNMENT_BOTTOM_RIGHT
+} SwfdecAlignment;
+
 typedef struct _SwfdecPlayer SwfdecPlayer;
 typedef struct _SwfdecPlayerClass SwfdecPlayerClass;
 
diff-tree 72316dbdaa18559f718d6866bc96746b19beae0a (from be6ee2e99eaa4a2a58cdf8f217048641fd1e9511)
Author: Benjamin Otte <otte at gnome.org>
Date:   Mon Jul 16 01:20:49 2007 +0100

    remove the symbols that are gone

diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index 0fc35c3..7d022c0 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -142,9 +142,6 @@ SwfdecGtkWidget
 swfdec_gtk_widget_new
 swfdec_gtk_widget_get_player
 swfdec_gtk_widget_set_player
-swfdec_gtk_widget_get_current_scale
-swfdec_gtk_widget_get_scale
-swfdec_gtk_widget_set_scale
 swfdec_gtk_widget_get_interactive
 swfdec_gtk_widget_set_interactive
 swfdec_gtk_widget_get_renderer
@@ -270,7 +267,6 @@ SwfdecAsVariableForeach
 swfdec_as_object_foreach
 swfdec_as_object_has_function
 swfdec_as_object_call
-swfdec_as_object_run
 swfdec_as_object_add_function
 swfdec_as_object_get_debug
 swfdec_as_object_resolve
diff-tree be6ee2e99eaa4a2a58cdf8f217048641fd1e9511 (from c45ceb30a4a9c438c89423e277d8684b2e66c65c)
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Jul 15 18:37:42 2007 +0100

    fix debugging message

diff --git a/libswfdec/swfdec_movie_asprops.c b/libswfdec/swfdec_movie_asprops.c
index 80a5638..5d4e2ab 100644
--- a/libswfdec/swfdec_movie_asprops.c
+++ b/libswfdec/swfdec_movie_asprops.c
@@ -231,7 +231,7 @@ mc_width_set (SwfdecMovie *movie, const 
     return;
   d = swfdec_as_value_to_number (SWFDEC_AS_OBJECT (movie)->context, val);
   if (!isfinite (d)) {
-    SWFDEC_WARNING ("trying to set height to a non-finite value, ignoring");
+    SWFDEC_WARNING ("trying to set width to a non-finite value, ignoring");
     return;
   }
   swfdec_movie_update (movie);


More information about the Swfdec mailing list