gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 53c8b87b1950d35a6c00


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 53c8b87b1950d35a6c00c4904e390ce6afb084be
Date: Thu, 09 Sep 2010 12:06:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  53c8b87b1950d35a6c00c4904e390ce6afb084be (commit)
       via  4bf35339342ec44937ffcfca562a011280dae6f9 (commit)
       via  1385353f392b49011ddf5d0495521b1f3fbac410 (commit)
       via  952a2911a0594b73661dd70bd4eb38a4aeb67063 (commit)
       via  09fa938127a54fbf6cc6c8c6b8ba8e84207d3352 (commit)
       via  810053092619555380cdfc4deeb9b6b08ee214c5 (commit)
       via  15f6441c67b8844f81374f792577eca1efef660f (commit)
       via  5079f37d921cd15cab39f517e67a070c220b1a1e (commit)
       via  ba4d239e06532f586a1e8799bcfd5649d5483068 (commit)
       via  bd4118e860c425a2f25b8e7b78208b954661cb4e (commit)
       via  dded8026e69b0fa26003e41a4418dcd6a271249d (commit)
       via  887a71a6f7cd8b139cc4119a5a2bd9c3a78ff9e5 (commit)
       via  9c520d1221749d12efed8ddaf3730b6650d48771 (commit)
       via  8e9b3a6fef92532d204de74f32ab108059fd077b (commit)
      from  a4df93876f3917989114c580a12c07bef1fb87de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=53c8b87b1950d35a6c00c4904e390ce6afb084be


commit 53c8b87b1950d35a6c00c4904e390ce6afb084be
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 13:52:43 2010 +0200

    Drop weird core dump option for sdl.

