Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: cpptoxml/main.cpp
- ===================================================================
- --- cpptoxml/main.cpp (revision 1107766)
- +++ cpptoxml/main.cpp (working copy)
- @@ -174,7 +174,7 @@
- QString templateParametersToString (TemplateParameterList list) {
- QString ret;
- - foreach(TemplateParameterModelItem p,list) {
- + foreach(const TemplateParameterModelItem& p,list) {
- ret = ret + p->name() + ';';
- }
- return ret;
- @@ -203,19 +203,19 @@
- ret += " members=\"";
- }
- if (NamespaceModelItem n = model_dynamic_cast<NamespaceModelItem>(i)) {
- - foreach(NamespaceModelItem m, n->namespaces())
- + foreach(const NamespaceModelItem& m, n->namespaces())
- ret += ID_STR(m).append(' ');
- }
- if (ScopeModelItem s = model_dynamic_cast<ScopeModelItem>(i)) {
- - foreach(ClassModelItem n, s->classes())
- + foreach(const ClassModelItem& n, s->classes())
- ret += ID_STR(n).append(' ');
- - foreach(EnumModelItem n, s->enums())
- + foreach(const EnumModelItem& n, s->enums())
- ret += ID_STR(n).append(' ');
- - foreach(FunctionModelItem n, s->functions())
- + foreach(const FunctionModelItem& n, s->functions())
- ret += ID_STR(n).append(' ');
- - foreach(TypeAliasModelItem n, s->typeAliases())
- + foreach(const TypeAliasModelItem& n, s->typeAliases())
- ret += ID_STR(n).append(' ');
- - foreach(VariableModelItem n, s->variables())
- + foreach(const VariableModelItem& n, s->variables())
- ret += ID_STR(n).append(' ');
- }
- if (ScopeModelItem s = model_dynamic_cast<ScopeModelItem>(i)) {
- @@ -325,32 +325,32 @@
- //
- QString children;
- if (NamespaceModelItem n = model_dynamic_cast<NamespaceModelItem>(i)) {
- - foreach(NamespaceModelItem m, n->namespaces())
- + foreach(const NamespaceModelItem& m, n->namespaces())
- children += visit(model_static_cast<CodeModelItem>(m));
- }
- if (i->kind() & _CodeModelItem::Kind_Scope) {
- //qDebug() << ID_STR(i) << i->name() << current_context;
- //CodeModelItem os = current_scope; // save old outer scope
- if (!i->name().isEmpty()) { current_context << i->name(); current_scope << i; }
- - foreach(ClassModelItem n, model_dynamic_cast<ScopeModelItem>(i)->classes())
- + foreach(const ClassModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->classes())
- children += visit(model_static_cast<CodeModelItem>(n));
- - foreach(EnumModelItem n, model_dynamic_cast<ScopeModelItem>(i)->enums())
- + foreach(const EnumModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->enums())
- children += visit(model_static_cast<CodeModelItem>(n));
- - foreach(FunctionModelItem n, model_dynamic_cast<ScopeModelItem>(i)->functions())
- + foreach(const FunctionModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->functions())
- children += visit(model_static_cast<CodeModelItem>(n));
- - foreach(TypeAliasModelItem n, model_dynamic_cast<ScopeModelItem>(i)->typeAliases())
- + foreach(const TypeAliasModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->typeAliases())
- children += visit(model_static_cast<CodeModelItem>(n));
- - foreach(VariableModelItem n, model_dynamic_cast<ScopeModelItem>(i)->variables())
- + foreach(const VariableModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->variables())
- children += visit(model_static_cast<CodeModelItem>(n));
- if (!i->name().isEmpty()) { current_context.removeLast(); current_scope.pop_back(); }
- }
- if (FunctionModelItem f = model_dynamic_cast<FunctionModelItem>(i)) {
- - foreach(ArgumentModelItem a, f->arguments())
- + foreach(const ArgumentModelItem& a, f->arguments())
- children += visit(model_static_cast<CodeModelItem>(a));
- }
- if (EnumModelItem e = model_dynamic_cast<EnumModelItem>(i)) {
- QString last = QChar('0');
- - foreach(EnumeratorModelItem n, model_dynamic_cast<EnumModelItem>(i)->enumerators()) {
- + foreach(const EnumeratorModelItem& n, model_dynamic_cast<EnumModelItem>(i)->enumerators()) {
- if (n->value() == QString())
- n->setValue(last.append("+1")); //FIXME: Is there a reason for not putting the value itself? :S
- children += visit(model_static_cast<CodeModelItem>(n));
- Index: cpptoxml/parser/binder.cpp
- ===================================================================
- --- cpptoxml/parser/binder.cpp (revision 1107766)
- +++ cpptoxml/parser/binder.cpp (working copy)
- @@ -279,7 +279,7 @@
- fun->setVariadics (decl_cc.isVariadics ());
- // ... and the signature
- - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
- + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
- {
- ArgumentModelItem arg = model()->create<ArgumentModelItem>();
- arg->setType(qualifyType(p.type, _M_context));
- @@ -309,7 +309,7 @@
- {
- typeInfo.setFunctionPointer (true);
- decl_cc.run (init_declarator->declarator);
- - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
- + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
- typeInfo.addArgument(p.type);
- }
- @@ -380,7 +380,7 @@
- _M_current_function->setVariadics (decl_cc.isVariadics ());
- - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
- + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
- {
- ArgumentModelItem arg = model()->create<ArgumentModelItem>();
- arg->setType(qualifyType(p.type, functionScope->qualifiedName()));
- @@ -532,7 +532,7 @@
- {
- typeInfo.setFunctionPointer (true);
- decl_cc.run (init_declarator->declarator);
- - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
- + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
- typeInfo.addArgument(p.type);
- }
- @@ -888,7 +888,7 @@
- if (ClassModelItem klass = model_dynamic_cast<ClassModelItem> (scope))
- {
- - foreach (QString base, klass->baseClasses ())
- + foreach (const QString& base, klass->baseClasses ())
- {
- QStringList ctx = context;
- ctx.removeLast();
- Index: cpptoxml/parser/codemodel.cpp
- ===================================================================
- --- cpptoxml/parser/codemodel.cpp (revision 1107766)
- +++ cpptoxml/parser/codemodel.cpp (working copy)
- @@ -400,7 +400,7 @@
- {
- FunctionList function_list = findFunctions(item->name());
- - foreach (FunctionModelItem fun, function_list)
- + foreach (const FunctionModelItem& fun, function_list)
- {
- if (fun->isSimilar(item))
- return fun;
Advertisement
Add Comment
Please, Sign In to add comment