[Swfdec-commits] 4 commits - configure.ac doc/swfdec-docs.sgml doc/swfdec-sections.txt swfdec/.gitignore swfdec/Makefile.am swfdec/swfdec_gc_object.h swfdec/swfdec.h swfdec/swfdec_movie.c swfdec/swfdec_version.c swfdec/swfdec_version.h.in test/trace

Benjamin Otte company at kemper.freedesktop.org
Sat Sep 6 14:25:43 PDT 2008


 configure.ac                           |   17 +++
 doc/swfdec-docs.sgml                   |    1 
 doc/swfdec-sections.txt                |   13 ++
 swfdec/.gitignore                      |    1 
 swfdec/Makefile.am                     |    7 +
 swfdec/swfdec.h                        |    1 
 swfdec/swfdec_gc_object.h              |    2 
 swfdec/swfdec_movie.c                  |    2 
 swfdec/swfdec_version.c                |  174 +++++++++++++++++++++++++++++++++
 swfdec/swfdec_version.h.in             |   40 +++++++
 test/trace/Makefile.am                 |    9 +
 test/trace/crash-0.7.5-duplicate-5.swf |binary
 test/trace/crash-0.7.5-duplicate-6.swf |binary
 test/trace/crash-0.7.5-duplicate-7.swf |binary
 test/trace/crash-0.7.5-duplicate-8.swf |binary
 test/trace/crash-0.7.5-duplicate.as    |    9 +
 16 files changed, 273 insertions(+), 3 deletions(-)

New commits:
commit a6a102288fef4798fd451ad811f687181dc66d68
Author: Benjamin Otte <otte at gnome.org>
Date:   Sat Sep 6 23:22:58 2008 +0200

    add test for recent assertion fix

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index e4079ca..db3300b 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -986,6 +986,15 @@ EXTRA_DIST = \
 	crash-0.7.2-TextField-replace-infloop-8.swf \
 	crash-0.7.2-TextField-replace-infloop-8.swf.trace \
 	crash-0.7.2-TextField-replace-infloop.as \
+	crash-0.7.5-duplicate-5.swf \
+	crash-0.7.5-duplicate-5.swf.trace \
+	crash-0.7.5-duplicate-6.swf \
+	crash-0.7.5-duplicate-6.swf.trace \
+	crash-0.7.5-duplicate-7.swf \
+	crash-0.7.5-duplicate-7.swf.trace \
+	crash-0.7.5-duplicate-8.swf \
+	crash-0.7.5-duplicate-8.swf.trace \
+	crash-0.7.5-duplicate.as \
 	createEmptyMovieClip-events.sc \
 	createEmptyMovieClip-events.swf \
 	createEmptyMovieClip-events.swf.trace \
