gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash libbase/tu_config.h libbase/zlib_adapter....


From: Martin Guy
Subject: [Gnash-commit] gnash libbase/tu_config.h libbase/zlib_adapter....
Date: Wed, 02 May 2007 18:19:03 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Martin Guy <martinwguy> 07/05/02 18:19:02

Modified files:
        libbase        : tu_config.h zlib_adapter.h zlib_adapter.cpp 
        server/swf     : tag_loaders.cpp 
        server         : tools.cpp impl.cpp 
        server/parser  : movie_def_impl.cpp 
        .              : compatibility_include.h ChangeLog 

Log message:
                * 
libbase/tu_config.h,libbase/zlib_adapter.{cpp,h},server/tools.cpp,
                  
server/{impl.cpp,parser/movie_def_impl.cpp,swf/tag_loaders.cpp},
                  compatibility_include.h: eliminate TU_CONFIG_LINK_TO_ZLIB;
                  use HAVE_ZLIB_H directly.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/tu_config.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/zlib_adapter.h?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/zlib_adapter.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/server/tools.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.104&r2=1.105
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/gnash/compatibility_include.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3068&r2=1.3069

Patches:
Index: libbase/tu_config.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/tu_config.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libbase/tu_config.h 2 May 2007 17:11:42 -0000       1.14
+++ libbase/tu_config.h 2 May 2007 18:19:02 -0000       1.15
@@ -35,17 +35,6 @@
 #define tu_error_exit(error_code, error_message) { fprintf(stderr, 
error_message); std::exit(error_code); }
 #endif
 
-// define TU_CONFIG_LINK_TO_ZLIB to 0 to exclude zlib code from your
-// build.  Be aware of what you're doing -- it may break features that
-// you need!
-#ifndef TU_CONFIG_LINK_TO_ZLIB
-# ifdef HAVE_ZLIB_H
-#  define TU_CONFIG_LINK_TO_ZLIB 1
-# else
-#  define TU_CONFIG_LINK_TO_ZLIB 0
-# endif
-#endif
-
 // define TU_CONFIG_LINK_TO_LIBPNG to 0 to exclude libpng code from
 // your build.  Be aware of what you're doing -- it may break
 // features!

Index: libbase/zlib_adapter.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/zlib_adapter.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- libbase/zlib_adapter.h      10 Jan 2007 17:28:49 -0000      1.4
+++ libbase/zlib_adapter.h      2 May 2007 18:19:02 -0000       1.5
@@ -19,7 +19,7 @@
 namespace zlib_adapter
 {
        // NOTE: these functions will return NULL if
-       // TU_CONFIG_LINK_TO_ZLIB is set to 0.
+       // HAVE_ZLIB_H is not defined
 
        /// \brief
        /// Returns a read-only tu_file stream that inflates the remaining

Index: libbase/zlib_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/zlib_adapter.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libbase/zlib_adapter.cpp    17 Apr 2007 10:38:16 -0000      1.14
+++ libbase/zlib_adapter.cpp    2 May 2007 18:19:02 -0000       1.15
@@ -14,7 +14,7 @@
 #include <memory>
 
 
-#if !TU_CONFIG_LINK_TO_ZLIB
+#ifndef HAVE_ZLIB_H
 
 
 // Stubs, in case client doesn't want to link to zlib.
@@ -33,7 +33,7 @@
 }
 
 
-#else // TU_CONFIG_LINK_TO_ZLIB
+#else // HAVE_ZLIB_H
 
 
 #include <zlib.h>
@@ -339,7 +339,7 @@
        // tu_file*     make_deflater(tu_file* out) { ... }
 }
 