diff --git a/gui/gnash.cpp b/gui/gnash.cpp
index 64cee24..b5c286a 100644
--- a/gui/gnash.cpp
+++ b/gui/gnash.cpp
@@ -107,7 +107,6 @@ usage()
     << _("  -h,  --help              Print this help and exit\n")
     << _("  -V,  --version           Print version information and exit\n") 
     << _("  -s,  --scale <factor>    Scale the movie by the specified 
factor\n") 
-    << _("  -c                       Produce a core file instead of letting 
SDL trap it\n") 
     << _("  -d,  --delay num         Number of milliseconds to delay in main 
loop\n") 
     << _("  -v,  --verbose           Produce verbose output\n") 
 #if VERBOSE_ACTION
@@ -211,7 +210,6 @@ parseCommandLine(int argc, char* argv[], gnash::Player& 
player)
         { 256, "max-advances",      Arg_parser::yes },
         { 257, "fullscreen",        Arg_parser::no  },
         { 258, "hide-menubar",      Arg_parser::no  },                
-        { 'c', 0,                   Arg_parser::no  },
         { 'd', "delay",             Arg_parser::yes },
         { 'x', "xid",               Arg_parser::yes },
         { 'R', "renderer",          Arg_parser::yes },
diff --git a/gui/sdl/sdl.cpp b/gui/sdl/sdl.cpp
index c85c3dd..22b3460 100644
--- a/gui/sdl/sdl.cpp
+++ b/gui/sdl/sdl.cpp
@@ -23,19 +23,6 @@
 
 #include <cstdio>
 
-#if defined(_WIN32) || defined(WIN32)
-# include "getopt_win32.h"
-#else
-extern "C"{
-# ifdef HAVE_GETOPT_H
-#  include <getopt.h>
-# endif
-# ifndef __GNUC__
-  extern int getopt(int, char *const *, const char *);
-# endif
-}
-#endif // Win32
-
 #include "gnash.h"
 #include "log.h"
 #include "sdlsup.h"
@@ -156,15 +143,8 @@ SDLGui::setTimeout(unsigned int timeout)
 bool
 SDLGui::init(int argc, char **argv[])
 {
-    GNASH_REPORT_FUNCTION;
 
-    int c;
-    while ((c = getopt (argc, *argv, "m:c")) != -1) {
-        switch (c) {
-        case 'c':
-            disableCoreTrap();
-        }
-    }
+    disableCoreTrap();
 
     if (_xid) {
         char SDL_windowhack[32];
diff --git a/libbase/getopt_win32.h b/libbase/getopt_win32.h
deleted file mode 100644
index 50a6ca9..0000000
--- a/libbase/getopt_win32.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#ifndef GETOPT_WIN32_H
-#define GETOPT_WIN32_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-extern int optind;
-extern char *optarg;
-extern int optopt;
-
-int getopt (int argc, char *const argv[], char *optstring);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GETOPT_WIN32_H */

http://git.savannah.gnu.org/cgit//commit/?id=4bf35339342ec44937ffcfca562a011280dae6f9


commit 4bf35339342ec44937ffcfca562a011280dae6f9
Merge: 1385353 a4df938
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 13:46:09 2010 +0200

    Merge branch 'master' of git.sv.gnu.org:/srv/git/gnash


http://git.savannah.gnu.org/cgit//commit/?id=1385353f392b49011ddf5d0495521b1f3fbac410


commit 1385353f392b49011ddf5d0495521b1f3fbac410
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 13:35:59 2010 +0200

    Cleanup of includes.

diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 7984bf9..5d37f86 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -57,7 +57,6 @@
 #include "DisplayObjectContainer.h"
 #include "Global_as.h"
 #include "RunResources.h"
-#include "GnashImage.h"
 #include "Transform.h"
 
 #include <vector>
diff --git a/libcore/MovieFactory.cpp b/libcore/MovieFactory.cpp
index b8e5d52..3231ce1 100644
--- a/libcore/MovieFactory.cpp
+++ b/libcore/MovieFactory.cpp
@@ -18,6 +18,9 @@
 //
 
 #include "MovieFactory.h"
+
+#include "FileTypes.h"
+#include "GnashImage.h"
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "IOChannel.h"
 #include "utility.h"
diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index d7bcdb0..6e33718 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -30,15 +30,15 @@
 #include <iomanip>
 #include <memory>
 #include <string>
-#include <algorithm> // std::make_pair
+#include <algorithm> 
 
 #include "GnashSleep.h"
+#include "GnashImageJpeg.h"
 #include "smart_ptr.h" // GNASH_USE_GC
-#include "movie_definition.h" // for inheritance
+#include "movie_definition.h" 
 #include "zlib_adapter.h"
-#include "IOChannel.h" // for use
+#include "IOChannel.h"
 #include "SWFStream.h"
-#include "GnashImageJpeg.h"
 #include "RunResources.h"
 #include "Font.h"
 #include "VM.h"
@@ -608,6 +608,22 @@ SWFMovieDefinition::get_labeled_frame(const std::string& 
label,
     return true;
 }
 
+void
+SWFMovieDefinition::set_jpeg_loader(std::auto_ptr<image::JpegInput> j_in)
+{
+    if (m_jpeg_in.get()) {
+        /// There should be only one JPEGTABLES tag in an SWF (see: 
+        /// http://www.m2osw.com/en/swf_alexref.html#tag_jpegtables)
+        /// Discard any subsequent attempts to set the jpeg loader
+        /// to avoid crashing on very malformed SWFs. (No conclusive tests
+        /// for pp behaviour, though one version also crashes out on the
+        /// malformed SWF that triggers this assert in Gnash).
+        log_swferror(_("More than one JPEGTABLES tag found: not "
+                    "resetting JPEG loader"));
+        return;
+    }
+    m_jpeg_in = j_in;
+}
 
 boost::uint16_t
 SWFMovieDefinition::exportID(const std::string& symbol) const
diff --git a/libcore/parser/SWFMovieDefinition.h 
b/libcore/parser/SWFMovieDefinition.h
index 81d1f3f..9aa17c5 100644
--- a/libcore/parser/SWFMovieDefinition.h
+++ b/libcore/parser/SWFMovieDefinition.h
@@ -28,7 +28,6 @@
 #endif
 
 #include "smart_ptr.h" // GNASH_USE_GC
-#include "GnashImageJpeg.h"
 #include "movie_definition.h" // for inheritance
 #include "DefinitionTag.h" // for boost::intrusive_ptr visibility of dtor
 #include "StringPredicates.h" 
@@ -38,10 +37,10 @@
 
 #include <boost/intrusive_ptr.hpp>
 #include <vector>
-#include <map> // for CharacterDictionary
-#include <set> // for _importSources
+#include <map>
+#include <set> 
 #include <string>
-#include <memory> // for auto_ptr
+#include <memory> 
 #include <boost/thread/thread.hpp>
 #include <boost/thread/condition.hpp>
 #include <boost/thread/barrier.hpp>
@@ -49,6 +48,10 @@
 
 // Forward declarations
 namespace gnash {
+    namespace image {
+        class JpegInput;
+    }
+    class IOChannel;
     class SWFMovieDefinition;
     class SWFStream;
     class movie_root;
@@ -292,20 +295,7 @@ public:
 
     /// Set an input object for later loading DefineBits
     /// images (JPEG images without the table info).
-    void set_jpeg_loader(std::auto_ptr<image::JpegInput> j_in) {
-        if (m_jpeg_in.get()) {
-            /// There should be only one JPEGTABLES tag in an SWF (see: 
-            /// http://www.m2osw.com/en/swf_alexref.html#tag_jpegtables)
-            /// Discard any subsequent attempts to set the jpeg loader
-            /// to avoid crashing on very malformed SWFs. (No conclusive tests
-            /// for pp behaviour, though one version also crashes out on the
-            /// malformed SWF that triggers this assert in Gnash).
-            log_swferror(_("More than one JPEGTABLES tag found: not "
-                        "resetting JPEG loader"));
-            return;
-        }
-        m_jpeg_in = j_in;
-    }
+    void set_jpeg_loader(std::auto_ptr<image::JpegInput> j_in);
 
     // See dox in movie_definition.h
     image::JpegInput* get_jpeg_loader() const {
diff --git a/libcore/swf/tag_loaders.cpp b/libcore/swf/tag_loaders.cpp
index b5a6efb..7a80408 100644
--- a/libcore/swf/tag_loaders.cpp
+++ b/libcore/swf/tag_loaders.cpp
@@ -30,7 +30,9 @@
 #include <utility> // for std::make_pair
 #include <boost/static_assert.hpp>
 
-#include "IOChannel.h" // for StreamAdapter inheritance
+#include "IOChannel.h"
+#include "GnashImage.h"
+#include "GnashImageJpeg.h"
 #include "utility.h"
 #include "action_buffer.h"
 #include "Font.h"
@@ -536,8 +538,8 @@ define_bits_jpeg3_loader(SWFStream& in, TagType tag, 
movie_definition& m,
         IF_VERBOSE_PARSE(log_parse(_("No renderer, not adding bitmap")));
         return;
     }    
-    boost::intrusive_ptr<CachedBitmap> bi =
-        
renderer->createCachedBitmap(static_cast<std::auto_ptr<image::GnashImage> 
>(im));
+    boost::intrusive_ptr<CachedBitmap> bi = renderer->createCachedBitmap(
+            static_cast<std::auto_ptr<image::GnashImage> >(im));
 
     // add bitmap to movie under DisplayObject id.
     m.addBitmap(id, bi);

http://git.savannah.gnu.org/cgit//commit/?id=952a2911a0594b73661dd70bd4eb38a4aeb67063


commit 952a2911a0594b73661dd70bd4eb38a4aeb67063
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 13:17:21 2010 +0200

    Use more portable bash printf format.

diff --git a/macros/ffmpeg.m4 b/macros/ffmpeg.m4
index 93b90c0..15fa707 100644
--- a/macros/ffmpeg.m4
+++ b/macros/ffmpeg.m4
@@ -216,7 +216,7 @@ AC_DEFUN([GNASH_PATH_FFMPEG],
 
     fi
 
-    ffmpeg_num_version=`printf %2.2d%2.2d%2.2d $ffmpeg_major_version 
$ffmpeg_minor_version $ffmpeg_micro_version`
+    ffmpeg_num_version=`printf %02d%02d%02d $ffmpeg_major_version 
$ffmpeg_minor_version $ffmpeg_micro_version`
 
     AC_MSG_RESULT($ffmpeg_version ($ffmpeg_num_version))
 

http://git.savannah.gnu.org/cgit//commit/?id=09fa938127a54fbf6cc6c8c6b8ba8e84207d3352


commit 09fa938127a54fbf6cc6c8c6b8ba8e84207d3352
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 12:52:18 2010 +0200

    Fix windows version of ioctlSocket.

diff --git a/libbase/GnashSystemFDHeaders.h b/libbase/GnashSystemFDHeaders.h
index a84ab81..59e7357 100644
--- a/libbase/GnashSystemFDHeaders.h
+++ b/libbase/GnashSystemFDHeaders.h
@@ -32,7 +32,7 @@
 namespace {
 
 inline int ioctlSocket(int fd, int request, int* arg) {
-    unsigned long p = arg;
+    unsigned long p = *arg;
     const int ret = ::ioctlsocket(fd, request, &p);
     *arg = p;
     return ret;

http://git.savannah.gnu.org/cgit//commit/?id=810053092619555380cdfc4deeb9b6b08ee214c5


commit 810053092619555380cdfc4deeb9b6b08ee214c5
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 12:38:39 2010 +0200

    More portability fixes.

diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index 2ab2fb6..38e6fd7 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -72,7 +72,10 @@ Socket::connected() const
         if (ret > 0) {
             int val = 0;
             socklen_t len = sizeof(val);
-            if (::getsockopt(_socket, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {
+            // NB: the cast to char* is needed for windows and is harmless
+            // for POSIX.
+            if (::getsockopt(_socket, SOL_SOCKET, SO_ERROR,
+                        reinterpret_cast<char*>(&val), &len) < 0) {
                 log_debug("Error");
                 _error = true;
                 return false;
@@ -177,15 +180,20 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
     }
 
     // Magic timeout number. Use rcfile ?
-    struct timeval tv = { 120, 0 };
+    const struct timeval tv = { 120, 0 };
 
+    // NB: the cast to const char* is needed for windows and is harmless
+    // for POSIX.
     if (::setsockopt(_socket, SOL_SOCKET, SO_RCVTIMEO,
-                reinterpret_cast<char*>(&tv), sizeof(tv))) {
+                reinterpret_cast<const char*>(&tv), sizeof(tv))) {
         log_error("Setting socket timeout failed");
     }
 
     const int on = 1;
-    ::setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+    // NB: the cast to const char* is needed for windows and is harmless
+    // for POSIX.
+    ::setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY,
+            reinterpret_cast<const char*>(&on), sizeof(on));
 
     assert(_socket);
     return true;

http://git.savannah.gnu.org/cgit//commit/?id=15f6441c67b8844f81374f792577eca1efef660f


commit 15f6441c67b8844f81374f792577eca1efef660f
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 12:17:43 2010 +0200

    Allow windows build.

diff --git a/libbase/RTMP.cpp b/libbase/RTMP.cpp
index 12899ba..4468b34 100644
--- a/libbase/RTMP.cpp
+++ b/libbase/RTMP.cpp
@@ -19,13 +19,17 @@
 #include <cstring>
 #include <cassert>
 #include <cstdio>
-#include <unistd.h>
-
 #include <boost/lexical_cast.hpp>
 
+#include "GnashSystemNetHeaders.h"
+
 // Replace!!
-#include <sys/times.h>
-#include <netinet/in.h>
+#ifndef _WIN32
+# include <sys/times.h>
+#else
+// TODO: use uptime properly on win32.
+# include <ctime>
+#endif
 
 #include "RTMP.h"
 #include "log.h"
@@ -1260,8 +1264,12 @@ encodeInt32(boost::uint8_t *output, boost::uint8_t 
*outend, int nVal)
 boost::uint32_t
 getUptime()
 {
+#ifndef _WIN32
     struct tms t;
     return times(&t) * 1000 / sysconf(_SC_CLK_TCK);
+#else
+    return std::clock() * 100 / CLOCKS_PER_SEC;   
+#endif
 }
 
 } // anonymous namespace

http://git.savannah.gnu.org/cgit//commit/?id=5079f37d921cd15cab39f517e67a070c220b1a1e


commit 5079f37d921cd15cab39f517e67a070c220b1a1e
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 12:16:50 2010 +0200

    Commit header too.

diff --git a/libbase/Socket.h b/libbase/Socket.h
index ae5a92d..3f88f25 100644
--- a/libbase/Socket.h
+++ b/libbase/Socket.h
@@ -123,7 +123,7 @@ private:
     mutable bool _connected;
 
     /// A cache for received data.
-    boost::uint8_t _cache[16384];
+    char _cache[16384];
 
     /// The socket ID.
     int _socket;

http://git.savannah.gnu.org/cgit//commit/?id=ba4d239e06532f586a1e8799bcfd5649d5483068


commit ba4d239e06532f586a1e8799bcfd5649d5483068
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 12:15:58 2010 +0200

    Use more portable types for sockets.

diff --git a/libbase/GnashSystemNetHeaders.h b/libbase/GnashSystemNetHeaders.h
index e586601..f3a761f 100644
--- a/libbase/GnashSystemNetHeaders.h
+++ b/libbase/GnashSystemNetHeaders.h
@@ -24,6 +24,14 @@
 /// htons()
 /// ntohs()
 /// gethostname()
+/// gethostbyname()
+/// send()
+/// recv()
+/// close() (actually an FD function)
+/// socket()
+/// fcntl() (POSIX only!)
+/// inet_addr()
+/// setsockopt()
 
 #ifndef GNASH_NET_HEADERS_H
 #define GNASH_NET_HEADERS_H
@@ -45,6 +53,16 @@
 #else
 # include <unistd.h>
 # include <arpa/inet.h>
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <sys/times.h>
+# include <unistd.h>
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <fcntl.h>
+
+// gethostbyname()
+# include <netdb.h>
 #endif
 
 #endif
diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index 9f4d35d..2ab2fb6 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -17,17 +17,15 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/times.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <fcntl.h>
 
 #include <boost/cstdint.hpp>
+
+namespace {
+}
+            
+#include "GnashSystemNetHeaders.h"
+#include "GnashSystemFDHeaders.h"
+
 #include <cstring>
 #include <cerrno>
 #include <boost/lexical_cast.hpp>
@@ -37,8 +35,7 @@
 #include "log.h"
 #include "GnashAlgorithm.h"
 
-namespace gnash
-{
+namespace gnash {
 
 Socket::Socket()
     :
@@ -67,13 +64,13 @@ Socket::connected() const
         tval.tv_sec = 0;
         tval.tv_usec = 103;
             
-        const int ret = select(_socket + 1, NULL, &fdset, NULL, &tval);
+        const int ret = ::select(_socket + 1, NULL, &fdset, NULL, &tval);
         
         // Select timeout
         if (ret == 0) continue;
            
         if (ret > 0) {
-            boost::uint32_t val = 0;
+            int val = 0;
             socklen_t len = sizeof(val);
             if (::getsockopt(_socket, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {
                 log_debug("Error");
@@ -157,32 +154,37 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
         _socket = 0;
         return false;
     }
-
+#ifndef _WIN32
     // Set non-blocking.
     const int flag = ::fcntl(_socket, F_GETFL, 0);
     ::fcntl(_socket, F_SETFL, flag | O_NONBLOCK);
+#endif
 
     const struct sockaddr* a = reinterpret_cast<struct sockaddr*>(&addr);
 
     // Attempt connection
     if (::connect(_socket, a, sizeof(struct sockaddr)) < 0) {
         const int err = errno;
+#ifndef _WIN32
         if (err != EINPROGRESS) {
             log_error("Failed to connect socket: %s", std::strerror(err));
             _socket = 0;
             return false;
         }
+#else
+        return false;
+#endif
     }
 
     // Magic timeout number. Use rcfile ?
     struct timeval tv = { 120, 0 };
 
     if (::setsockopt(_socket, SOL_SOCKET, SO_RCVTIMEO,
-                reinterpret_cast<unsigned char*>(&tv), sizeof(tv))) {
+                reinterpret_cast<char*>(&tv), sizeof(tv))) {
         log_error("Setting socket timeout failed");
     }
 
-    const boost::int32_t on = 1;
+    const int on = 1;
     ::setsockopt(_socket, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
 
     assert(_socket);
@@ -204,13 +206,13 @@ Socket::fillCache()
     size_t end = (start + completeRead) % cacheSize;
     if (end == 0) end = cacheSize;
 
-    boost::uint8_t* startpos = _cache + start;
+    char* startpos = _cache + start;
 
     while (1) {
 
         // The end pos is either the end of the cache or the first 
         // unprocessed byte.
-        boost::uint8_t* endpos = _cache + ((startpos < _cache + _pos) ?
+        char* endpos = _cache + ((startpos < _cache + _pos) ?
                 _pos : cacheSize);
 
         const int thisRead = endpos - startpos;
@@ -219,14 +221,16 @@ Socket::fillCache()
         const int bytesRead = ::recv(_socket, startpos, thisRead, 0);
         
         if (bytesRead == -1) {
-            
             const int err = errno;
+#ifndef _WIN32 
             if (err == EWOULDBLOCK || err == EAGAIN) {
                 // Nothing to read. Carry on.
                 return;
             }
+#endif
             log_error("Socket receive error %s", std::strerror(err));
             _error = true;
+            return;
         }
 
 
@@ -264,7 +268,7 @@ Socket::readNonBlocking(void* dst, std::streamsize num)
 {
     if (bad()) return 0;
     
-    boost::uint8_t* ptr = static_cast<boost::uint8_t*>(dst);
+    char* ptr = static_cast<char*>(dst);
     
     if (!_size && !_error) {
         fillCache();
@@ -305,7 +309,7 @@ Socket::write(const void* src, std::streamsize num)
     int bytesSent = 0;
     int toWrite = num;
 
-    const boost::uint8_t* buf = static_cast<const boost::uint8_t*>(src);
+    const char* buf = static_cast<const char*>(src);
 
     while (toWrite > 0) {
         bytesSent = ::send(_socket, buf, toWrite, 0);

http://git.savannah.gnu.org/cgit//commit/?id=bd4118e860c425a2f25b8e7b78208b954661cb4e


commit bd4118e860c425a2f25b8e7b78208b954661cb4e
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 11:41:16 2010 +0200

    Use GnashSystemNetHeaders, drop system headers.

diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 6c015c1..8f99cbd 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -18,16 +18,16 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#include "ExternalInterface_as.h"
+
 #include <map>
 #include <vector>
 #include <sstream>
-#include <sys/ioctl.h>
-#include <sys/types.h>
 #include <boost/algorithm/string/erase.hpp>
 #include <algorithm>
+#include "GnashSystemNetHeaders.h"
 
 #include "ExternalInterface.h"
-#include "ExternalInterface_as.h"
 #include "NativeFunction.h"
 #include "StringPredicates.h"
 #include "as_object.h" // for inheritance
@@ -314,7 +314,7 @@ externalinterface_available(const fn_call& fn)
           char hostname[MAXHOSTNAMELEN];
           memset(hostname, 0, MAXHOSTNAMELEN);
           
-          if (gethostname(hostname, MAXHOSTNAMELEN) != 0) {
+          if (::gethostname(hostname, MAXHOSTNAMELEN) != 0) {
               mode = false;
           }
           

http://git.savannah.gnu.org/cgit//commit/?id=dded8026e69b0fa26003e41a4418dcd6a271249d


commit dded8026e69b0fa26003e41a4418dcd6a271249d
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 11:40:30 2010 +0200

    Move ioctl stuff out of libcore.

diff --git a/libbase/GnashSystemFDHeaders.h b/libbase/GnashSystemFDHeaders.h
index d26adf5..a84ab81 100644
--- a/libbase/GnashSystemFDHeaders.h
+++ b/libbase/GnashSystemFDHeaders.h
@@ -22,16 +22,38 @@
 // Include this file for file descriptor utilities:
 //
 // select()
+// ioctl() / ioctlsocket (use ioctlSocket())
 
 #ifndef GNASH_SYSTEM_FD_HEADERS
 #define GNASH_SYSTEM_FD_HEADERS
 
 #ifdef HAVE_WINSOCK2_H
 # include <winsock2.h>
+namespace {
+
+inline int ioctlSocket(int fd, int request, int* arg) {
+    unsigned long p = arg;
+    const int ret = ::ioctlsocket(fd, request, &p);
+    *arg = p;
+    return ret;
+}
+
+}
+
 #else
+
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <unistd.h>
+# include <sys/ioctl.h>
+
+namespace {
+
+inline int ioctlSocket(int fd, int request, int* arg) {
+    return ::ioctl(fd, request, arg);
+}
+
+}
 #endif
 
 #endif
diff --git a/libcore/ExternalInterface.cpp b/libcore/ExternalInterface.cpp
index 51b333e..ea6b1f6 100644
--- a/libcore/ExternalInterface.cpp
+++ b/libcore/ExternalInterface.cpp
@@ -18,18 +18,20 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#include "ExternalInterface.h"
+
 #include <map>
 #include <vector>
 #include <sstream>
-#include <sys/ioctl.h>
-#include <sys/types.h>
 #include <boost/algorithm/string/erase.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/scoped_array.hpp>
 #include <algorithm>
 
+#include "GnashSystemNetHeaders.h"
+#include "GnashSystemFDHeaders.h"
+
 #include "StringPredicates.h"
-#include "ExternalInterface.h"
 #include "fn_call.h"
 #include "Global_as.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
@@ -347,11 +349,7 @@ ExternalInterface::ExternalEventCheck(int fd)
 #endif
         
         int bytes = 0;
-#ifndef _WIN32
-        ioctl(fd, FIONREAD, &bytes);
-#else
         ioctlSocket(fd, FIONREAD, &bytes);
-#endif
         if (bytes == 0) {
             return error;
         }
@@ -361,7 +359,7 @@ ExternalInterface::ExternalEventCheck(int fd)
         // some memory to read the data.
         // terminate incase we want to treat the data like a string.
         buffer[bytes+1] = 0;
-        int ret = read(fd, buffer.get(), bytes);
+        const int ret = ::read(fd, buffer.get(), bytes);
         if (ret) {
             return parseInvoke(buffer.get());
         }
@@ -651,7 +649,7 @@ size_t
 ExternalInterface::writeBrowser(int fd, const std::string &data)
 {
     if (fd > 0) {
-        return write(fd, data.c_str(), data.size());
+        return ::write(fd, data.c_str(), data.size());
     }
 
     return -1;
@@ -663,6 +661,7 @@ ExternalInterface::readBrowser(int fd)
     std::string empty;
     // Wait for some data from the player
     int bytes = 0;
+
     fd_set fdset;
     FD_ZERO(&fdset);
     FD_SET(fd, &fdset);
@@ -670,13 +669,9 @@ ExternalInterface::readBrowser(int fd)
     tval.tv_sec = 10;
     tval.tv_usec = 0;
     // log_debug("Waiting for data... ");
-    if (select(fd+1, &fdset, NULL, NULL, &tval)) {
+    if (::select(fd + 1, &fdset, NULL, NULL, &tval)) {
         // log_debug("There is data in the network");
-#ifndef _WIN32
-        ioctl(fd, FIONREAD, &bytes);
-#else
         ioctlSocket(fd, FIONREAD, &bytes);
-#endif
     }  
 
     // No data yet
@@ -688,7 +683,7 @@ ExternalInterface::readBrowser(int fd)
 
     std::string buf(bytes, '\0');
 
-    int ret = read(fd, &buf[0], bytes);
+    const int ret = ::read(fd, &buf[0], bytes);
     if (ret <= 0) {
         return empty;
     }

http://git.savannah.gnu.org/cgit//commit/?id=887a71a6f7cd8b139cc4119a5a2bd9c3a78ff9e5


commit 887a71a6f7cd8b139cc4119a5a2bd9c3a78ff9e5
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 11:23:29 2010 +0200

    Use suitable system includes, fix windows build.

diff --git a/libbase/GnashSystemNetHeaders.h b/libbase/GnashSystemNetHeaders.h
index 8a08d9d..e586601 100644
--- a/libbase/GnashSystemNetHeaders.h
+++ b/libbase/GnashSystemNetHeaders.h
@@ -23,6 +23,7 @@
 //
 /// htons()
 /// ntohs()
+/// gethostname()
 
 #ifndef GNASH_NET_HEADERS_H
 #define GNASH_NET_HEADERS_H
@@ -38,9 +39,11 @@
 # include <windows.h>
 # include <io.h>
 # include <ws2tcpip.h>
+# include <fcntl.h>
 #elif defined(__amigaos4__) //maybe HAVE_NETINET_IN_H
 # include <netinet/in.h>
 #else
+# include <unistd.h>
 # include <arpa/inet.h>
 #endif
 
diff --git a/libcore/URLAccessManager.cpp b/libcore/URLAccessManager.cpp
index 3a5bdc3..154fcf3 100644
--- a/libcore/URLAccessManager.cpp
+++ b/libcore/URLAccessManager.cpp
@@ -23,7 +23,7 @@
 #include "VM.h" 
 #include "movie_root.h" 
 #include "rc.h" // for rcfile
-#include "GnashSystemIOHeaders.h"
+#include "GnashSystemNetHeaders.h"
 
 #include <cerrno> 
 #include <iostream>
@@ -67,7 +67,7 @@ accessPolicyString(AccessPolicy policy)
 //static AccessPolicy defaultAccessPolicy = GRANT;
 
 /// A cache of AccessPolicy defined for URLs
-typedef std::map< std::string, AccessPolicy > AccessPolicyCache;
+typedef std::map<std::string, AccessPolicy> AccessPolicyCache;
 
 /// A global AccessPolicyCache
 static AccessPolicyCache policyCache;
@@ -83,14 +83,13 @@ host_check_blackwhite_lists(const std::string& host)
 
        RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
-       vector<string>::iterator it;
 
-       vector<string> whitelist = rcfile.getWhiteList();
-       if ( whitelist.size() )
-       {
+       const std::vector<std::string>& whitelist = rcfile.getWhiteList();
+       if (!whitelist.empty()) {
                // TODO: case-insensitive matching ? 
-               it = std::find(whitelist.begin(), whitelist.end(), host);
-               if ( it != whitelist.end() ) {
+        std::vector<std::string>::const_iterator it =
+            std::find(whitelist.begin(), whitelist.end(), host);
+               if (it != whitelist.end()) {
                        log_security(_("Load from host %s granted 
(whitelisted)"),
                                host);
                        return true;
@@ -104,18 +103,19 @@ host_check_blackwhite_lists(const std::string& host)
                return false;
        }
 
-       vector<string> blacklist = rcfile.getBlackList();
+    const std::vector<std::string>& blacklist = rcfile.getBlackList();
+
        // TODO: case-insensitive matching ? 
-       it = std::find(blacklist.begin(), blacklist.end(), host);
-       if ( it != blacklist.end() )
-       {
+    std::vector<std::string>::const_iterator it =
+        std::find(blacklist.begin(), blacklist.end(), host);
+
+       if (it != blacklist.end()) {
                log_security(_("Load from host %s forbidden (blacklisted)"),
                        host);
                return false;
        }
 
-       log_security(_("Load from host %s granted (default)"),
-               host);
+       log_security(_("Load from host %s granted (default)"), host);
        return true;
 }
 
@@ -214,17 +214,17 @@ host_check(const std::string& host)
 
     #define MAXHOSTNAMELEN 200
     char name[MAXHOSTNAMELEN];
-    if ( -1 == gethostname(name, MAXHOSTNAMELEN) )
+    if (::gethostname(name, MAXHOSTNAMELEN) == -1)
     {
         // FIXME: strerror is NOT thread-safe
-        log_error(_("gethostname failed: %s"), strerror(errno)); 
+        log_error(_("gethostname failed: %s"), std::strerror(errno)); 
         return host_check_blackwhite_lists(host);
     }
     // From GETHOSTNAME(2): 
     // In case the NUL-terminated hostname does not fit,
     // no  error is returned, but the hostname is truncated. It is unspecified
     // whether the truncated hostname will be NUL-terminated.
-    name[MAXHOSTNAMELEN-1] = '\0'; // unlikely, still worth making sure...
+    name[MAXHOSTNAMELEN - 1] = '\0'; // unlikely, still worth making sure...
 
     // ok, let's use std::strings... we're a C++ program after all !
     std::string hostname(name); // the hostname

http://git.savannah.gnu.org/cgit//commit/?id=9c520d1221749d12efed8ddaf3730b6650d48771


commit 9c520d1221749d12efed8ddaf3730b6650d48771
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 11:17:53 2010 +0200

    Drop unneeded system includes.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 5dd139d..4d20321 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -45,8 +45,6 @@
 #include "Button.h"
 #include "Transform.h"
 
-#include <sys/ioctl.h>
-#include <sys/types.h>
 #include <boost/algorithm/string/erase.hpp>
 #include <boost/algorithm/string/replace.hpp>
 #include <utility>
@@ -56,7 +54,7 @@
 #include <map>
 #include <bitset>
 #include <cassert>
-#include <functional> // std::bind2nd, std::equal_to
+#include <functional>
 #include <boost/algorithm/string/case_conv.hpp>
 #include <boost/bind.hpp>
 

http://git.savannah.gnu.org/cgit//commit/?id=8e9b3a6fef92532d204de74f32ab108059fd077b


commit 8e9b3a6fef92532d204de74f32ab108059fd077b
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Sep 9 11:15:45 2010 +0200

    Use libjpeg's boolean type: works on windows too.

diff --git a/libbase/GnashImageJpeg.cpp b/libbase/GnashImageJpeg.cpp
index dc059f6..708e6eb 100644
--- a/libbase/GnashImageJpeg.cpp
+++ b/libbase/GnashImageJpeg.cpp
@@ -47,12 +47,6 @@ extern "C" {
 }              
 #undef HAVE_STDLIB_H
 
-#ifdef _WIN32
-typedef jpeg_boolean jpeg_bool_t;
-#else
-typedef boolean jpeg_bool_t;
-#endif
-
 namespace gnash {
 namespace image {
 
@@ -107,7 +101,7 @@ public:
 
     // Read data into our input buffer.  Client calls this
     // when it needs more data from the file.
-    static jpeg_bool_t fill_input_buffer(j_decompress_ptr cinfo)
+    static boolean fill_input_buffer(j_decompress_ptr cinfo)
     {
         rw_source_IOChannel* src = (rw_source_IOChannel*) cinfo->src;
 
@@ -511,7 +505,7 @@ public:
     }
 
     /// Write the output buffer into the stream.
-    static jpeg_bool_t empty_output_buffer(j_compress_ptr cinfo)
+    static boolean empty_output_buffer(j_compress_ptr cinfo)
     {
         rw_dest_IOChannel* dest = (rw_dest_IOChannel*) cinfo->dest;
         assert(dest);

-----------------------------------------------------------------------

Summary of changes:
 gui/gnash.cpp                                      |    2 -
 gui/sdl/sdl.cpp                                    |   22 +-------
 libbase/GnashImageJpeg.cpp                         |   10 +---
 libbase/GnashSystemFDHeaders.h                     |   22 +++++++
 libbase/GnashSystemNetHeaders.h                    |   21 +++++++
 libbase/RTMP.cpp                                   |   16 ++++-
 libbase/Socket.cpp                                 |   60 ++++++++++++--------
 libbase/Socket.h                                   |    2 +-
 libbase/getopt_win32.h                             |   20 -------
 libcore/ExternalInterface.cpp                      |   25 +++-----
 libcore/MovieClip.cpp                              |    1 -
 libcore/MovieFactory.cpp                           |    3 +
 libcore/URLAccessManager.cpp                       |   34 ++++++------
 .../asobj/flash/external/ExternalInterface_as.cpp  |    8 +-
 libcore/movie_root.cpp                             |    4 +-
 libcore/parser/SWFMovieDefinition.cpp              |   24 +++++++-
 libcore/parser/SWFMovieDefinition.h                |   26 +++------
 libcore/swf/tag_loaders.cpp                        |    8 ++-
 macros/ffmpeg.m4                                   |    2 +-
 19 files changed, 164 insertions(+), 146 deletions(-)
 delete mode 100644 libbase/getopt_win32.h


hooks/post-receive
-- 
Gnash



reply via email to

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