diff --git a/test/trace/crash-0.7.5-duplicate-5.swf b/test/trace/crash-0.7.5-duplicate-5.swf
new file mode 100644
index 0000000..37f444e
Binary files /dev/null and b/test/trace/crash-0.7.5-duplicate-5.swf differ
diff --git a/test/trace/crash-0.7.5-duplicate-5.swf.trace b/test/trace/crash-0.7.5-duplicate-5.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.7.5-duplicate-6.swf b/test/trace/crash-0.7.5-duplicate-6.swf
new file mode 100644
index 0000000..f5888e0
Binary files /dev/null and b/test/trace/crash-0.7.5-duplicate-6.swf differ
diff --git a/test/trace/crash-0.7.5-duplicate-6.swf.trace b/test/trace/crash-0.7.5-duplicate-6.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.7.5-duplicate-7.swf b/test/trace/crash-0.7.5-duplicate-7.swf
new file mode 100644
index 0000000..7ffdd29
Binary files /dev/null and b/test/trace/crash-0.7.5-duplicate-7.swf differ
diff --git a/test/trace/crash-0.7.5-duplicate-7.swf.trace b/test/trace/crash-0.7.5-duplicate-7.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.7.5-duplicate-8.swf b/test/trace/crash-0.7.5-duplicate-8.swf
new file mode 100644
index 0000000..a2d0f97
Binary files /dev/null and b/test/trace/crash-0.7.5-duplicate-8.swf differ
diff --git a/test/trace/crash-0.7.5-duplicate-8.swf.trace b/test/trace/crash-0.7.5-duplicate-8.swf.trace
new file mode 100644
index 0000000..e69de29
diff --git a/test/trace/crash-0.7.5-duplicate.as b/test/trace/crash-0.7.5-duplicate.as
new file mode 100644
index 0000000..9553d15
--- /dev/null
+++ b/test/trace/crash-0.7.5-duplicate.as
@@ -0,0 +1,9 @@
+// makeswf -v 7 -s 200x150 -r 1 -o crash-0.7.5-duplicate.swf crash-0.7.5-duplicate.as
+
+createEmptyMovieClip ("a", 0);
+
+onEnterFrame = function () {
+  a.duplicateMovieClip ("b", 1);
+
+  getURL ("fscommand:quit", "");
+};
commit 9171b899010013d23807d197770156c3e085a821
Author: Benjamin Otte <otte at gnome.org>
Date:   Sat Sep 6 23:15:47 2008 +0200

    check the right movie in assertion (oops)

diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index 50ba500..067fa54 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -1606,7 +1606,7 @@ swfdec_movie_duplicate (SwfdecMovie *movie, const char *name, int depth)
   }
   copy->draw_x = movie->draw_x;
   copy->draw_y = movie->draw_y;
-  g_assert (movie->cache_state >= SWFDEC_MOVIE_INVALID_EXTENTS);
+  g_assert (copy->cache_state >= SWFDEC_MOVIE_INVALID_EXTENTS);
 
   sandbox = SWFDEC_SANDBOX (swfdec_gc_object_get_context (movie)->global);
   swfdec_sandbox_unuse (sandbox);
commit f150813b9bf15b73edcffd91866a419686d7127f
Author: Benjamin Otte <otte at gnome.org>
Date:   Sat Sep 6 23:03:44 2008 +0200

    Add version information to Swfdec
    
    The idea and documentation are liberally taken from Cairo.

diff --git a/configure.ac b/configure.ac
index 28ab014..9c3ae29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,19 @@
 AC_PREREQ([2.58])
-AC_INIT(swfdec,0.7.5)
+
+m4_define(swfdec_major, 0)
+m4_define(swfdec_minor, 7)
+m4_define(swfdec_micro, 5)
+AC_INIT(swfdec,[swfdec_major.swfdec_minor.swfdec_micro])
+
+SWFDEC_VERSION_MAJOR=swfdec_major
+SWFDEC_VERSION_MINOR=swfdec_minor
+SWFDEC_VERSION_MICRO=swfdec_micro
+SWFDEC_VERSION=$SWFDEC_VERSION_MAJOR.$SWFDEC_VERSION_MINOR.$SWFDEC_VERSION_MICRO
+AC_SUBST(SWFDEC_VERSION_MAJOR)
+AC_SUBST(SWFDEC_VERSION_MINOR)
+AC_SUBST(SWFDEC_VERSION_MICRO)
+AC_SUBST(SWFDEC_VERSION)
+
 
 [is_dev=$(echo $PACKAGE_VERSION | sed 's/[0-9]\.[0-9][0-9]*\.[0-9]*[13579]/1/')]
 if test x"$is_dev" = x1 ; then
@@ -280,6 +294,7 @@ data/swfdec.pc
 data/swfdec-gtk.pc
 doc/Makefile
 swfdec/Makefile
+swfdec/swfdec_version.h
 swfdec/jpeg/Makefile
 swfdec-gtk/Makefile
 player/Makefile
