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


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. e69f03edd80905f52755b6db58c69e9c40133971
Date: Thu, 09 Dec 2010 13:36:30 +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  e69f03edd80905f52755b6db58c69e9c40133971 (commit)
       via  0e691321aab15455b3160b709a93458449828678 (commit)
      from  f5d7bf8e002c3299c7cb88d28e0c076b4e69c73e (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=e69f03edd80905f52755b6db58c69e9c40133971


commit e69f03edd80905f52755b6db58c69e9c40133971
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 9 14:36:39 2010 +0100

    Don't duplicate code.

diff --git a/libcore/AMFConverter.cpp b/libcore/AMFConverter.cpp
index a140734..9a3f724 100644
--- a/libcore/AMFConverter.cpp
+++ b/libcore/AMFConverter.cpp
@@ -576,18 +576,8 @@ Reader::readReference()
 as_value
 Reader::readDate()
 {
+    const double d = amf::readNumber(_pos, _end);
 
-    if (_end - _pos < 8) {
-        throw AMFException("Read past _end of buffer for date type");
-    }
-
-    double dub;
-
-    // TODO: may we avoid a copy and swapBytes call
-    //       by bitshifting b[0] trough b[7] ?
-    std::copy(_pos, _pos + 8, reinterpret_cast<char*>(&dub));
-    _pos += 8; 
-    swapBytes(&dub, 8);
 #ifdef GNASH_DEBUG_AMF_DESERIALIZE
     log_debug("amf0 read date: %e", dub);
 #endif
@@ -598,7 +588,7 @@ Reader::readDate()
     as_value date;
     if (ctor) {
         fn_call::Args args;
-        args += dub;
+        args += d;
         date = constructInstance(*ctor, as_environment(vm), args);
 
         if (_end - _pos < 2) {

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


commit 0e691321aab15455b3160b709a93458449828678
Author: Benjamin Wolsey <address@hidden>
Date:   Thu Dec 9 14:20:01 2010 +0100

    Correct log message.

diff --git a/libcore/AMFConverter.cpp b/libcore/AMFConverter.cpp
index 291a5bf..a140734 100644
--- a/libcore/AMFConverter.cpp
+++ b/libcore/AMFConverter.cpp
@@ -148,8 +148,8 @@ Writer::writeObject(as_object* obj)
     if (obj->relay()) {
         
         Date_as* date;
-        if (isNativeType(obj, date))
-        {
+        if (isNativeType(obj, date)) {
+
             double d = date->getTimeValue(); 
 #ifdef GNASH_DEBUG_AMF_SERIALIZE
             log_debug(_("amf: serializing date object "
@@ -605,8 +605,11 @@ Reader::readDate()
             throw AMFException("premature _end of input reading "
                         "timezone from Date type");
         }
-        LOG_ONCE(log_unimpl("Timezone info from AMF0 encoded Date object "
-                    "ignored"));
+        const boost::uint16_t tz = readNetworkShort(_pos);
+        if (tz != 0) {
+            log_error(_("Date type encoded timezone info %1%, even though "
+                "this field should not be used."), tz);
+        }
         _pos += 2;
     }
     return date;

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

Summary of changes:
 libcore/AMFConverter.cpp |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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