Guest User

Untitled

a guest
Mar 26th, 2010
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.46 KB | None | 0 0
  1. Index: cpptoxml/main.cpp
  2. ===================================================================
  3. --- cpptoxml/main.cpp (revision 1107766)
  4. +++ cpptoxml/main.cpp (working copy)
  5. @@ -174,7 +174,7 @@
  6.  
  7. QString templateParametersToString (TemplateParameterList list) {
  8. QString ret;
  9. - foreach(TemplateParameterModelItem p,list) {
  10. + foreach(const TemplateParameterModelItem& p,list) {
  11. ret = ret + p->name() + ';';
  12. }
  13. return ret;
  14. @@ -203,19 +203,19 @@
  15. ret += " members=\"";
  16. }
  17. if (NamespaceModelItem n = model_dynamic_cast<NamespaceModelItem>(i)) {
  18. - foreach(NamespaceModelItem m, n->namespaces())
  19. + foreach(const NamespaceModelItem& m, n->namespaces())
  20. ret += ID_STR(m).append(' ');
  21. }
  22. if (ScopeModelItem s = model_dynamic_cast<ScopeModelItem>(i)) {
  23. - foreach(ClassModelItem n, s->classes())
  24. + foreach(const ClassModelItem& n, s->classes())
  25. ret += ID_STR(n).append(' ');
  26. - foreach(EnumModelItem n, s->enums())
  27. + foreach(const EnumModelItem& n, s->enums())
  28. ret += ID_STR(n).append(' ');
  29. - foreach(FunctionModelItem n, s->functions())
  30. + foreach(const FunctionModelItem& n, s->functions())
  31. ret += ID_STR(n).append(' ');
  32. - foreach(TypeAliasModelItem n, s->typeAliases())
  33. + foreach(const TypeAliasModelItem& n, s->typeAliases())
  34. ret += ID_STR(n).append(' ');
  35. - foreach(VariableModelItem n, s->variables())
  36. + foreach(const VariableModelItem& n, s->variables())
  37. ret += ID_STR(n).append(' ');
  38. }
  39. if (ScopeModelItem s = model_dynamic_cast<ScopeModelItem>(i)) {
  40. @@ -325,32 +325,32 @@
  41. //
  42. QString children;
  43. if (NamespaceModelItem n = model_dynamic_cast<NamespaceModelItem>(i)) {
  44. - foreach(NamespaceModelItem m, n->namespaces())
  45. + foreach(const NamespaceModelItem& m, n->namespaces())
  46. children += visit(model_static_cast<CodeModelItem>(m));
  47. }
  48. if (i->kind() & _CodeModelItem::Kind_Scope) {
  49. //qDebug() << ID_STR(i) << i->name() << current_context;
  50. //CodeModelItem os = current_scope; // save old outer scope
  51. if (!i->name().isEmpty()) { current_context << i->name(); current_scope << i; }
  52. - foreach(ClassModelItem n, model_dynamic_cast<ScopeModelItem>(i)->classes())
  53. + foreach(const ClassModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->classes())
  54. children += visit(model_static_cast<CodeModelItem>(n));
  55. - foreach(EnumModelItem n, model_dynamic_cast<ScopeModelItem>(i)->enums())
  56. + foreach(const EnumModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->enums())
  57. children += visit(model_static_cast<CodeModelItem>(n));
  58. - foreach(FunctionModelItem n, model_dynamic_cast<ScopeModelItem>(i)->functions())
  59. + foreach(const FunctionModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->functions())
  60. children += visit(model_static_cast<CodeModelItem>(n));
  61. - foreach(TypeAliasModelItem n, model_dynamic_cast<ScopeModelItem>(i)->typeAliases())
  62. + foreach(const TypeAliasModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->typeAliases())
  63. children += visit(model_static_cast<CodeModelItem>(n));
  64. - foreach(VariableModelItem n, model_dynamic_cast<ScopeModelItem>(i)->variables())
  65. + foreach(const VariableModelItem& n, model_dynamic_cast<ScopeModelItem>(i)->variables())
  66. children += visit(model_static_cast<CodeModelItem>(n));
  67. if (!i->name().isEmpty()) { current_context.removeLast(); current_scope.pop_back(); }
  68. }
  69. if (FunctionModelItem f = model_dynamic_cast<FunctionModelItem>(i)) {
  70. - foreach(ArgumentModelItem a, f->arguments())
  71. + foreach(const ArgumentModelItem& a, f->arguments())
  72. children += visit(model_static_cast<CodeModelItem>(a));
  73. }
  74. if (EnumModelItem e = model_dynamic_cast<EnumModelItem>(i)) {
  75. QString last = QChar('0');
  76. - foreach(EnumeratorModelItem n, model_dynamic_cast<EnumModelItem>(i)->enumerators()) {
  77. + foreach(const EnumeratorModelItem& n, model_dynamic_cast<EnumModelItem>(i)->enumerators()) {
  78. if (n->value() == QString())
  79. n->setValue(last.append("+1")); //FIXME: Is there a reason for not putting the value itself? :S
  80. children += visit(model_static_cast<CodeModelItem>(n));
  81. Index: cpptoxml/parser/binder.cpp
  82. ===================================================================
  83. --- cpptoxml/parser/binder.cpp (revision 1107766)
  84. +++ cpptoxml/parser/binder.cpp (working copy)
  85. @@ -279,7 +279,7 @@
  86. fun->setVariadics (decl_cc.isVariadics ());
  87.  
  88. // ... and the signature
  89. - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
  90. + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
  91. {
  92. ArgumentModelItem arg = model()->create<ArgumentModelItem>();
  93. arg->setType(qualifyType(p.type, _M_context));
  94. @@ -309,7 +309,7 @@
  95. {
  96. typeInfo.setFunctionPointer (true);
  97. decl_cc.run (init_declarator->declarator);
  98. - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
  99. + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
  100. typeInfo.addArgument(p.type);
  101. }
  102.  
  103. @@ -380,7 +380,7 @@
  104.  
  105. _M_current_function->setVariadics (decl_cc.isVariadics ());
  106.  
  107. - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
  108. + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
  109. {
  110. ArgumentModelItem arg = model()->create<ArgumentModelItem>();
  111. arg->setType(qualifyType(p.type, functionScope->qualifiedName()));
  112. @@ -532,7 +532,7 @@
  113. {
  114. typeInfo.setFunctionPointer (true);
  115. decl_cc.run (init_declarator->declarator);
  116. - foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters())
  117. + foreach (const DeclaratorCompiler::Parameter& p, decl_cc.parameters())
  118. typeInfo.addArgument(p.type);
  119. }
  120.  
  121. @@ -888,7 +888,7 @@
  122.  
  123. if (ClassModelItem klass = model_dynamic_cast<ClassModelItem> (scope))
  124. {
  125. - foreach (QString base, klass->baseClasses ())
  126. + foreach (const QString& base, klass->baseClasses ())
  127. {
  128. QStringList ctx = context;
  129. ctx.removeLast();
  130. Index: cpptoxml/parser/codemodel.cpp
  131. ===================================================================
  132. --- cpptoxml/parser/codemodel.cpp (revision 1107766)
  133. +++ cpptoxml/parser/codemodel.cpp (working copy)
  134. @@ -400,7 +400,7 @@
  135. {
  136. FunctionList function_list = findFunctions(item->name());
  137.  
  138. - foreach (FunctionModelItem fun, function_list)
  139. + foreach (const FunctionModelItem& fun, function_list)
  140. {
  141. if (fun->isSimilar(item))
  142. return fun;
Advertisement
Add Comment
Please, Sign In to add comment