diff --git a/doc/swfdec-docs.sgml b/doc/swfdec-docs.sgml
index c3bdbeb..fdffb68 100644
--- a/doc/swfdec-docs.sgml
+++ b/doc/swfdec-docs.sgml
@@ -21,6 +21,7 @@
     <xi:include href="xml/SwfdecPlayer.xml"/>
     <xi:include href="xml/SwfdecSystem.xml"/>
     <xi:include href="xml/SwfdecAudio.xml"/>
+    <xi:include href="xml/Version.xml"/>
   </chapter>
   <chapter>
     <title>extending SwfdecPlayer</title>
diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index 6ffd617..bb09427 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -272,6 +272,19 @@ swfdec_time_val_get_type
 </SECTION>
 
 <SECTION>
+<FILE>Version</FILE>
+<TITLE>Version Information</TITLE>
+SWFDEC_VERSION_MAJOR
+SWFDEC_VERSION_MICRO
+SWFDEC_VERSION_MINOR
+SWFDEC_VERSION_ENCODE
+SWFDEC_VERSION
+SWFDEC_VERSION_STRING
+swfdec_version
+swfdec_version_string
+</SECTION>
+
+<SECTION>
 <FILE>SwfdecRectangle</FILE>
 <TITLE>SwfdecRectangle</TITLE>
 SwfdecRectangle
diff --git a/swfdec/.gitignore b/swfdec/.gitignore
index bf881cd..4219f81 100644
--- a/swfdec/.gitignore
+++ b/swfdec/.gitignore
@@ -15,5 +15,6 @@ swfdec_as_strings.h
 swfdec_asnative.c
 swfdec_enums.[ch]
 swfdec_marshal.[ch]
+swfdec_version.h
 
 compiler
diff --git a/swfdec/Makefile.am b/swfdec/Makefile.am
index cd16a08..4f1e957 100644
--- a/swfdec/Makefile.am
+++ b/swfdec/Makefile.am
@@ -161,6 +161,7 @@ libswfdec_source_files = \
 	swfdec_transform_as.c \
 	swfdec_url.c \
 	swfdec_utils.c \
+	swfdec_version.c \
 	swfdec_video.c \
 	swfdec_video_decoder.c \
 	swfdec_video_decoder_screen.c \
@@ -221,6 +222,7 @@ libswfdec_ at SWFDEC_MAJORMINOR@_la_LIBADD = jpeg/libjpeg.la
 
 libswfdec_ at SWFDEC_MAJORMINOR@includedir = $(includedir)/swfdec- at SWFDEC_MAJORMINOR@/swfdec
 libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = $(public_headers) swfdec_enums.h
+nodist_libswfdec_ at SWFDEC_MAJORMINOR@include_HEADERS = swfdec_version.h
 
 noinst_HEADERS = \
 	swfdec_access.h \
@@ -340,7 +342,8 @@ EXTRA_DIST = \
 	compiler.c \
 	swfdec_as_initialize.as \
 	swfdec_initialize.as \
-	swfdec_marshal.list
+	swfdec_marshal.list \
+	swfdec_version.h.in
 
 BUILT_SOURCES = \
 	swfdec_asnative.c \
@@ -353,6 +356,8 @@ BUILT_SOURCES = \
 CLEANFILES = \
 	$(BUILT_SOURCES)
 
