[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r12267: Formatting and cleanups only
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r12267: Formatting and cleanups only: no functional changes. |
Date: |
Tue, 22 Jun 2010 08:46:53 +0200 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 12267 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2010-06-22 08:46:53 +0200
message:
Formatting and cleanups only: no functional changes.
Drop unused members, drop duplicated functionality. Fix indentation in
fn_call.h.
modified:
gui/gui.cpp
libcore/Button.cpp
libcore/Button.h
libcore/SWFRect.h
libcore/asobj/AsBroadcaster.cpp
libcore/asobj/Globals.cpp
libcore/vm/fn_call.h
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp 2010-05-21 01:26:20 +0000
+++ b/gui/gui.cpp 2010-06-22 06:15:01 +0000
@@ -1067,11 +1067,11 @@
SWFRect bounds;
if (full.isFinite()) {
- bounds = SWFRect(full.getMinX(), full.getMinY(), full.getMaxX(),
full.getMaxY());
- } else {
- if (full.isWorld()) {
- bounds.set_world();
- }
+ bounds = SWFRect(full.getMinX(), full.getMinY(),
+ full.getMaxX(), full.getMaxY());
+ }
+ else if (full.isWorld()) {
+ bounds.set_world();
}
setInvalidatedRegion(bounds);
=== modified file 'libcore/Button.cpp'
--- a/libcore/Button.cpp 2010-06-18 12:26:04 +0000
+++ b/libcore/Button.cpp 2010-06-22 06:03:32 +0000
@@ -289,8 +289,6 @@
DisplayObject* parent)
:
InteractiveObject(object, parent),
- _lastMouseFlags(FLAG_IDLE),
- _mouseFlags(FLAG_IDLE),
_mouseState(MOUSESTATE_UP),
_def(def)
{
=== modified file 'libcore/Button.h'
--- a/libcore/Button.h 2010-06-18 12:26:04 +0000
+++ b/libcore/Button.h 2010-06-22 06:03:32 +0000
@@ -185,8 +185,6 @@
/// Return version of the SWF containing the button definition.
virtual int getDefinitionVersion() const;
- int _lastMouseFlags, _mouseFlags;
-
MouseState _mouseState;
const boost::intrusive_ptr<const SWF::DefineButtonTag> _def;
=== modified file 'libcore/SWFRect.h'
--- a/libcore/SWFRect.h 2010-03-11 20:01:11 +0000
+++ b/libcore/SWFRect.h 2010-06-22 06:15:01 +0000
@@ -110,7 +110,7 @@
&& _xMax == (rectMax >> 9)
&& _yMax == (rectMax >> 9);
}
-
+
/// set the rectangle to the WORLD value
void set_world()
{
@@ -202,7 +202,8 @@
void enclose_transformed_rect(const SWFMatrix& m, const SWFRect& r);
/// Expand this rectangle to enclose the given circle.
- void expand_to_circle(boost::int32_t x, boost::int32_t y, boost::int32_t
radius)
+ void expand_to_circle(boost::int32_t x, boost::int32_t y,
+ boost::int32_t radius)
{
// I know it's easy to make code work for minus radius.
// would do that untill I see the requirement for a SWF RECTANGLE.
@@ -220,9 +221,10 @@
}
}
- /// Same as enclose_transformed_rect but expanding the current SWFRect
instead
- /// of replacing it.
- DSOEXPORT void expand_to_transformed_rect(const SWFMatrix& m, const
SWFRect& r);
+ /// Same as enclose_transformed_rect but expanding the current SWFRect
+ /// instead of replacing it.
+ DSOEXPORT void expand_to_transformed_rect(const SWFMatrix& m,
+ const SWFRect& r);
/// Makes union of the given and the current SWFRect
DSOEXPORT void expand_to_rect(const SWFRect& r);
@@ -241,15 +243,16 @@
if (is_null())
{
// Range2d has a differnt idea about what is a null SWFRect.
- return geometry::Range2d<boost::int32_t>(geometry::nullRange);
//null range
+ return geometry::Range2d<boost::int32_t>(geometry::nullRange);
}
else if( is_world() )
{
- return geometry::Range2d<boost::int32_t>(geometry::worldRange);
//world range
+ return geometry::Range2d<boost::int32_t>(geometry::worldRange);
}
else
{
- return geometry::Range2d<boost::int32_t>(_xMin, _yMin, _xMax,
_yMax);
+ return geometry::Range2d<boost::int32_t>(_xMin, _yMin,
+ _xMax, _yMax);
}
}
@@ -257,7 +260,7 @@
std::string toString() const;
private:
-
+
// make ourself to enclose the given point.
void expand_to(boost::int32_t x, boost::int32_t y)
{
@@ -267,8 +270,6 @@
_yMax = std::max(_yMax, y);
}
-private:
-
boost::int32_t _xMin; // TWIPS
boost::int32_t _yMin; // TWIPS
boost::int32_t _xMax; // TWIPS
@@ -279,13 +280,14 @@
inline std::ostream&
operator<< (std::ostream& os, const SWFRect& r)
{
- if( !r.is_null() ) {
+ if (!r.is_null()) {
os << "RECT("
<< r.get_x_min() << ","
<< r.get_y_min() << ","
<< r.get_x_max() << ","
<< r.get_y_max() << ")";
- }else {
+ }
+ else {
os << "NULL RECT!";
}
=== modified file 'libcore/asobj/AsBroadcaster.cpp'
--- a/libcore/asobj/AsBroadcaster.cpp 2010-03-21 20:19:43 +0000
+++ b/libcore/asobj/AsBroadcaster.cpp 2010-06-22 06:03:51 +0000
@@ -245,11 +245,11 @@
// inheritance chain in case it's own property _listeners
// has been deleted while another one is found in any base
// class.
- if ( ! obj->get_member(NSV::PROP_uLISTENERS, &listenersValue) )
- {
+ if (!obj->get_member(NSV::PROP_uLISTENERS, &listenersValue)) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("%p.addListener(%s): this object has no _listeners "
- "member"), (void*)fn.this_ptr, fn.dump_args());
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("%p.addListener(%s): this object has no "
+ "_listeners member"), (void*)fn.this_ptr, ss.str());
);
return as_value(true); // odd, but seems the case..
}
@@ -258,8 +258,9 @@
if (!listenersValue.is_object())
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("%p.addListener(%s): this object's _listener isn't "
- "an object: %s"), (void*)fn.this_ptr, fn.dump_args(),
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("%p.addListener(%s): this object's _listener isn't "
+ "an object: %s"), (void*)fn.this_ptr, ss.str(),
listenersValue);
);
// TODO: check this
@@ -292,8 +293,9 @@
if (!obj->get_member(NSV::PROP_uLISTENERS, &listenersValue) )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("%p.addListener(%s): this object has no _listeners "
- "member"), (void*)fn.this_ptr, fn.dump_args());
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("%p.addListener(%s): this object has no _listeners "
+ "member"), (void*)fn.this_ptr, ss.str());
);
return as_value(false); // TODO: check this
}
@@ -302,8 +304,9 @@
if ( ! listenersValue.is_object() )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("%p.addListener(%s): this object's _listener isn't "
- "an object: %s"), (void*)fn.this_ptr, fn.dump_args(),
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("%p.addListener(%s): this object's _listener isn't "
+ "an object: %s"), (void*)fn.this_ptr, ss.str(),
listenersValue);
);
return as_value(false); // TODO: check this
@@ -353,8 +356,9 @@
// class.
if (!obj->get_member(NSV::PROP_uLISTENERS, &listenersValue)) {
IF_VERBOSE_ASCODING_ERRORS(
+ std::ostringstream ss; fn.dump_args(ss);
log_aserror(_("%p.addListener(%s): this object has no "
- "_listeners member"), obj, fn.dump_args());
+ "_listeners member"), obj, ss.str());
);
return as_value(); // TODO: check this
}
@@ -363,9 +367,10 @@
if ( ! listenersValue.is_object() )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("%p.addListener(%s): this object's _listener "
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("%p.addListener(%s): this object's _listener "
"isn't an object: %s"), (void*)fn.this_ptr,
- fn.dump_args(), listenersValue);
+ ss.str(), listenersValue);
);
return as_value(); // TODO: check this
}
=== modified file 'libcore/asobj/Globals.cpp'
--- a/libcore/asobj/Globals.cpp 2010-06-04 09:39:05 +0000
+++ b/libcore/asobj/Globals.cpp 2010-06-22 06:03:51 +0000
@@ -1015,11 +1015,11 @@
global_asconstructor(const fn_call& fn)
{
- if (fn.nargs < 2)
- {
+ if (fn.nargs < 2) {
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("ASNative(%s): needs at least two arguments"),
- fn.dump_args());
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("ASNative(%s): needs at least two arguments"),
+ ss.str());
)
return as_value();
}
@@ -1029,8 +1029,9 @@
if (sx < 0 || sy < 0) {
IF_VERBOSE_ASCODING_ERRORS(
+ std::ostringstream ss; fn.dump_args(ss);
log_aserror(_("ASconstructor(%s): args must be 0 or above"),
- fn.dump_args());
+ ss.str());
)
return as_value();
}
@@ -1061,8 +1062,9 @@
if (fn.nargs < 2)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("ASNative(%s): needs at least two arguments"),
- fn.dump_args());
+ std::ostringstream ss; fn.dump_args(ss);
+ log_aserror(_("ASNative(%s): needs at least two arguments"),
+ ss.str());
)
return as_value();
}
@@ -1072,8 +1074,9 @@
if (sx < 0 || sy < 0) {
IF_VERBOSE_ASCODING_ERRORS(
+ std::ostringstream ss; fn.dump_args(ss);
log_aserror(_("ASnative(%s): args must be 0 or above"),
- fn.dump_args());
+ ss.str());
)
return as_value();
}
=== modified file 'libcore/vm/fn_call.h'
--- a/libcore/vm/fn_call.h 2010-04-21 22:06:19 +0000
+++ b/libcore/vm/fn_call.h 2010-06-22 06:03:51 +0000
@@ -121,25 +121,25 @@
/// null) whenever a function requires it.
fn_call(as_object* this_in, const as_environment& env_in,
Args& args, as_object* sup = 0, bool isNew = false)
- :
+ :
this_ptr(this_in),
super(sup),
nargs(args.size()),
callerDef(0),
- _new(isNew),
- _env(env_in)
- {
- args.swap(_args);
- }
+ _env(env_in),
+ _new(isNew)
+ {
+ args.swap(_args);
+ }
fn_call(as_object* this_in, const as_environment& env_in)
- :
- this_ptr(this_in),
- super(0),
- nargs(0),
+ :
+ this_ptr(this_in),
+ super(0),
+ nargs(0),
callerDef(0),
- _new(false),
- _env(env_in)
+ _env(env_in),
+ _new(false)
{
}
@@ -148,11 +148,11 @@
:
this_ptr(fn.this_ptr),
super(fn.super),
- nargs(fn.nargs),
+ nargs(fn.nargs),
callerDef(fn.callerDef),
- _new(false),
_env(fn._env),
- _args(fn._args)
+ _args(fn._args),
+ _new(false)
{
}
@@ -172,73 +172,55 @@
const movie_definition* callerDef;
/// Return the VM this fn_call is running from
- VM& getVM() const
- {
- return _env.getVM();
- }
+ VM& getVM() const {
+ return _env.getVM();
+ }
/// Return true if this call is an object instantiation
- bool isInstantiation() const
- {
- return _new;
+ bool isInstantiation() const {
+ return _new;
}
/// Access a particular argument.
- const Args::value_type& arg(unsigned int n) const
- {
- assert(n < nargs);
- return _args[n];
+ const Args::value_type& arg(unsigned int n) const {
+ assert(n < nargs);
+ return _args[n];
}
const Args::container_type& getArgs() const {
return _args;
}
- void drop_bottom()
- {
- assert(!_args.empty());
- _args.erase(_args.begin());
- --nargs;
+ void drop_bottom() {
+ assert(!_args.empty());
+ _args.erase(_args.begin());
+ --nargs;
}
- const as_environment& env() const
- {
- return _env;
+ const as_environment& env() const {
+ return _env;
}
/// Dump arguments to given output stream
- void dump_args(std::ostream& os) const
- {
- for (size_t i = 0; i < nargs; ++i) {
- if ( i ) os << ", ";
- os << arg(i).toDebugString();
- }
- }
-
- /// Return arguments as a string (for debugging)
- std::string dump_args() const
- {
- std::stringstream ss;
- dump_args(ss);
- return ss.str();
- }
-
- void resetArgs()
- {
- nargs = 0;
- _args.clear();
- }
-
- void pushArg(const Args::value_type& arg)
- {
- ++nargs;
- _args.push_back(arg);
+ void dump_args(std::ostream& os) const {
+ for (size_t i = 0; i < nargs; ++i) {
+ if ( i ) os << ", ";
+ os << arg(i).toDebugString();
+ }
+ }
+
+ void resetArgs() {
+ nargs = 0;
+ _args.clear();
+ }
+
+ void pushArg(const Args::value_type& arg) {
+ ++nargs;
+ _args.push_back(arg);
}
private:
- bool _new;
-
/// The ActionScript environment in which the function call is taking
/// place. This contains, among other things, the function arguments.
const as_environment& _env;
@@ -246,6 +228,8 @@
/// The actual arguments
Args::container_type _args;
+ bool _new;
+
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r12267: Formatting and cleanups only: no functional changes.,
Benjamin Wolsey <=