From 81825142d4df0392b781f24272aa934a750bc811 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 4 May 2012 15:28:04 +0200 Subject: [PATCH] Put the code in namespaces. --- qmljs_objects.cpp | 2 ++ qmljs_objects.h | 6 ++++++ qmljs_runtime.cpp | 2 ++ qmljs_runtime.h | 6 ++++++ qv4codegen.cpp | 2 +- qv4isel.cpp | 2 ++ qv4isel_p.h | 6 ++++-- 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/qmljs_objects.cpp b/qmljs_objects.cpp index e15c000..57332ab 100644 --- a/qmljs_objects.cpp +++ b/qmljs_objects.cpp @@ -2,6 +2,8 @@ #include "qmljs_objects.h" #include +using namespace QQmlJS::VM; + Object::~Object() { delete members; diff --git a/qmljs_objects.h b/qmljs_objects.h index 1945048..cabdf5c 100644 --- a/qmljs_objects.h +++ b/qmljs_objects.h @@ -7,6 +7,9 @@ #include #include +namespace QQmlJS { +namespace VM { + struct Value; struct Object; struct BooleanObject; @@ -260,4 +263,7 @@ struct Context { } }; +} // namespace VM +} // namespace QQmlJS + #endif // QMLJS_OBJECTS_H diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 3e4f6a5..ee7384e 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -4,6 +4,8 @@ #include #include +using namespace QQmlJS::VM; + Value Value::string(Context *ctx, const QString &s) { return string(ctx, String::get(ctx, s)); diff --git a/qmljs_runtime.h b/qmljs_runtime.h index 18d0c61..349d714 100644 --- a/qmljs_runtime.h +++ b/qmljs_runtime.h @@ -5,6 +5,9 @@ #include #include +namespace QQmlJS { +namespace VM { + enum ValueType { UNDEFINED_TYPE, NULL_TYPE, @@ -624,4 +627,7 @@ inline bool __qmljs_strict_equal(Context *ctx, const Value *x, const Value *y) } // extern "C" +} // namespace VM +} // namespace QQmlJS + #endif // QMLJS_RUNTIME_H diff --git a/qv4codegen.cpp b/qv4codegen.cpp index b0e318d..3b176ef 100644 --- a/qv4codegen.cpp +++ b/qv4codegen.cpp @@ -409,7 +409,7 @@ void Codegen::operator()(AST::Program *node) _block->JUMP(_exitBlock); } - InstructionSelection isel(_module); + x86_64::InstructionSelection isel(_module); foreach (IR::Function *function, _module->functions) { linearize(function); diff --git a/qv4isel.cpp b/qv4isel.cpp index 94f3d2c..e68569e 100644 --- a/qv4isel.cpp +++ b/qv4isel.cpp @@ -19,6 +19,8 @@ typedef void *gpointer; #endif using namespace QQmlJS; +using namespace QQmlJS::x86_64; +using namespace QQmlJS::VM; static inline bool protect(const void *addr, size_t size) { diff --git a/qv4isel_p.h b/qv4isel_p.h index dabc434..9c85c19 100644 --- a/qv4isel_p.h +++ b/qv4isel_p.h @@ -7,6 +7,7 @@ #include namespace QQmlJS { +namespace x86_64 { class InstructionSelection: protected IR::StmtVisitor { @@ -17,7 +18,7 @@ public: void visitFunction(IR::Function *function); protected: - String *identifier(const QString &s); + VM::String *identifier(const QString &s); int tempOffset(IR::Temp *t); void loadTempAddress(int reg, IR::Temp *t); @@ -37,9 +38,10 @@ private: uchar *_codePtr; QHash > _patches; QHash _addrs; - QHash _identifiers; + QHash _identifiers; }; +} // end of namespace x86_64 } // end of namespace QQmlJS #endif // QV4ISEL_P_H -- 2.7.4