+DISTCLEANFILES = swfdec_version.h
+
 swfdec_asnative.c: $(libswfdec_source_files)
 	(cd $(srcdir) \
 	  && echo "#include \"swfdec_as_types.h\"" \
diff --git a/swfdec/swfdec.h b/swfdec/swfdec.h
index cc3ea1f..32b55d8 100644
--- a/swfdec/swfdec.h
+++ b/swfdec/swfdec.h
@@ -46,5 +46,6 @@
 #include <swfdec/swfdec_stream.h>
 #include <swfdec/swfdec_system.h>
 #include <swfdec/swfdec_url.h>
+#include <swfdec/swfdec_version.h>
 
 #endif
diff --git a/swfdec/swfdec_version.c b/swfdec/swfdec_version.c
new file mode 100644
index 0000000..4dc1247
--- /dev/null
+++ b/swfdec/swfdec_version.c
@@ -0,0 +1,174 @@
+/* Swfdec
+ * Copyright (C) 2008 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
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "swfdec_version.h"
+
+
+/**
+ * SECTION:Version
+ * @title: Version Information
+ * @short_description: Compile-time and run-time version checks
+ *
+ * Swfdec has a three-part version number scheme. In this scheme, we use
+ * even vs. odd numbers to distinguish fixed points in the software vs. 
+ * in-progress development, (such as from git instead of a tar file, or as a 
+ * "snapshot" tar file as opposed to a "release" tar file).
+ *
+ * <informalexample><programlisting>
+ *  _____ Major. Always 1, until we invent a new scheme.
+ * /  ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (git)
+ * | /  _ Micro. Even/Odd = Tar-file/git
+ * | | /
+ * 1.0.0
+ * </programlisting></informalexample>
+ *
+ * Here are a few examples of versions that one might see.
+ * <informalexample><programlisting>
+ * Releases
+ * --------
+ *  1.0.0 - A major release
+ *  1.0.2 - A subsequent maintenance release
+ *  1.2.0 - Another major release
+ *
+ * Snapshots
+ * ---------
+ *  1.1.2 - A snapshot (working toward the 1.2.0 release)
+ *
+ * In-progress development (eg. from git)
+ * --------------------------------------
+ *  1.0.1 - Development on a maintenance branch (toward 1.0.2 release)
+ *  1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release)
+ *  </programlisting></informalexample>
+ *
+ * <refsect2><title>Examining the version</title><para>
+ * Swfdec provides the ability to examine the version at either 
+ * compile-time or run-time and in both a human-readable form as well as an 
+ * encoded form suitable for direct comparison. Swfdec also provides the macro 
+ * SWFDEC_VERSION_ENCODE() to perform the encoding.
+ *
+ * <informalexample><programlisting>
+ * Compile-time
+ * ------------
+ *  SWFDEC_VERSION_STRING	Human-readable
+ *  SWFDEC_VERSION		Encoded, suitable for comparison
+ *
+ * Run-time
+ * --------
+ *  swfdec_version_string()	Human-readable
+ *  swfdec_version()		Encoded, suitable for comparison
+ * </programlisting></informalexample>
+ *  
+ * For example, checking that the Swfdec version is greater than or equal
+ * to 1.0.0 could be achieved at compile-time or run-time as follows:
+ * <informalexample><programlisting>
+ * #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 0, 0)
+ * printf ("Compiling with suitable cairo version: %s\n", %CAIRO_VERSION_STRING);
+ * #endif
+ *
+ * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0))
+ *   printf ("Running with suitable cairo version: %s\n", cairo_version_string ());
+ * </programlisting></informalexample>
+ * </para></refsect2>
+ */
+/**
+ * SWFDEC_VERSION:
+ *
+ * The version of Swfdec available at compile-time, encoded using 
+ * SWFDEC_VERSION_ENCODE(). 
+ */
+/**
+ * SWFDEC_VERSION_MAJOR:
+ *
+ * The major component of the version of Swfdec available at compile-time.
+ */
+/**
+ * SWFDEC_VERSION_MINOR:
+ *
+ * The minor component of the version of Swfdec available at compile-time.
+ */
+/**
+ * SWFDEC_VERSION_MICRO:
+ *
+ * The micro component of the version of Swfdec available at compile-time.
+ */
+/**
+ * SWFDEC_VERSION_STRING:
+ *
+ * A human-readable string literal containing the version of Swfdec available 
+ * at compile-time, in the form of "X.Y.Z".
+ */
+/**
+ * SWFDEC_VERSION_ENCODE:
+ * @major: the major component of the version number
+ * @minor: the minor component of the version number
+ * @micro: the micro component of the version number 
+ *
+ * This macro encodes the given Swfdec version into an integer. The numbers 
+ * returned by @SWFDEC_VERSION and swfdec_version() are encoded using this 
+ * macro. Two encoded version numbers can be compared as integers. The 
+ * encoding ensures that later versions compare greater than earlier versions.
+ */
+
+#define SWFDEC_VERSION SWFDEC_VERSION_ENCODE (SWFDEC_VERSION_MAJOR, SWFDEC_VERSION_MINOR, SWFDEC_VERSION_MICRO)
+
+/**
+ * swfdec_version:
+ *
+ * Returns the version of the Swfdec library encoded in a single
+ * integer as per %SWFDEC_VERSION_ENCODE. The encoding ensures that
+ * later versions compare greater than earlier versions.
+ *
+ * A run-time comparison to check that Swfdec's version is greater than
+ * or equal to version X.Y.Z could be performed as follows:
+ *
+ * <informalexample><programlisting>
+ * if (swfdec_version() >= CAIRO_VERSION_ENCODE(X,Y,Z)) {...}
+ * </programlisting></informalexample>
+ *
+ * See also swfdec_version_string() as well as the compile-time
+ * equivalents %SWFDEC_VERSION and %SWFDEC_VERSION_STRING.
+ *
+ * Return value: the encoded version.
+ **/
+guint
+swfdec_version (void)
+{
+  return SWFDEC_VERSION;
+}
+
+/**
+ * swfdec_version_string:
+ *
+ * Returns the version of the Swfdec library as a human-readable string
+ * of the form "X.Y.Z".
+ *
+ * See also swfdec_version() as well as the compile-time equivalents
+ * %SWFDEC_VERSION_STRING and %SWFDEC_VERSION.
+ *
+ * Return value: a string containing the version.
+ **/
+const char *
+swfdec_version_string (void)
+{
+  return SWFDEC_VERSION_STRING;
+}
diff --git a/swfdec/swfdec_version.h.in b/swfdec/swfdec_version.h.in
new file mode 100644
index 0000000..d58b6f1
--- /dev/null
+++ b/swfdec/swfdec_version.h.in
@@ -0,0 +1,40 @@
+/* Swfdec
+ * Copyright (C) 2008 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_VERSION_H__
+#define __SWFDEC_VERSION_H__
+
+
+#include <glib.h>
+
+#define SWFDEC_VERSION_MAJOR (@SWFDEC_VERSION_MAJOR@)
+#define SWFDEC_VERSION_MINOR (@SWFDEC_VERSION_MINOR@)
+#define SWFDEC_VERSION_MICRO (@SWFDEC_VERSION_MICRO@)
+
+#define SWFDEC_VERSION_STRING "@SWFDEC_VERSION@"
+
+#define SWFDEC_VERSION_ENCODE(major, minor, micro) \
+    ((major) * 1000 * 1000 + (minor) * 1000 + (micro))
+
+#define SWFDEC_VERSION SWFDEC_VERSION_ENCODE (SWFDEC_VERSION_MAJOR, SWFDEC_VERSION_MINOR, SWFDEC_VERSION_MICRO)
+
+guint		swfdec_version		(void);
+const char *	swfdec_version_string	(void);
+
+#endif
commit 74cecdb1df8102fb797672e8c54177bdfb8e7ea0
Author: Benjamin Otte <otte at gnome.org>
Date:   Sat Sep 6 22:57:14 2008 +0200

    fix for docs

diff --git a/swfdec/swfdec_gc_object.h b/swfdec/swfdec_gc_object.h
index 8bf0138..8553165 100644
--- a/swfdec/swfdec_gc_object.h
+++ b/swfdec/swfdec_gc_object.h
@@ -44,8 +44,10 @@ struct _SwfdecGcObject {
 };
 
 struct _SwfdecGcObjectClass {
+  /*< private >*/
   GObjectClass		object_class;
 
+  /*< public >*/
   /* mark everything that should survive during GC */
   void			(* mark)			(SwfdecGcObject *	object);
 };


More information about the Swfdec-commits mailing list