-#endif // TU_CONFIG_LINK_TO_ZLIB
+#endif // HAVE_ZLIB_H
 
 
 // Local Variables:

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/swf/tag_loaders.cpp  2 May 2007 17:11:42 -0000       1.95
+++ server/swf/tag_loaders.cpp  2 May 2007 18:19:02 -0000       1.96
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: tag_loaders.cpp,v 1.95 2007/05/02 17:11:42 martinwguy Exp $ */
+/* $Id: tag_loaders.cpp,v 1.96 2007/05/02 18:19:02 martinwguy Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -57,7 +57,7 @@
 #include "sound_definition.h"
 #include "PlaceObject2Tag.h"
 
-#if TU_CONFIG_LINK_TO_ZLIB
+#ifdef HAVE_ZLIB_H
 #include <zlib.h>
 #endif
 
@@ -304,7 +304,7 @@
 }
 
 
-#if TU_CONFIG_LINK_TO_ZLIB
+#ifdef HAVE_ZLIB_H
 void inflate_wrapper(tu_file* in, void* buffer, int buffer_bytes)
     // Wrapper function -- uses Zlib to uncompress in_bytes worth
     // of data from the input file into buffer_bytes worth of data
@@ -354,7 +354,7 @@
            log_error(_("inflate_wrapper() inflateEnd() return %d"), err);
     }
 }
-#endif // TU_CONFIG_LINK_TO_ZLIB
+#endif // HAVE_ZLIB_H
 
 
 // loads a define_bits_jpeg3 tag. This is a jpeg file with an alpha
@@ -378,7 +378,7 @@
     if (m->get_create_bitmaps() == DO_LOAD_BITMAPS)
     {
 
-#if TU_CONFIG_LINK_TO_ZLIB == 0
+#ifndef HAVE_ZLIB_H
        log_error(_("gnash is not linked to zlib -- can't load jpeg3 image 
data"));
        return;
 #else
@@ -434,7 +434,7 @@
     //bitmap_info*     bi = NULL;
     if (m->get_create_bitmaps() == DO_LOAD_BITMAPS)
     {
-#if TU_CONFIG_LINK_TO_ZLIB == 0
+#ifndef HAVE_ZLIB_H
        log_error(_("gnash is not linked to zlib -- can't load zipped image 
data"));
        return;
 #else
@@ -654,7 +654,7 @@
            // add image to movie, under character id.
            m->add_bitmap_character_def(character_id, ch);
        }
-#endif // TU_CONFIG_LINK_TO_ZLIB
+#endif // HAVE_ZLIB_H
 
 #if 0
     assert(bi->get_ref_count() == 0);

Index: server/tools.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/tools.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/tools.cpp    26 Aug 2006 02:08:32 -0000      1.4
+++ server/tools.cpp    2 May 2007 18:19:02 -0000       1.5
@@ -15,11 +15,6 @@
 #include "types.h"
 
 
-#if TU_CONFIG_LINK_TO_ZLIB
-//#include <zlib.h>    // for compress()
-#endif // TU_CONFIG_LINK_TO_ZLIB
-
-
 namespace gnash {
 namespace tools {
        // This struct tracks an input stream.  When you call
@@ -119,31 +114,6 @@
                };
                out->write_bytes(compressed_data, COMP_SIZE);
 
-// Here's some code to compute that at run-time.
-#if 0
-#ifdef TU_CONFIG_LINK_TO_ZLIB
-               int     buffer_bytes = 4;       // width * height * bytes/pix
-               unsigned char   buffer[4] = { 0, 0, 0, 0 };
-
-               static const int        COMPBUFSIZE = 200;
-               unsigned char   compressed_buffer[COMPBUFSIZE];
-
-               // Deflate our little dummy bitmap.
-               unsigned long   compressed_size = COMPBUFSIZE;
-               int err = compress(compressed_buffer, &compressed_size, buffer, 
sizeof(buffer));
-               if (err != Z_OK)
-               {
-                       assert(0);      // There's no good reason for this to 
fail.
-                       log_error("write_placeholder_bitmap(): compress() 
failed.\n");
-               }
-               else
-               {
-                       // Dump the compressed data into the output.
-                       out->write_bytes(compressed_buffer, compressed_size);
-               }
-#endif // TU_CONFIG_LINK_TO_ZLIB
-#endif // 0
-
                // Write the actual tag size in the slot at the beginning.
                int     end_pos = out->get_position();
                int     size = end_pos - tag_size_pos - 4;
@@ -183,11 +153,10 @@
        tu_file*        original_in = NULL;
        if (compressed)
        {
-#if TU_CONFIG_LINK_TO_ZLIB == 0
+#ifndef HAVE_ZLIB_H
                log_error("gnash can't read zipped SWF data; 
TU_CONFIG_LINK_TO_ZLIB is 0!\n");
                return -1;
-#endif
-
+#else
                IF_VERBOSE_PARSE(log_msg("file is compressed."));
                original_in = in;
 
@@ -198,6 +167,7 @@
                // it's not included in the compressed
                // stream length.
                file_end_pos = file_length - 8;
+#endif
        }
 
        stream  str(in);

Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -b -r1.104 -r1.105
--- server/impl.cpp     18 Apr 2007 09:35:42 -0000      1.104
+++ server/impl.cpp     2 May 2007 18:19:02 -0000       1.105
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: impl.cpp,v 1.104 2007/04/18 09:35:42 jgilmore Exp $ */
+/* $Id: impl.cpp,v 1.105 2007/05/02 18:19:02 martinwguy Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -275,10 +275,10 @@
     
     tu_file*   original_in = NULL;
     if (compressed) {
-#if TU_CONFIG_LINK_TO_ZLIB == 0
-       log_error(_("get_movie_info(): can't read zipped SWF data; 
TU_CONFIG_LINK_TO_ZLIB is 0"));
+#ifndef HAVE_ZLIB_H
+       log_error(_("get_movie_info(): can't read zipped SWF data; gnash was 
compiled without zlib support"));
        return;
-#endif
+#else
        original_in = in;
        
        // Uncompress the input as we read it.
@@ -288,6 +288,7 @@
        // it's not included in the compressed
        // stream length.
        file_length -= 8;
+#endif
     }
     
     stream     str(in);

Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- server/parser/movie_def_impl.cpp    18 Apr 2007 14:07:32 -0000      1.67
+++ server/parser/movie_def_impl.cpp    2 May 2007 18:19:02 -0000       1.68
@@ -439,19 +439,18 @@
 
        if (compressed)
         {
-#if TU_CONFIG_LINK_TO_ZLIB == 0
+#ifndef HAVE_ZLIB_H
                log_error(_("movie_def_impl::read(): unable to read "
-                       "zipped SWF data; TU_CONFIG_LINK_TO_ZLIB is 0"));
+                       "zipped SWF data; gnash was compiled without zlib 
support"));
                return false;
-#endif
-
+#else
                IF_VERBOSE_PARSE(
                        log_parse(_("file is compressed"));
                );
 
                // Uncompress the input as we read it.
                _in = zlib_adapter::make_inflater(_in);
-
+#endif
         }
 
        assert(_in.get());

Index: compatibility_include.h
===================================================================
RCS file: /sources/gnash/gnash/compatibility_include.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- compatibility_include.h     2 May 2007 10:30:09 -0000       1.3
+++ compatibility_include.h     2 May 2007 18:19:02 -0000       1.4
@@ -27,11 +27,6 @@
 // Some optional gameswf configuration.
 //
 
-// For disabling zlib functionality; you may be able to use
-// this in final builds of gameswf, if you preprocess all your SWF
-// content to make unpacked formats.
-// #define TU_CONFIG_LINK_TO_ZLIB 0
-
 // For enabling XML/XMLSocket functionality in gameswf, using GNOME
 // libxml2
 // #define HAVE_LIBXML 1

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3068
retrieving revision 1.3069
diff -u -b -r1.3068 -r1.3069
--- ChangeLog   2 May 2007 17:32:47 -0000       1.3068
+++ ChangeLog   2 May 2007 18:19:02 -0000       1.3069
@@ -32,8 +32,13 @@
        * gui/fb.cpp: Fix compiler warnings
        * libbase/tu_config.h,server/swf/tag_loaders.cpp: Allow compilation
          without zlib, auto-switching TU_CONFIG_LINK_TO_ZLIB on HAVE_ZLIB_H
-         (works with agg-fb; gtk etc require zlib in their own right)
+         (works with renderer=agg/opengl, gui=fb/sdl, media=gst/mad/none;
+         gtk/kde, cairo, ffmpeg require zlib in their own right)
        * configure.ac: Reformat messages
+       * libbase/tu_config.h,libbase/zlib_adapter.{cpp,h},server/tools.cpp,
+         server/{impl.cpp,parser/movie_def_impl.cpp,swf/tag_loaders.cpp},
+         compatibility_include.h: eliminate TU_CONFIG_LINK_TO_ZLIB;
+         use HAVE_ZLIB_H directly.
 
 2007-05-02 Sandro Santilli <address@hidden>
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]