gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash libamf/amf.h libamf/amf.cpp ChangeLog


From: Martin Guy
Subject: [Gnash-commit] gnash libamf/amf.h libamf/amf.cpp ChangeLog
Date: Mon, 30 Apr 2007 17:24:15 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Martin Guy <martinwguy> 07/04/30 17:24:14

Modified files:
        libamf         : amf.h amf.cpp 
        .              : ChangeLog 

Log message:
                * libamf/amf.{h,cpp}: swapBytes is now file-local and uses 
libboost

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.h?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.cpp?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3044&r2=1.3045

Patches:
Index: libamf/amf.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- libamf/amf.h        3 Apr 2007 16:13:07 -0000       1.17
+++ libamf/amf.h        30 Apr 2007 17:24:14 -0000      1.18
@@ -175,8 +175,6 @@
     AMF(int size);
     ~AMF();
     size_t size() { return _total_size; };
-    // Swap the bytes for Little Endian machines
-    void *swapBytes(void *word, int size);
 
     // encode an element
     void *encodeElement(astype_e type, const void *in, int nbytes);

Index: libamf/amf.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- libamf/amf.cpp      25 Apr 2007 12:26:07 -0000      1.33
+++ libamf/amf.cpp      30 Apr 2007 17:24:14 -0000      1.34
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: amf.cpp,v 1.33 2007/04/25 12:26:07 martinwguy Exp $ */
+/* $Id: amf.cpp,v 1.34 2007/04/30 17:24:14 martinwguy Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -33,11 +33,11 @@
 #endif
 
 #include "log.h"
-#include "tu_swap.h"
-
 #include "amf.h"
 #include "amfutf8.h"
 
+#include <boost/detail/endian.hpp>
+
 using namespace std;
 using namespace gnash;
 
@@ -119,23 +119,13 @@
 /// anything if we happen to be on a big-endian machine.
 ///
 /// Returns its first parameter, pointing to the (maybe-byte-swapped) data.
-void *
-AMF::swapBytes(void *word, int size)
+static void *
+swapBytes(void *word, int size)
 {
-    union {
-       uint16_t s;
-       struct {
-           uint8_t c0;
-           uint8_t c1;
-       } c;
-    } u;
-          
-    u.s = 1;
-    if (u.c.c0 == 0) {
+#ifdef BOOST_BIG_ENDIAN
        // Big-endian machine: do nothing
-        return word;
-    }
-
+#else
+# ifdef BOOST_LITTLE_ENDIAN
     // Little-endian machine: byte-swap the word
 
     // A conveniently-typed pointer to the source data
@@ -165,6 +155,10 @@
        break;
       }
     }
+# else
+#  error "Unsupported host endianness"
+# endif
+#endif
 
     return word;
 }

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3044
retrieving revision 1.3045
diff -u -b -r1.3044 -r1.3045
--- ChangeLog   30 Apr 2007 17:13:00 -0000      1.3044
+++ ChangeLog   30 Apr 2007 17:24:14 -0000      1.3045
@@ -1,3 +1,10 @@
+2007-04-27 Martin Guy <address@hidden>
+
+       * libbase/tu_types.{h,cpp}, server/swf/tag_loaders.cpp:
+         Eliminate remnants of _TU_LITTLE_ENDIAN_
+       * configure.ac: Drop now-redundant endian header detection
+       * libamf/amf.{h,cpp}: swapBytes is now file-local and uses libboost
+
 2007-04-30 Sandro Santilli <address@hidden>
 
        * autogen.sh: only process configure.ac in root dir and under libltdl,




reply via email to

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