projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
52c4188
)
-Weffc++ cleanup for miniswig
author
Ingo Ruhnke
<grumbel@gmx.de>
Sat, 21 Nov 2009 14:39:51 +0000
(14:39 +0000)
committer
Ingo Ruhnke
<grumbel@gmx.de>
Sat, 21 Nov 2009 14:39:51 +0000
(14:39 +0000)
SVN-Revision: 6079
tools/miniswig/create_wrapper.hpp
patch
|
blob
|
history
tools/miniswig/parser.yy
patch
|
blob
|
history
tools/miniswig/tree.hpp
patch
|
blob
|
history
tools/miniswig/xmlwriter.cpp
patch
|
blob
|
history
diff --git
a/tools/miniswig/create_wrapper.hpp
b/tools/miniswig/create_wrapper.hpp
index
a2e5395
..
2fbe54d
100644
(file)
--- a/
tools/miniswig/create_wrapper.hpp
+++ b/
tools/miniswig/create_wrapper.hpp
@@
-12,11
+12,12
@@
public:
std::ostream& out;
std::ostream& hppout;
std::ostream& out;
std::ostream& hppout;
- WrapperCreator(std::ostream& _out = std::cout, std::ostream& _hppout = std::cout)
- : out(_out), hppout(_hppout)
- {
- ind = " ";
- }
+ WrapperCreator(std::ostream& _out = std::cout, std::ostream& _hppout = std::cout) :
+ ind(" "),
+ out(_out),
+ hppout(_hppout),
+ ns_prefix()
+ { }
void create_wrapper(Namespace* ns);
void create_wrapper(Namespace* ns);
@@
-41,6
+42,10
@@
private:
void create_function_wrapper(Class* _class, Function* function);
void prepare_argument(const Type& type, size_t idx, const std::string& var);
void push_to_stack(const Type& type, const std::string& var);
void create_function_wrapper(Class* _class, Function* function);
void prepare_argument(const Type& type, size_t idx, const std::string& var);
void push_to_stack(const Type& type, const std::string& var);
+
+private:
+ WrapperCreator(const WrapperCreator&);
+ WrapperCreator& operator=(const WrapperCreator&);
};
#endif
};
#endif
diff --git
a/tools/miniswig/parser.yy
b/tools/miniswig/parser.yy
index
03fb00c
..
a47ffed
100644
(file)
--- a/
tools/miniswig/parser.yy
+++ b/
tools/miniswig/parser.yy
@@
-40,7
+40,8
@@
static ClassMember::Visibility current_visibility;
class ParseError : public std::exception
{
public:
class ParseError : public std::exception
{
public:
- ParseError(const std::string& message) throw()
+ ParseError(const std::string& message) throw() :
+ message()
{
std::ostringstream msg;
msg << "Parse error in '" << current_file
{
std::ostringstream msg;
msg << "Parse error in '" << current_file
diff --git
a/tools/miniswig/tree.hpp
b/tools/miniswig/tree.hpp
index
5c7927f
..
47741de
100644
(file)
--- a/
tools/miniswig/tree.hpp
+++ b/
tools/miniswig/tree.hpp
@@
-12,8
+12,9
@@
class Namespace;
class AtomicType {
public:
class AtomicType {
public:
- AtomicType()
- : parent(0)
+ AtomicType() :
+ name(),
+ parent(0)
{ }
virtual ~AtomicType()
{ }
{ }
virtual ~AtomicType()
{ }
@@
-25,6
+26,10
@@
public:
std::string name;
Namespace* parent;
std::string name;
Namespace* parent;
+
+private:
+ AtomicType(const AtomicType&);
+ AtomicType& operator=(const AtomicType&);
};
class BasicType : public AtomicType {
};
class BasicType : public AtomicType {
@@
-156,14
+161,23
@@
private:
static StringType* _instance;
};
static StringType* _instance;
};
-class Parameter {
+class Parameter
+{
public:
public:
+ Parameter() :
+ name(),
+ type()
+ { }
+
std::string name;
Type type;
};
class ClassMember {
public:
std::string name;
Type type;
};
class ClassMember {
public:
+ ClassMember() :
+ visibility()
+ { }
virtual ~ClassMember()
{ }
virtual ~ClassMember()
{ }
@@
-177,10
+191,19
@@
public:
class Function : public ClassMember {
public:
class Function : public ClassMember {
public:
- Function() {
- type = FUNCTION;
- suspend = false;
- custom = false;
+ Function() :
+ type(),
+ suspend(),
+ custom(),
+ parameter_spec(),
+ docu_comment(),
+ name(),
+ return_type(),
+ parameters()
+ {
+ type = FUNCTION;
+ suspend = false;
+ custom = false;
}
enum FuncType {
}
enum FuncType {
@@
-202,7
+225,14
@@
public:
class Field : public ClassMember {
public:
class Field : public ClassMember {
public:
- Field()
+ Field() :
+ type(),
+ docu_comment(),
+ name(),
+ has_const_value(),
+ const_float_value(),
+ const_int_value(),
+ const_string_value()
{
has_const_value = false;
}
{
has_const_value = false;
}
@@
-212,18
+242,25
@@
public:
std::string name;
bool has_const_value;
std::string name;
bool has_const_value;
- union {
- float const_float_value;
- int const_int_value;
- };
+ float const_float_value;
+ int const_int_value;
std::string const_string_value;
std::string const_string_value;
+
+private:
+ Field(const Field&);
+ Field& operator=(const Field&);
};
class Class : public AtomicType {
public:
};
class Class : public AtomicType {
public:
+ Class() :
+ members(),
+ super_classes(),
+ sub_classes(),
+ docu_comment()
+ { }
~Class() {
~Class() {
- for(std::vector<ClassMember*>::iterator i = members.begin();
- i != members.end(); ++i)
+ for(std::vector<ClassMember*>::iterator i = members.begin(); i != members.end(); ++i)
delete *i;
}
delete *i;
}
@@
-235,7
+272,14
@@
public:
class Namespace {
public:
class Namespace {
public:
- Namespace() {
+ Namespace() :
+ functions(),
+ fields(),
+ types(),
+ namespaces(),
+ parent(),
+ name()
+ {
parent = 0;
}
virtual ~Namespace() {
parent = 0;
}
virtual ~Namespace() {
@@
-303,6
+347,10
@@
public:
Namespace* parent;
std::string name;
Namespace* parent;
std::string name;
+
+private:
+ Namespace(const Namespace&);
+ Namespace& operator=(const Namespace&);
};
class CompilationUnit : public Namespace {
};
class CompilationUnit : public Namespace {
diff --git
a/tools/miniswig/xmlwriter.cpp
b/tools/miniswig/xmlwriter.cpp
index
8a1f228
..
5bc0b53
100644
(file)
--- a/
tools/miniswig/xmlwriter.cpp
+++ b/
tools/miniswig/xmlwriter.cpp
@@
-4,8
+4,12
@@
#include <sstream>
#include "xmlwriter.hpp"
#include <sstream>
#include "xmlwriter.hpp"
-XmlWriter::XmlWriter(std::ostream& outstream)
- : out(outstream), indent(0)
+XmlWriter::XmlWriter(std::ostream& outstream) :
+ out(outstream),
+ indent(0),
+ closetag(),
+ lasttag(),
+ sections()
{
}
{
}