Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 109
chore: Replace deprecated Qt macros and Improve const correctness#309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -331,7 +331,8 @@ void Binder::declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_ | ||
| fun->setVariadics (decl_cc.isVariadics ()); | ||
| // ... and the signature | ||
| foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) | ||
| const QList<DeclaratorCompiler::Parameter> parameters = decl_cc.parameters(); | ||
| for (const DeclaratorCompiler::Parameter& p : parameters) | ||
| { | ||
jcfr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ArgumentModelItem arg = model()->create<ArgumentModelItem>(); | ||
| arg->setType(qualifyType(p.type, _M_context)); | ||
| @@ -361,8 +362,10 @@ void Binder::declare_symbol(SimpleDeclarationAST *node, InitDeclaratorAST *init_ | ||
| { | ||
| typeInfo.setFunctionPointer (true); | ||
| decl_cc.run (init_declarator->declarator); | ||
| foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) | ||
| const QList<DeclaratorCompiler::Parameter> parameters = decl_cc.parameters(); | ||
| for (const DeclaratorCompiler::Parameter& p : parameters) { | ||
| typeInfo.addArgument(p.type); | ||
| } | ||
| } | ||
| var->setType(qualifyType(typeInfo, _M_context)); | ||
| @@ -426,7 +429,8 @@ void Binder::visitFunctionDefinition(FunctionDefinitionAST *node) | ||
| } | ||
| decl_cc.run(declarator); | ||
| foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) { | ||
| const QList<DeclaratorCompiler::Parameter> parameters = decl_cc.parameters(); | ||
| for (const DeclaratorCompiler::Parameter& p : parameters) { | ||
| if (p.type.isRvalueReference()) { | ||
| //warnHere(); | ||
| //std::cerr << "** Skipping function with rvalue reference parameter: " | ||
| @@ -481,22 +485,25 @@ void Binder::visitFunctionDefinition(FunctionDefinitionAST *node) | ||
| } | ||
| _M_current_function->setVariadics (decl_cc.isVariadics ()); | ||
| foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) | ||
| for (const DeclaratorCompiler::Parameter& p : parameters) | ||
| { | ||
| ArgumentModelItem arg = model()->create<ArgumentModelItem>(); | ||
| // Work on a local copy of the type only | ||
| TypeInfo parameter_type = p.type; | ||
| if (_M_current_class && _M_current_class->isTemplateClass()) | ||
| { | ||
| QStringList qualifiedName = p.type.qualifiedName(); | ||
| QStringList qualifiedName = parameter_type.qualifiedName(); | ||
| if (qualifiedName.size() == 1 && !qualifiedName.last().contains('<') && | ||
| qualifiedName.last() == _M_current_class->name().split('<').first()) | ||
| { | ||
| // Fix: add template arguments if the argument type is the current class | ||
| // name without template arguments | ||
| p.type.setQualifiedName(QStringList(_M_current_class->name())); | ||
| parameter_type.setQualifiedName(QStringList(_M_current_class->name())); | ||
| } | ||
| } | ||
| arg->setType(qualifyType(p.type, functionScope->qualifiedName())); | ||
| arg->setType(qualifyType(parameter_type, functionScope->qualifiedName())); | ||
| arg->setName(p.name); | ||
| arg->setDefaultValue(p.defaultValue); | ||
| if (p.defaultValue) | ||
| @@ -650,8 +657,10 @@ void Binder::visitTypedef(TypedefAST *node) | ||
| { | ||
| typeInfo.setFunctionPointer (true); | ||
| decl_cc.run (init_declarator->declarator); | ||
| foreach (DeclaratorCompiler::Parameter p, decl_cc.parameters()) | ||
| const QList<DeclaratorCompiler::Parameter> parameters = decl_cc.parameters(); | ||
| for (const DeclaratorCompiler::Parameter& p : parameters) { | ||
| typeInfo.addArgument(p.type); | ||
| } | ||
| } | ||
| ScopeModelItem scope = currentScope(); | ||
| @@ -1029,7 +1038,8 @@ TypeInfo Binder::qualifyType(const TypeInfo &type, const QStringList &context) c | ||
| if (ClassModelItem klass = scope.dynamicCast<_ClassModelItem> ()) | ||
| { | ||
| foreach (QString base, klass->baseClasses ()) | ||
| const QStringList baseClasses = klass->baseClasses(); | ||
| for (const QString& base : baseClasses) | ||
| { | ||
| QStringList ctx = context; | ||
| ctx.removeLast(); | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.