gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/as_prop_flags.h server/a...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/as_prop_flags.h server/a...
Date: Tue, 22 Apr 2008 11:42:55 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/22 11:42:55

Modified files:
        .              : ChangeLog 
        server         : as_prop_flags.h 
        server/asobj   : Global.cpp 
        server/vm      : CodeStream.h 

Log message:
                * server/as_prop_flags.h: add onlySWF9Up to cleared visible 
flags
                  (copied blindly from swfdec, like much of this file). Drop
                  static const member for flags mask, as it's used exclusively
                  in Global.cpp.
                * server/asobj/Global.cpp: move flag mask here, make onlySWF9Up
                  overridable, which gives new 27 swfdec testsuite passes and
                  four failures. The only effective change is the addition
                  of onlySWF9Up to the mask; to revert, remove it.
                * testsuite/swfdec/PASSING: new passes.
                * server/vm/CodeStream.h: add brackets to shut gcc 4.3 up.
        
        I've committed this despite the fails because all the new failures
        are covered by a success in a different SWF version (i.e. it wasn't
        right before either). I'll see if I can fix them too.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6342&r2=1.6343
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_prop_flags.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Global.cpp?cvsroot=gnash&r1=1.117&r2=1.118
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/CodeStream.h?cvsroot=gnash&r1=1.6&r2=1.7

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6342
retrieving revision 1.6343
diff -u -b -r1.6342 -r1.6343
--- ChangeLog   22 Apr 2008 09:38:46 -0000      1.6342
+++ ChangeLog   22 Apr 2008 11:42:53 -0000      1.6343
@@ -1,3 +1,16 @@
+2008-04-22 Benjamin Wolsey <address@hidden>
+
+       * server/as_prop_flags.h: add onlySWF9Up to cleared visible flags
+         (copied blindly from swfdec, like much of this file). Drop
+         static const member for flags mask, as it's used exclusively
+         in Global.cpp.
+       * server/asobj/Global.cpp: move flag mask here, make onlySWF9Up
+         overridable, which gives new 27 swfdec testsuite passes and
+         four failures. The only effective change is the addition
+         of onlySWF9Up to the mask; to revert, remove it.
+       * testsuite/swfdec/PASSING: new passes.
+       * server/vm/CodeStream.h: add brackets to shut gcc 4.3 up.
+
 2008-04-22 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfc.all/: Makefile.am, button_test2.sc:

Index: server/as_prop_flags.h
===================================================================
RCS file: /sources/gnash/gnash/server/as_prop_flags.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/as_prop_flags.h      2 Apr 2008 15:50:51 -0000       1.15
+++ server/as_prop_flags.h      22 Apr 2008 11:42:54 -0000      1.16
@@ -67,14 +67,6 @@
 
        };
 
-       /// mask for flags (bits that can be set by user)
-       //
-       /// TODO: make private.
-       ///       Currently used by as_global_assetpropflags in Global.cpp
-       ///
-       static const int as_prop_flags_mask = 
dontEnum|dontDelete|readOnly|onlySWF6Up|ignoreSWF6|onlySWF7Up|onlySWF8Up;
-
-
        /// Default constructor
        as_prop_flags() : _flags(0)
        {
@@ -106,7 +98,10 @@
        }
 
        /// Get "static" flag
-       bool get_static() const { return (_flags & staticProp) ? true : false; }
+       bool get_static() const
+       {
+           return (_flags & staticProp) ? true : false;
+       }
 
        /// Set "static" flag
        void set_static() { _flags |= staticProp; }
@@ -115,7 +110,10 @@
        void clear_static() { _flags &= ~staticProp; }
 
        /// Get "read-only" flag 
-       bool get_read_only() const { return (((_flags & 
readOnly)!=0)?true:false); }
+       bool get_read_only() const
+       {
+           return (((_flags & readOnly) != 0) ? true : false);
+       }
 
        /// Set "read-only" flag 
        void set_read_only() { _flags |= readOnly; }
@@ -124,7 +122,10 @@
        void clear_read_only() { _flags &= ~readOnly; }
 
        /// Get "don't delete" flag
-       bool get_dont_delete() const { return (((_flags & 
dontDelete)!=0)?true:false); }
+       bool get_dont_delete() const
+       {
+           return (((_flags & dontDelete) != 0) ? true : false);
+       }
 
        /// Set "don't delete" flag
        void set_dont_delete() { _flags |= dontDelete; }
@@ -133,7 +134,10 @@
        void clear_dont_delete() { _flags &= ~dontDelete; }
 
        /// Get "don't enum" flag
