forked from qt-creator/qt-creator
Compile fix for use of QVarLengthArray
Change-Id: Ia68a121f61aab3667d1a4c99ba348fbfe2e98d4d Reviewed-by: Bill King <bill.king@nokia.com>
This commit is contained in:
@@ -494,7 +494,8 @@ static int findUniqueTypeMatch(int sourceParamIndex, Function *sourceFunction, F
|
|||||||
Symbol *sourceParam = sourceFunction->argumentAt(sourceParamIndex);
|
Symbol *sourceParam = sourceFunction->argumentAt(sourceParamIndex);
|
||||||
|
|
||||||
// if other sourceParams have the same type, we can't do anything
|
// if other sourceParams have the same type, we can't do anything
|
||||||
foreach (int otherSourceParamIndex, sourceParams) {
|
for (int i = 0; i < sourceParams.size(); ++i) {
|
||||||
|
int otherSourceParamIndex = sourceParams.at(i);
|
||||||
if (sourceParamIndex == otherSourceParamIndex)
|
if (sourceParamIndex == otherSourceParamIndex)
|
||||||
continue;
|
continue;
|
||||||
if (sourceParam->type().isEqualTo(sourceFunction->argumentAt(otherSourceParamIndex)->type()))
|
if (sourceParam->type().isEqualTo(sourceFunction->argumentAt(otherSourceParamIndex)->type()))
|
||||||
@@ -504,7 +505,8 @@ static int findUniqueTypeMatch(int sourceParamIndex, Function *sourceFunction, F
|
|||||||
// if there's exactly one newParam with the same type, bind to that
|
// if there's exactly one newParam with the same type, bind to that
|
||||||
// this is primarily done to catch moves of unnamed parameters
|
// this is primarily done to catch moves of unnamed parameters
|
||||||
int newParamWithSameTypeIndex = -1;
|
int newParamWithSameTypeIndex = -1;
|
||||||
foreach (int newParamIndex, newParams) {
|
for (int i = 0; i < newParams.size(); ++i) {
|
||||||
|
int newParamIndex = newParams.at(i);
|
||||||
if (sourceParam->type().isEqualTo(newFunction->argumentAt(newParamIndex)->type())) {
|
if (sourceParam->type().isEqualTo(newFunction->argumentAt(newParamIndex)->type())) {
|
||||||
if (newParamWithSameTypeIndex != -1)
|
if (newParamWithSameTypeIndex != -1)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -520,7 +522,7 @@ static IndicesList unmatchedIndices(const IndicesList &indices)
|
|||||||
ret.reserve(indices.size());
|
ret.reserve(indices.size());
|
||||||
for (int i = 0; i < indices.size(); ++i) {
|
for (int i = 0; i < indices.size(); ++i) {
|
||||||
if (indices[i] == -1)
|
if (indices[i] == -1)
|
||||||
ret += i;
|
ret.append(i);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -668,7 +670,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
QTC_ASSERT(targetFunctionDeclarator->parameter_declaration_clause, return changes);
|
QTC_ASSERT(targetFunctionDeclarator->parameter_declaration_clause, return changes);
|
||||||
for (ParameterDeclarationListAST *it = targetFunctionDeclarator->parameter_declaration_clause->parameter_declaration_list;
|
for (ParameterDeclarationListAST *it = targetFunctionDeclarator->parameter_declaration_clause->parameter_declaration_list;
|
||||||
it; it = it->next) {
|
it; it = it->next) {
|
||||||
targetParameterDecls += it->value;
|
targetParameterDecls.append(it->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the number of parameters in sourceFunction or targetFunction
|
// the number of parameters in sourceFunction or targetFunction
|
||||||
@@ -736,7 +738,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
|||||||
// find unique type matches among the unbound parameters
|
// find unique type matches among the unbound parameters
|
||||||
const IndicesList &freeSourceParams = unmatchedIndices(sourceParamToNewParam);
|
const IndicesList &freeSourceParams = unmatchedIndices(sourceParamToNewParam);
|
||||||
const IndicesList &freeNewParams = unmatchedIndices(newParamToSourceParam);
|
const IndicesList &freeNewParams = unmatchedIndices(newParamToSourceParam);
|
||||||
foreach (int sourceParamIndex, freeSourceParams) {
|
for (int i = 0; i < freeSourceParams.size(); ++i) {
|
||||||
|
int sourceParamIndex = freeSourceParams.at(i);
|
||||||
const int newParamWithSameTypeIndex = findUniqueTypeMatch(
|
const int newParamWithSameTypeIndex = findUniqueTypeMatch(
|
||||||
sourceParamIndex, sourceFunction, newFunction,
|
sourceParamIndex, sourceFunction, newFunction,
|
||||||
freeSourceParams, freeNewParams);
|
freeSourceParams, freeNewParams);
|
||||||
|
Reference in New Issue
Block a user