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. b60afaef20bae8a183d3


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. b60afaef20bae8a183d3f77b373fef0760cf8b1e
Date: Wed, 01 Dec 2010 11:27:25 +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  b60afaef20bae8a183d3f77b373fef0760cf8b1e (commit)
       via  2ca64b42a538274d957c7b2c6786e15d006f2250 (commit)
       via  19443da8f8bc7ed3bdbea54b604bc2aa227c45f9 (commit)
       via  e6e9d9fbeaa18cc080cc342dc77560c4aafcd7ae (commit)
       via  33838154a9eb35ee4cddb8d05406d5df7f7ee0f4 (commit)
       via  897719a010ffe7a9ac4c703bfa4c4279c9635eb9 (commit)
       via  60ec1e453916df7e010fb8481ffb057e4ef9d192 (commit)
      from  6c74c0df44c7dc9a58b489cfc90a49ebb6c93871 (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=b60afaef20bae8a183d3f77b373fef0760cf8b1e


commit b60afaef20bae8a183d3f77b373fef0760cf8b1e
Merge: 2ca64b4 6c74c0d
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Dec 1 12:27:29 2010 +0100

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


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


commit 2ca64b42a538274d957c7b2c6786e15d006f2250
Merge: e6e9d9f 19443da
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Dec 1 10:47:37 2010 +0100

    Merge branch 'master' of gitorious.org:gnash/gnash-backup


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


commit 19443da8f8bc7ed3bdbea54b604bc2aa227c45f9
Author: Sandro Santilli <address@hidden>
Date:   Wed Dec 1 10:47:04 2010 +0100

    another <cstring> include

diff --git a/libcore/parser/action_buffer.cpp b/libcore/parser/action_buffer.cpp
index fa0cdf1..30fbfbf 100644
--- a/libcore/parser/action_buffer.cpp
+++ b/libcore/parser/action_buffer.cpp
@@ -21,6 +21,7 @@
 #include "action_buffer.h"
 
 #include <string>
+#include <cstring> // for memcpy
 #include <boost/static_assert.hpp>
 
 #include "log.h"
@@ -524,7 +525,7 @@ convert_float_little(const void *p)
     switch (u.s.s0) {
 
         case 0x0000:    // little-endian host
-            std::memcpy(&u.i, p, 4);
+            std::memcpy(&u.i, p, 4); // TODO: use std::copy instead ..
             break;
         case 0x3f80:    // big-endian host
         {

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


commit e6e9d9fbeaa18cc080cc342dc77560c4aafcd7ae
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Dec 1 10:46:34 2010 +0100

    Required includes

diff --git a/libbase/utf8.cpp b/libbase/utf8.cpp
index 9cc9dc7..771ce1a 100644
--- a/libbase/utf8.cpp
+++ b/libbase/utf8.cpp
@@ -26,6 +26,7 @@
 #include <boost/cstdint.hpp>
 #include <string>
 #include <vector>
+#include <cstdlib>
 
 namespace gnash {
 namespace utf8 {
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index 76b56e1..ca3e3a9 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -26,7 +26,6 @@
 
 #include <string>
 #include <vector>
-#include <cstdlib> // std::mbstowcs
 #include <boost/scoped_array.hpp>
 #include <boost/random.hpp>
 #include <boost/lexical_cast.hpp>

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


commit 33838154a9eb35ee4cddb8d05406d5df7f7ee0f4
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Dec 1 10:43:26 2010 +0100

    Move functions to utf8.h for better implementation hiding.

diff --git a/libbase/utf8.cpp b/libbase/utf8.cpp
index 27d0175..9cc9dc7 100644
--- a/libbase/utf8.cpp
+++ b/libbase/utf8.cpp
@@ -20,11 +20,22 @@
 //
 // Much useful info at "UTF-8 and Unicode FAQ" 
http://www.cl.cam.ac.uk/~mgk25/unicode.html
 
-
 #include "utf8.h"
 
+#include <limits>
+#include <boost/cstdint.hpp>
+#include <string>
+#include <vector>
+
+namespace gnash {
+namespace utf8 {
+
+namespace {
+    const boost::uint32_t invalid = 
std::numeric_limits<boost::uint32_t>::max();
+}
+
 std::wstring
-utf8::decodeCanonicalString(const std::string& str, int version)
+decodeCanonicalString(const std::string& str, int version)
 {
     
     std::wstring wstr;
@@ -33,7 +44,7 @@ utf8::decodeCanonicalString(const std::string& str, int 
version)
     
     if (version > 5) {
         while (boost::uint32_t code = decodeNextUnicodeCharacter(it, e)) {
-            if (code == utf8::invalid) {
+            if (code == invalid) {
                 continue;        
             }
             wstr.push_back(static_cast<wchar_t>(code));
@@ -52,7 +63,7 @@ utf8::decodeCanonicalString(const std::string& str, int 
version)
 }
 
 std::string
-utf8::encodeCanonicalString(const std::wstring& wstr, int version)
+encodeCanonicalString(const std::wstring& wstr, int version)
 {
 
     std::string str;
@@ -69,7 +80,7 @@ utf8::encodeCanonicalString(const std::wstring& wstr, int 
version)
 }
 
 std::string
-utf8::encodeLatin1Character(boost::uint32_t ucsCharacter)
+encodeLatin1Character(boost::uint32_t ucsCharacter)
 {
     std::string text;
     text.push_back(static_cast<unsigned char>(ucsCharacter));
@@ -78,8 +89,8 @@ utf8::encodeLatin1Character(boost::uint32_t ucsCharacter)
 
 
 boost::uint32_t
-utf8::decodeNextUnicodeCharacter(std::string::const_iterator& it,
-                                 const std::string::const_iterator& e)
+decodeNextUnicodeCharacter(std::string::const_iterator& it,
+                             const std::string::const_iterator& e)
 {
     boost::uint32_t uc;
 
@@ -104,7 +115,7 @@ 
utf8::decodeNextUnicodeCharacter(std::string::const_iterator& it,
 #define NEXT_BYTE(shift)                        \
                     \
     if (it == e || *it == 0) return 0; /* end of buffer, do not advance */    \
-    if ((*it & 0xC0) != 0x80) return utf8::invalid; /* standard check */    \
+    if ((*it & 0xC0) != 0x80) return invalid; /* standard check */    \
     /* Post-increment iterator: */        \
     uc |= (*it++ & 0x3F) << shift;
 
@@ -118,7 +129,7 @@ 
utf8::decodeNextUnicodeCharacter(std::string::const_iterator& it,
         // Two-byte sequence.
         FIRST_BYTE(0x1F, 6);
         NEXT_BYTE(0);
-        if (uc < 0x80) return utf8::invalid;    // overlong
+        if (uc < 0x80) return invalid;    // overlong
         return uc;
     }
     else if ((*it & 0xF0) == 0xE0) {
@@ -127,7 +138,7 @@ 
utf8::decodeNextUnicodeCharacter(std::string::const_iterator& it,
         NEXT_BYTE(6);
         NEXT_BYTE(0);
         if (uc < 0x800) {
-            return utf8::invalid;
+            return invalid;
         }
         return uc;
     }
@@ -137,20 +148,20 @@ 
utf8::decodeNextUnicodeCharacter(std::string::const_iterator& it,
         NEXT_BYTE(12);
         NEXT_BYTE(6);
         NEXT_BYTE(0);
-        if (uc < 0x010000) return utf8::invalid;    // overlong
+        if (uc < 0x010000) return invalid;    // overlong
         return uc;
     }
     else {
         // Invalid.
         it++;
-        return utf8::invalid;
+        return invalid;
     }
 }
 
 // TODO: buffer as std::string; index (iterator); 
 
 std::string
-utf8::encodeUnicodeCharacter(boost::uint32_t ucs_character)
+encodeUnicodeCharacter(boost::uint32_t ucs_character)
 {
 
     std::string text;
@@ -193,7 +204,7 @@ utf8::encodeUnicodeCharacter(boost::uint32_t ucs_character)
 #define ENC_UTF16LE 3
 
 char*
-utf8::stripBOM(char* in, size_t& size, TextEncoding& encoding)
+stripBOM(char* in, size_t& size, TextEncoding& encoding)
 {
     encoding = encUNSPECIFIED;
     if ( size > 2 )
@@ -247,7 +258,7 @@ utf8::stripBOM(char* in, size_t& size, TextEncoding& 
encoding)
 }
 
 const char*
-utf8::textEncodingName(TextEncoding enc)
+textEncodingName(TextEncoding enc)
 {
     switch (enc)
     {
@@ -265,6 +276,99 @@ utf8::textEncodingName(TextEncoding enc)
     }
 }
 
+EncodingGuess
+guessEncoding(const std::string &str, int &length, std::vector<int>& offsets)
+{
+    int width = 0; // The remaining width, not the total.
+    bool is_sought = true;
+
+    std::string::const_iterator it = str.begin();
+    const std::string::const_iterator e = str.end();
+
+    length = 0;
+    
+    // First, assume it's UTF8 and try to be wrong.
+    while (it != e && is_sought) {
+        ++length;
+
+        offsets.push_back(it - str.begin()); // current position
+
+        // Advances the iterator to point to the next 
+        boost::uint32_t c = utf8::decodeNextUnicodeCharacter(it, e);
+
+        if (c == utf8::invalid) {
+            is_sought = false;
+            break;
+        }
+    }
+
+    offsets.push_back(it - str.begin()); // current position
+
+    if (it == e && is_sought) {
+        // No characters left, so it's almost certainly UTF8.
+        return ENCGUESS_UNICODE;
+    }
+
+    it = str.begin();
+    int index = 0;
+    is_sought = true;
+    width = 0;
+    length = 0;
+    bool was_odd = true;
+    bool was_even = true;
+    // Now, assume it's SHIFT_JIS and try to be wrong.
+    while (it != e && is_sought) {
+        int c = static_cast<int> (*it);
+
+        if (width) {
+            --width;
+            if ((c < 0x40) || ((c < 0x9F) && was_even) ||
+                ((c > 0x9E) && was_odd) || (c == 0x7F)) {
+                is_sought = false;
+            }
+            continue;
+        }
+
+        ++length;
+        offsets.push_back(index); // [length - 1] = index;
+
+        if ((c == 0x80) || (c == 0xA0) || (c >= 0xF0)) {
+            is_sought = false;
+            break;
+        }
+
+        if (((c >= 0x81) && (c <= 0x9F)) || ((c >= 0xE0) && (c <= 0xEF))) {
+            width = 1;
+            was_odd = c & 0x01;
+            was_even = !was_odd;
+        }
+    
+        it++;
+        index++;    
+    }
+    offsets.push_back(index); // [length - 1] = index;
+    
+    if (!width && is_sought) {
+        // No width left, so it's probably SHIFT_JIS.
+        return ENCGUESS_JIS;
+    }
+
+    // It's something else.
+#ifdef ANDROID
+    length = str.size();
+#else
+    length = std::mbstowcs(NULL, str.c_str(), 0);
+#endif
+    if (length == -1)
+    {
+        length = str.length();
+    }
+    return ENCGUESS_OTHER;
+}
+
+
+} // namespace utf8
+} // namespace gnash
 
 // Local Variables:
 // mode: C++
diff --git a/libbase/utf8.h b/libbase/utf8.h
index 982d316..98b60d1 100644
--- a/libbase/utf8.h
+++ b/libbase/utf8.h
@@ -21,12 +21,13 @@
 #ifndef UTF8_H
 #define UTF8_H
 
-#include "dsodefs.h" // For DSOEXPORT
-#include "utility.h"
 #include <string>
-
 #include <boost/cstdint.hpp> // for C99 int types
-#include <limits>
+#include <vector>
+
+#include "dsodefs.h" // For DSOEXPORT
+
+namespace gnash {
 
 /// Utilities to convert between std::string and std::wstring.
 //
@@ -55,9 +56,7 @@
 /// Please note that, although this is called utf8, what the Adobe
 /// player uses is only loosely related to real unicode, so the
 /// encoding support here is correspondingly non-standard.
-namespace utf8
-{
-    static const boost::uint32_t invalid = 
std::numeric_limits<boost::uint32_t>::max();
+namespace utf8 {
 
     /// Converts a std::string with multibyte characters into a std::wstring.
     //
@@ -89,7 +88,7 @@ namespace utf8
     /// returned, unless the returned character is '\0', in which
     /// case the iterator does not advance.
     DSOEXPORT boost::uint32_t 
decodeNextUnicodeCharacter(std::string::const_iterator& it,
-                                                         const 
std::string::const_iterator& e);
+                                                     const 
std::string::const_iterator& e);
 
     /// \brief Encodes the given wide character into a canonical
     /// string, theoretically up to 6 chars in length.
@@ -142,8 +141,27 @@ namespace utf8
 
     /// Return name of a text encoding
     DSOEXPORT const char* textEncodingName(TextEncoding enc);
-}
 
+    enum EncodingGuess {
+        ENCGUESS_UNICODE = 0,
+        ENCGUESS_JIS = 1,
+        ENCGUESS_OTHER = 2
+    };
+
+    /// Common code for guessing at the encoding of random text, between
+    // Shift-Jis, UTF8, and other. Puts the DisplayObject count in length,
+    // and the offsets to the DisplayObjects in offsets, if offsets is not 
NULL.
+    // If not NULL, offsets should be at least s.length().
+    // offsets are not accurate if the return value is GUESSENC_OTHER
+    //
+    /// TODO: It's doubtful if this even works, and it may not be useful at
+    /// all.
+    EncodingGuess guessEncoding(const std::string& s, int& length,
+            std::vector<int>& offsets);
+
+
+} // namespace utf8
+} // namespace gnash
 
 #endif // UTF8_H
 
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index a8e5e5c..76b56e1 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -96,22 +96,6 @@ namespace {
     /// @param thread           The current execution thread.
     void commonSetTarget(ActionExec& thread, const std::string& target_name);
 
-    enum as_encoding_guess_t {
-        ENCGUESS_UNICODE = 0,
-        ENCGUESS_JIS = 1,
-        ENCGUESS_OTHER = 2
-    };
-
-    /// Common code for guessing at the encoding of random text, between
-    // Shift-Jis, UTF8, and other. Puts the DisplayObject count in length,
-    // and the offsets to the DisplayObjects in offsets, if offsets is not 
NULL.
-    // If not NULL, offsets should be at least s.length().
-    // offsets are not accurate if the return value is GUESSENC_OTHER
-    //
-    /// NB It's doubtful if this even works.
-    as_encoding_guess_t guessEncoding(const std::string& s, int& length,
-            std::vector<int>& offsets);
-
     
     void ActionEnd(ActionExec& thread);
     void ActionNextFrame(ActionExec& thread);
@@ -1488,7 +1472,7 @@ ActionMbLength(ActionExec& thread)
         int length;
         std::vector<int> unused;
         unused.resize(str.length()+1);
-        guessEncoding(str, length, unused);
+        utf8::guessEncoding(str, length, unused);
         env.top(0).set_double(length);
     }
 }
@@ -1582,7 +1566,7 @@ ActionMbSubString(ActionExec& thread)
     int length = 0;
     std::vector<int> offsets;
 
-    as_encoding_guess_t encoding = guessEncoding(str, length, offsets);
+    utf8::EncodingGuess encoding = utf8::guessEncoding(str, length, offsets);
 
     if (size < 0) {
         IF_VERBOSE_ASCODING_ERRORS(
@@ -1619,7 +1603,7 @@ ActionMbSubString(ActionExec& thread)
         size = length - start;
     }
 
-    if (encoding == ENCGUESS_OTHER) {
+    if (encoding == utf8::ENCGUESS_OTHER) {
         env.top(0).set_string(str.substr(start, size));
     }
     else {
@@ -3690,96 +3674,6 @@ commonSetTarget(ActionExec& thread, const std::string& 
target_name)
     env.set_target(new_target);
 }
 
-as_encoding_guess_t
-guessEncoding(const std::string &str, int &length, std::vector<int>& offsets)
-{
-    int width = 0; // The remaining width, not the total.
-    bool is_sought = true;
-
-    std::string::const_iterator it = str.begin();
-    const std::string::const_iterator e = str.end();
-
-    length = 0;
-    
-    // First, assume it's UTF8 and try to be wrong.
-    while (it != e && is_sought) {
-        ++length;
-
-        offsets.push_back(it - str.begin()); // current position
-
-        // Advances the iterator to point to the next 
-        boost::uint32_t c = utf8::decodeNextUnicodeCharacter(it, e);
-
-        if (c == utf8::invalid) {
-            is_sought = false;
-            break;
-        }
-    }
-
-    offsets.push_back(it - str.begin()); // current position
-
-    if (it == e && is_sought) {
-        // No characters left, so it's almost certainly UTF8.
-        return ENCGUESS_UNICODE;
-    }
-
-    it = str.begin();
-    int index = 0;
-    is_sought = true;
-    width = 0;
-    length = 0;
-    bool was_odd = true;
-    bool was_even = true;
-    // Now, assume it's SHIFT_JIS and try to be wrong.
-    while (it != e && is_sought) {
-        int c = static_cast<int> (*it);
-
-        if (width) {
-            --width;
-            if ((c < 0x40) || ((c < 0x9F) && was_even) ||
-                ((c > 0x9E) && was_odd) || (c == 0x7F)) {
-                is_sought = false;
-            }
-            continue;
-        }
-
-        ++length;
-        offsets.push_back(index); // [length - 1] = index;
-
-        if ((c == 0x80) || (c == 0xA0) || (c >= 0xF0)) {
-            is_sought = false;
-            break;
-        }
-
-        if (((c >= 0x81) && (c <= 0x9F)) || ((c >= 0xE0) && (c <= 0xEF))) {
-            width = 1;
-            was_odd = c & 0x01;
-            was_even = !was_odd;
-        }
-    
-        it++;
-        index++;    
-    }
-    offsets.push_back(index); // [length - 1] = index;
-    
-    if (!width && is_sought) {
-        // No width left, so it's probably SHIFT_JIS.
-        return ENCGUESS_JIS;
-    }
-
-    // It's something else.
-#ifdef ANDROID
-    length = str.size();
-#else
-    length = std::mbstowcs(NULL, str.c_str(), 0);
-#endif
-    if (length == -1)
-    {
-        length = str.length();
-    }
-    return ENCGUESS_OTHER;
-}
-
 }
 
 

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


commit 897719a010ffe7a9ac4c703bfa4c4279c9635eb9
Author: Sandro Santilli <address@hidden>
Date:   Wed Dec 1 10:37:40 2010 +0100

    Include <cstring> for string calls

diff --git a/libmedia/gst/AudioInputGst.cpp b/libmedia/gst/AudioInputGst.cpp
index 95abdc3..c529e25 100644
--- a/libmedia/gst/AudioInputGst.cpp
+++ b/libmedia/gst/AudioInputGst.cpp
@@ -24,10 +24,12 @@
 
 #include "gst/gst.h"
 #include "AudioInputGst.h"
-#include <gst/interfaces/propertyprobe.h>
 #include "log.h"
 #include "rc.h"
 
+#include <cstring>
+#include <gst/interfaces/propertyprobe.h>
+
 namespace {
     //get rc file for default mic selection
     gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();

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


commit 60ec1e453916df7e010fb8481ffb057e4ef9d192
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Dec 1 09:40:21 2010 +0100

    Include header required for std::strerror.

diff --git a/libbase/SharedMem.cpp b/libbase/SharedMem.cpp
index cab62f1..5687121 100644
--- a/libbase/SharedMem.cpp
+++ b/libbase/SharedMem.cpp
@@ -20,6 +20,12 @@
 #include "gnashconfig.h"
 #endif
 
+#include "SharedMem.h"
+
+#include <string>
+#include <vector>
+#include <cerrno>
+#include <cstring>
 #include <sys/types.h>
 #if !defined(HAVE_WINSOCK_H) && !defined(__riscos__) && !defined(__OS2__) && 
!defined(HAIKU_HOST) && !defined(ANDROID)
 # include <sys/shm.h>
@@ -30,9 +36,6 @@
 # include <process.h>
 # include <io.h>
 #endif
-#include <string>
-#include <vector>
-#include <cerrno>
 
 #ifdef ANDROID
 # include <linux/shm.h>
@@ -47,7 +50,6 @@ extern int semctl (int __semid, int __semnum, int __cmd, ...);
 #endif
 
 #include "log.h"
-#include "SharedMem.h"
 
 #if (defined(USE_SYSV_SHM) && defined(HAVE_SHMGET)) || defined(_WIN32) || 
defined(ANDROID)
 # define ENABLE_SHARED_MEM 1

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

Summary of changes:
 libbase/SharedMem.cpp            |   10 ++-
 libbase/utf8.cpp                 |  135 +++++++++++++++++++++++++++++++++----
 libbase/utf8.h                   |   36 ++++++++---
 libcore/parser/action_buffer.cpp |    3 +-
 libcore/vm/ASHandlers.cpp        |  113 +-------------------------------
 libmedia/gst/AudioInputGst.cpp   |    4 +-
 6 files changed, 161 insertions(+), 140 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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