-       bool get_dont_enum() const { return (((_flags & 
dontEnum)!=0)?true:false);      }
+       bool get_dont_enum() const
+       {
+           return (((_flags & dontEnum) != 0) ? true : false);
+       }
 
        /// Set "don't enum" flag
        void set_dont_enum() { _flags |= dontEnum; }
@@ -156,14 +160,15 @@
        {
                if ( swfVersion == 6)
                {
-                       // version 6, so let's forget 
SWFDEC_AS_VARIABLE_VERSION_7_UP flag, oops!
+                       // version 6, so let's forget onlySWF7Up flag!
                        // we will still set the value though, even if that 
flag is set
-                       _flags &= ~(onlySWF6Up|ignoreSWF6|onlySWF8Up);
+                       _flags &= 
~(onlySWF6Up|ignoreSWF6|onlySWF8Up|onlySWF9Up);
                }
                else
                {
-                       _flags &= 
~(onlySWF6Up|ignoreSWF6|onlySWF7Up|onlySWF8Up);
+                       _flags &= 
~(onlySWF6Up|ignoreSWF6|onlySWF7Up|onlySWF8Up|onlySWF9Up);
                }
+               
        }
 
        /// accesor to the numerical flags value

Index: server/asobj/Global.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Global.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -b -r1.117 -r1.118
--- server/asobj/Global.cpp     17 Apr 2008 10:22:23 -0000      1.117
+++ server/asobj/Global.cpp     22 Apr 2008 11:42:54 -0000      1.118
@@ -90,8 +90,6 @@
             log_aserror(_("%s has more than one argument"), __FUNCTION__);     
\
     )
 
-using namespace std;
-
 namespace gnash {
 
 static as_value
@@ -144,7 +142,7 @@
 {
     ASSERT_FN_ARGS_IS_1
 
-    string input = fn.arg(0).to_string();
+    std::string input = fn.arg(0).to_string();
     URL::encode(input);
     return as_value(input.c_str());
 }
@@ -162,7 +160,7 @@
 {
     ASSERT_FN_ARGS_IS_1
 
-    string input = fn.arg(0).to_string();
+    std::string input = fn.arg(0).to_string();
     URL::decode(input);
     return as_value(input.c_str());
 }
@@ -388,13 +386,22 @@
 
     // list of child names
 
-    as_value& props = fn.arg(1);
+    const as_value& props = fn.arg(1);
+
+    const int flagsMask = ( as_prop_flags::dontEnum |
+         as_prop_flags::dontDelete |
+         as_prop_flags::readOnly |
+         as_prop_flags::onlySWF6Up |
+         as_prop_flags::ignoreSWF6 |
+         as_prop_flags::onlySWF7Up |
+         as_prop_flags::onlySWF8Up |
+         as_prop_flags::onlySWF9Up);
 
     // a number which represents three bitwise flags which
     // are used to determine whether the list of child names should be hidden,
     // un-hidden, protected from over-write, un-protected from over-write,
     // protected from deletion and un-protected from deletion
-    int set_true = int(fn.arg(2).to_number()) & 
as_prop_flags::as_prop_flags_mask;
+    const int set_true = int(fn.arg(2).to_number()) & flagsMask;
 
     // Is another integer bitmask that works like set_true,
     // except it sets the attributes to false. The
@@ -402,8 +409,8 @@
 
     // ASSetPropFlags was exposed in Flash 5, however the fourth argument 
'set_false'
     // was not required as it always defaulted to the value '~0'. 
-    int set_false = (fn.nargs < 4 ? 0 : int(fn.arg(3).to_number()))
-       & as_prop_flags::as_prop_flags_mask;
+    const int set_false = (fn.nargs < 4 ? 0 : int(fn.arg(3).to_number())) &
+       flagsMask;
 
     obj->setPropFlags(props, set_false, set_true);
 

Index: server/vm/CodeStream.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/CodeStream.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/vm/CodeStream.h      21 Jan 2008 20:56:03 -0000      1.6
+++ server/vm/CodeStream.h      22 Apr 2008 11:42:55 -0000      1.7
@@ -152,8 +152,8 @@
        /// Change the current position by a relative value.
        void seekBy(int change)
        {
-               if (change > 0 && change > (mEnd - mCurrent) ||
-                       change < 0 && -change > (mCurrent - mRaw))
+               if ((change > 0 && change > (mEnd - mCurrent)) ||
+                       (change < 0 && -change > (mCurrent - mRaw)))
                        throw CodeStreamException();
                mCurrent += change;
        }




reply via email to

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