Commit c051372a by Jamie Madill Committed by Commit Bot

Fix standalone variable shadowing warning.

Introduced in https://chromium-review.googlesource.com/362641 Eventually we'll switch to using the same sets of warnings for standalone and GN ANGLE. BUG=angleproject:1441 Change-Id: I6534b9f85b952ddf1d953342cf9c8ddc5de6614e Reviewed-on: https://chromium-review.googlesource.com/362780Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 0c8abca1
......@@ -158,7 +158,7 @@ void VariableInitializer::insertInitCode(TIntermSequence *sequence)
TStructure *structure = new TStructure(new TString(var.structName.c_str()), fields);
TType type;
type.setStruct(structure);
for (int ii = 0; ii < static_cast<int>(var.fields.size()); ++ii)
for (int fieldIndex = 0; fieldIndex < static_cast<int>(var.fields.size()); ++fieldIndex)
{
TIntermBinary *assign = new TIntermBinary(EOpAssign);
sequence->insert(sequence->begin(), assign);
......@@ -166,11 +166,11 @@ void VariableInitializer::insertInitCode(TIntermSequence *sequence)
TIntermBinary *indexDirectStruct = new TIntermBinary(EOpIndexDirectStruct);
TIntermSymbol *symbol = new TIntermSymbol(0, name, type);
indexDirectStruct->setLeft(symbol);
TIntermConstantUnion *indexNode = constructIndexNode(ii);
TIntermConstantUnion *indexNode = constructIndexNode(fieldIndex);
indexDirectStruct->setRight(indexNode);
assign->setLeft(indexDirectStruct);
const sh::ShaderVariable &field = var.fields[ii];
const sh::ShaderVariable &field = var.fields[fieldIndex];
TType fieldType = sh::ConvertShaderVariableTypeToTType(field.type);
TIntermConstantUnion *zeroConst = constructConstUnionNode(fieldType);
assign->setRight(zeroConst);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment