[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9704: Minor changes for less messy c
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9704: Minor changes for less messy code. |
Date: |
Thu, 16 Apr 2009 11:38:41 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9704
committer: Benjamin Wolsey <address@hidden>
branch nick: avm2
timestamp: Thu 2009-04-16 11:38:41 +0200
message:
Minor changes for less messy code.
modified:
libcore/asClass.h
libcore/parser/abc_block.cpp
libcore/parser/abc_block.h
------------------------------------------------------------
revno: 9703.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: avm2-work
timestamp: Thu 2009-04-16 10:57:58 +0200
message:
Rename abc_parsing to abc and abc_Trait to Trait.
modified:
libcore/asClass.h
libcore/parser/abc_block.cpp
libcore/parser/abc_block.h
------------------------------------------------------------
revno: 9703.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: avm2-work
timestamp: Thu 2009-04-16 11:37:01 +0200
message:
Declare typedefs inside classes. Drop duplicated typedef.
modified:
libcore/parser/abc_block.h
=== modified file 'libcore/asClass.h'
--- a/libcore/asClass.h 2009-03-25 11:02:48 +0000
+++ b/libcore/asClass.h 2009-04-16 08:57:58 +0000
@@ -47,11 +47,11 @@
class Machine;
class abc_function;
-namespace abc_parsing {
-class abc_Trait;
+namespace abc {
+class Trait;
}
-using namespace abc_parsing;
+using namespace abc;
class asException
{
public:
@@ -681,7 +681,7 @@
asBinding* getGetBinding(as_value& v, asName& n);
asBinding* getSetBinding(as_value& v, asName& n);
- std::vector<abc_Trait> _traits;
+ std::vector<Trait> _traits;
private:
=== modified file 'libcore/parser/abc_block.cpp'
--- a/libcore/parser/abc_block.cpp 2009-04-01 08:08:07 +0000
+++ b/libcore/parser/abc_block.cpp 2009-04-16 08:57:58 +0000
@@ -31,10 +31,10 @@
namespace gnash {
-namespace abc_parsing {
+namespace abc {
bool
-abc_Trait::finalize(abc_block *pBlock, asClass *pClass, bool do_static)
+Trait::finalize(abc_block *pBlock, asClass *pClass, bool do_static)
{
log_abc("In finalize class name=%s trait kind=0x%X",
pBlock->_stringPool[pClass->getName()], _kind | 0x0);
@@ -111,7 +111,7 @@
}
bool
-abc_Trait::finalize_mbody(abc_block *pBlock, asMethod *pMethod)
+Trait::finalize_mbody(abc_block *pBlock, asMethod *pMethod)
{
log_abc("Finalizing method");
switch (_kind)
@@ -186,7 +186,7 @@
/// Read an AS3 'trait'
bool
-abc_Trait::read(SWFStream* in, abc_block *pBlock)
+Trait::read(SWFStream* in, abc_block *pBlock)
{
boost::uint32_t name = in->read_V32();
if (name >= pBlock->_multinamePool.size())
@@ -290,9 +290,9 @@
return true;
}
-} // abc_parsing
+} // abc
-using namespace abc_parsing;
+using namespace abc;
abc_block::abc_block()
:
@@ -317,7 +317,7 @@
boost::bind(&asMethod::initPrototype, _1, mach));
std::for_each(_traits.begin(), _traits.end(),
- boost::bind(&abc_Trait::finalize, _1, this));
+ boost::bind(&Trait::finalize, _1, this));
_traits.clear();
@@ -1022,7 +1022,7 @@
log_abc("Trait count: %u", tcount);
for (unsigned int j = 0; j < tcount; ++j)
{
- abc_Trait &aTrait = newTrait();
+ Trait &aTrait = newTrait();
aTrait.set_target(pClass, false);
if (!aTrait.read(mS, this))
return false;
@@ -1061,7 +1061,7 @@
log_abc("This class has %u traits.", tcount);
for (unsigned int j = 0; j < tcount; ++j)
{
- abc_Trait &aTrait = newTrait();
+ Trait &aTrait = newTrait();
aTrait.set_target(pClass, true);
if (!(aTrait.read(mS, this)))
return false;
@@ -1105,7 +1105,7 @@
for (unsigned int j = 0; j < tcount; ++j)
{
- abc_Trait &aTrait = newTrait();
+ Trait &aTrait = newTrait();
aTrait.set_target(pScript, false);
if (!(aTrait.read(mS, this))) {
return false;
@@ -1218,7 +1218,7 @@
boost::uint32_t tcount = mS->read_V32();
for (unsigned int j = 0; j < tcount; ++j)
{
- abc_Trait &aTrait = newTrait();
+ Trait &aTrait = newTrait();
aTrait.set_target(_methods[offset]);
if (!aTrait.read(mS, this)) {
// TODO: 'method body activation traits'
@@ -1273,7 +1273,7 @@
/* The loop below causes a segmentation fault, because it tries to modify
asMethod.mPrototype, which is never initialized. The parser seems
to work ok without this call.*/
-/* std::vector<abc_Trait*>::iterator i = mTraits.begin();
+/* std::vector<Trait*>::iterator i = mTraits.begin();
for ( ; i != mTraits.end(); ++i)
{
if (!(*i)->finalize(this))
=== modified file 'libcore/parser/abc_block.h'
--- a/libcore/parser/abc_block.h 2009-03-25 11:02:48 +0000
+++ b/libcore/parser/abc_block.h 2009-04-16 09:37:01 +0000
@@ -35,18 +35,14 @@
namespace gnash {
-typedef std::vector<asNamespace *> abcNamespaceSet;
-
class abc_block;
class ClassHierarchy;
class asMethod;
class asClass;
-namespace abc_parsing {
-
-class abc_Trait;
-
-class abc_Trait
+namespace abc {
+
+class Trait
{
public:
@@ -77,7 +73,7 @@
asMethod* _methodTarget;
bool _static;
- abc_Trait()
+ Trait()
:
_hasValue(false),
_kind(KIND_SLOT),
@@ -120,13 +116,14 @@
}
};
-} // namespace abc_parsing
+} // namespace abc
-typedef std::vector<asNamespace*> NamespaceSet;
class abc_block
{
public:
+
+ typedef std::vector<asNamespace*> NamespaceSet;
abc_block();
@@ -134,9 +131,9 @@
asClass* locateClass(const std::string& className);
- abc_parsing::abc_Trait &newTrait()
+ abc::Trait &newTrait()
{
- abc_parsing::abc_Trait *p = new abc_parsing::abc_Trait;
+ abc::Trait *p = new abc::Trait;
_traits.push_back(p);
return *p;
}
@@ -195,7 +192,7 @@
private:
- friend class abc_parsing::abc_Trait;
+ friend class abc::Trait;
bool read_version();
bool read_integer_constants();
@@ -260,7 +257,7 @@
std::vector<asName> _multinamePool;
std::vector<asClass*> _classes;
std::vector<asClass*> _scripts;
- std::vector<abc_parsing::abc_Trait*> _traits;
+ std::vector<abc::Trait*> _traits;
string_table* _stringTable;
SWFStream* mS; // Not stored beyond one read.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9704: Minor changes for less messy code.,
Benjamin Wolsey <=